May 24, 2006, 09:57 AM
S.J. KadishConverting output from a HOLD file to -SET &MONTH
We want to convert the output from a HOLD file:
TABLE FILE SECRET_DATA
PRINT MONTH
BY YEAR
BY HIGHEST 1 MONTH
WHERE YEAR EQ '06'
IF RECORDLIMIT EQ 1
ON TABLE HOLD AS HOLD0
END
-RUN
-DEFAULTS &YR = '06';
-SET &MO = HOLD0.MONTH;
-SET &YR_MO = '20' | &YR | &MO ;
-SET &YEAR = '20' | &YR;
-SET &YR_MO_DA = '20' | &YR | &MO | '01';
but the &MO passed through is the literal text
'HOLD0.MONTH'.
If anybody can, Focal Point can!
May 24, 2006, 11:03 AM
Tony ASandy,
You can not pass data direct from a file to a DM variable in this manner, you have to read it in first -
TABLE FILE SECRET_DATA
BY HIGHEST year
BY HIGHEST 1 month
WHERE year EQ '2006'
IF RECORDLIMIT EQ 1
ON TABLE SAVE AS HOLD0 FORMAT ALPHA
END
-RUN
-DEFAULTS &YR = '06';
-READ HOLD0 &Year.A4. &MO.A2.
-*SET &MO = HOLD0.MONTH;
-SET &YR_MO = '20' | &YR | &MO ;
-SET &YEAR = '20' | &YR;
-SET &YR_MO_DA = '20' | &YR | &MO | '01';
T
May 24, 2006, 11:21 AM
Lenny WardI always thought that would be a great new feature for WebFOCUS, the ability to set an &var directly from the TABLE request without having to do the hold file and then READ.
Something like this.
TABLE FILE SECRET_DATA
PRINT MONTH SET &MO
YEAR SET &YR
BY YEAR
BY HIGHEST 1 MONTH
WHERE YEAR EQ '06'
IF RECORDLIMIT EQ 1
END
-* This would display the value from the SET
-TYPE &MO
-TYPE &YR