Focal Point
Converting output from a HOLD file to -SET &MONTH

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

May 24, 2006, 09:57 AM
S.J. Kadish
Converting 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!


Sandy Kadish
Dev: 8.2.04- PostgreSQL
Test: 8.2.04 - PostgreSQL
Prod: 8.2.04 - PostgreSQL
May 24, 2006, 11:03 AM
Tony A
Sandy,

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



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
May 24, 2006, 11:21 AM
Lenny Ward
I 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


(Production: WebFOCUS 7.1.3 on Win 2K/IIS 6/CGI)
(Test: WebFOCUS 7.1.3 on Win 2K/IIS 6/CGI)