Focal Point
[CLOSED] Remove single inverted commas from input variables

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

April 30, 2013, 01:49 AM
Sourabh Mukherjee
[CLOSED] Remove single inverted commas from input variables
I need to replace the input variable according to a desired format. For example acct has values incoming as '1204' and want it to like 1204. One more case, if the input is multiple , like '1204' OR '1205' OR '1206' then need the desired output as 1204,105,1206

Thanks in advance for the help.

Regards,
Sourabh

This message has been edited. Last edited by: <Kathryn Henning>,


WebFOCUS 7.6
Windows, All Outputs
April 30, 2013, 03:16 AM
Alan B
If this is form HTML Composer, read this. If not search STRREP.


Alan.
WF 7.705/8.007
April 30, 2013, 09:28 AM
George Patton
Look up EDIT and RJUST


WebFOCUS 7.7.05 Windows, Linux, DB2, IBM Lotus Notes, Firebird, Lotus Symphony/OpenOffice. Outputs PDF, Excel 2007 (for OpenOffice integration), WP
April 30, 2013, 12:38 PM
Rao D
We can remove those quotes using CTRAN. Here is something that I use when passing multiple values into SQLPASS THRU

-PROMPT &CAR.(OR(FIND CAR IN CAR)).Car.;
-SET &CAR = STRREP(&CAR.LENGTH,&CAR,4,' OR ',1,',',&CAR.LENGTH,'A&CAR.LENGTH') ;
-SET &CAR = TRUNCATE(&CAR) ;
-TYPE &CAR;
-SET &CARIN = '(' |&CAR |')' ;
-SET &CARIN = TRUNCATE(&CARIN);
-TYPE &CARIN;
-SET &CAR_NC = TRUNCATE(&CAR);
-TYPE &CAR_NC ;
-SET &CARNC = CTRAN (&CAR_NC.LENGTH,&CAR_NC,39,32,'A&CAR_NC.LENGTH');
-TYPE &CARNC ;
-SET &CARNC = STRIP(&CARNC.LENGTH,&CARNC,' ','A&CARNC.LENGTH') ;
-SET &CARNC = TRUNCATE(&CARNC);
-TYPE &CARNC;
-SET &SQLCAR = IF '&CARNC.EVAL' EQ 'ALL' OR '&CARNC.EVAL' EQ 'FOC_NONE' OR '&CARNC.EVAL' EQ '_FOC_NULL' OR '&CARNC.EVAL' EQ ' ' THEN ' ' ELSE 'AND CAR IN ' | &CARIN ;
-TYPE SQLCAR : &SQLCAR ;


WebFOCUS - ver8201
[ReportingServers: Windows 64bit;
Client: tomcat and IIS on windows 2012
AppStudio

April 30, 2013, 04:18 PM
Twanette
-SET &VAR_IN = '''1204''' | ' OR ' | '''1205''' | ' OR ' | '''1206''' ;
-*
-* Get rid of single quotes
-SET &VAR_OUT1 = STRIP(&VAR_IN.LENGTH , &VAR_IN, '''', 'A50') ;
-* Replace ' OR ' with ','
-SET &VAR_OUT2 = STRREP(&VAR_OUT1.LENGTH,&VAR_OUT1,4,' OR ',1,',',50,'A50');



WebFOCUS 8.2.06 mostly Windows Server