Focal Point
Storing results of HOLD FILES in variables

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

October 23, 2009, 04:50 AM
Abhi85
Storing results of HOLD FILES in variables
I have a requirement wherein I need to store the values of a column in HOLDFILE in a variable as comma separated.

Let us suppose I have a holdfile HOLDVAL.
TABLE FILE HOLDVAL
PRINT VAL
END

If the result of the above query has rows such as
ONE
TWO
THREE.
I want them in the format ONE,TWO,THREE stored in a variable.


WebFOCUS 7.6.4
Windows
Excel, HTML, PDF
October 23, 2009, 11:02 AM
jodye
Hi

Here is some sample code.

Jodye

 
-SET &ECHO=ALL;
TABLE FILE CAR
PRINT DST.COUNTRY
ON TABLE HOLD AS CNTRIES FORMAT ALPHA
END


-RUN
-SET &MYVAR='';
-DOREAD
-READ CNTRIES &X.A10.
-IF &IORETURN NE 0 GOTO LSTREAD;
-TYPE X=&X
-SET &MYVAR=IF &MYVAR EQ '' THEN &X ELSE &MYVAR || ',' || &X;

-GOTO DOREAD;
-LSTREAD
-TYPE MYVAR=&MYVAR
-EXIT
 



WF 8.0.0.5M