Focal Point
[SOLVED] removing unprintable characters from a parameter field

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/4707064096

June 29, 2018, 02:11 PM
DWaybright
[SOLVED] removing unprintable characters from a parameter field
I have a parameterized report and I want to use the selected parms in the header, so I've got some set commands to make the header pretty but sometimes I get unprintable characters in the parms which messes everything up. I've tried using POSITION and PATTERN to figure out where the characters are so I could maybe substring them out, but I'm getting errors.
Here is the code and the ECHO ALL mess. I've checked and rechecked the code; there are no unbalanced parenthesis in the code.

TABLE FILE pol_active
SUM POL_ACTIVE.COUNTER AS 'Cnt'
COMPUTE c_Percent_of_Total/D12.2=POL_ACTIVE.COUNTER/TOT.D_Active * 100 ; AS 'Tot%'
BY d_Ded_Category AS 'Category'
BY D_DED_CAT_TEXT AS 'Deductible'
ACROSS POL_ACTIVE.ME_M1 AS ' '
WHERE POL_ACTIVE.POLICY_TYPE EQ 'CMP';
WHERE D_Region EQ &D_Region.(OR(,,,, |FORMAT=A255V)).D_Region:. AND POL_ACTIVE.POLICY_STATE EQ &POLICY_STATE.(OR(FIND POL_ACTIVE.POLICY_STATE IN POL_ACTIVE |FORMAT=A2)).State:. AND POL_ACTIVE.AGENCY_NAME EQ &AGENCY_NAME.(OR(FIND POL_ACTIVE.AGENCY_NAME IN POL_ACTIVE |FORMAT=A100)).Agency Name:. AND POL_ACTIVE.RISK_TYPE_DESC EQ &RISK_TYPE_DESC.(OR(FIND POL_ACTIVE.RISK_TYPE_DESC IN POL_ACTIVE |FORMAT=A50)).Risk Type Desc:. AND D_TIV_Group EQ &D_TIV_Group.(OR(,,, |FORMAT=A255V)).TIV Group:.;

-SET &SRegion= ' ';
-SET &SRegion= TRIM('B', (STRIP(47, 'CR', '''', 'A47V')), 47, ' ', 1, 'A47V');
-SET &Region= IF CRgion-?ê? EQ 'CR OR ER OR SR OR WR OR Large Account' THEN 'All Regions' ELSE CRgion-?ê? ;
-SET &State = IF _FOC_NULL EQ _FOC_NULL THEN '' ELSE ' State(s): ' | _FOC_NULL;
-SET &Agency = IF _FOC_NULL EQ _FOC_NULL THEN '' ELSE ' Agency: ' | _FOC_NULL;
-SET &Risk = IF _FOC_NULL EQ _FOC_NULL THEN '' ELSE ' Risk: ' | _FOC_NULL;
-SET &STIV= TRIM('T', (STRIP(65, 'A. 0-4 TIV', '''', 'A55V')), 50, ' ', 1, 'A46V');
-SET &TIV = IF A. 0-4 TIV0?ê? EQ '0-4 TIV OR 4-10 TIV OR 10-20 TIV OR 20plus TIV' THEN 'All TIV Groups' ELSE 'A. 0-4 TIV0?ê?';
-SET &Header3= CRgion-?ê? | | | ;
-SET &STIVp= PATTERN(100, A. 0-4 TIV0?ê?, 'A100V');
-SET &TIV3 = POSITION('X' 'A. 9-9 AAAXXXXXXXXX9aXXXXXXaaXXXXXXXXXXXXXXXXX ');
0 ERROR AT OR NEAR LINE 14 IN PROCEDURE ADHOCRQ FOCEXEC *
(FOC262) UNBALANCED PARENTHESES


This is making me crazy. My cubemates and I appreciate any and all help! Smiler

--Deb

This message has been edited. Last edited by: DWaybright,


WebFOCUS 8.2.03 (production), 8.2.06 (testing)
AppStudio, InfoAssist
Windows, All Outputs
July 02, 2018, 03:21 AM
Frans
Could you try without the Variable length, so just A47?

It's not clear which version you're running, I know 8.2.02 has problems with STRREP, it might be that STRIP is affected too.


Test: WF 8.2
Prod: WF 8.2
DB: Progress, REST, IBM UniVerse/UniData, SQLServer, MySQL, PostgreSQL, Oracle, Greenplum, Athena.
July 02, 2018, 08:15 AM
DWaybright
Sorry, we're still on 8.1.05M. Planning to go to 8.2.03 in August.

The odd thing is it worked fine for the first week. The only thing that changed (as far as I know) is that we applied a new license.


WebFOCUS 8.2.03 (production), 8.2.06 (testing)
AppStudio, InfoAssist
Windows, All Outputs
July 02, 2018, 10:29 AM
FP Mod Chuck
Deb

This is just a guess but maybe a left or right parentheses is the culprit in your parameter value.


Thank you for using Focal Point!

Chuck Wolff - Focal Point Moderator
WebFOCUS 7x and 8x, Windows, Linux All output Formats
July 02, 2018, 11:13 AM
DWaybright
Chuck,
I thought of that. The TIV groups used to start with "A)" instead of "A.".
I have two reports that use this -- today one of them is working and the other isn't. It almost seems like there is a buffer area that isn't being cleared. Is there a command that clears buffer areas that would be used by the dynamic variables?

Thanks!


WebFOCUS 8.2.03 (production), 8.2.06 (testing)
AppStudio, InfoAssist
Windows, All Outputs
July 02, 2018, 11:33 AM
FP Mod Chuck
Deb

I am not aware of any commands like that.


Thank you for using Focal Point!

Chuck Wolff - Focal Point Moderator
WebFOCUS 7x and 8x, Windows, Linux All output Formats
July 03, 2018, 09:09 AM
DWaybright
I changed the code to use the original parameter amper variable in the header, and that seems to have solved the issue. Gotta love WebFOCUS's quirks!

Thanks all,
Deb


WebFOCUS 8.2.03 (production), 8.2.06 (testing)
AppStudio, InfoAssist
Windows, All Outputs