Focal Point
Hold files in WHERE STATEMENTS and FOC038 error

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

March 14, 2008, 01:31 PM
BobV
Hold files in WHERE STATEMENTS and FOC038 error
I have beeen using the following discussion thread to try and use the values in a HOLD file as criteria for a report.
https://forums.informationbuilders.com/eve/forums/a/tpc/...001036132#7001036132

But I keep getting this error: (FOC038) THE EXTERNAL FILE DOES NOT CONTAIN ANY TEST LITERALS: HOLD

MY code looks like this:

TABLE FILE ACCTS
SUM CNT_NEW_ACCTS
BY CUST_ID
WHERE TOTAL ( CNT_NEW_ACCTS EQ 0 );
ON TABLE HOLD FORMAT ALPHA
END

TABLE FILE ACCTS
PRINT
CUST_ID
ACCT_NBR
WHERE (CUST_ID IN FILE HOLD);
ON TABLE PCHOLD FORMAT EXL2K
END


Thank you, Robert


WF (App Studio) 8.2.01m / Windows
Mainframe FOCUS 8
March 14, 2008, 01:44 PM
Leah
Do you actual have a store area for hold (FILEDEF). The big issue is if you want to use 'where .. in file) what is in the 'in file' can only be one column.

Not knowing your database, it would seem that if you took your code, changed the 'ON TABLE HOLD FORMAT ALPHA' to 'ON TABLE HOLD AS NEWACCTS' (JUST AN EXAMPLE NAME) then

JOIN CUST_ID IN NEWACCTS TO ALL CUST_ID IN ACCTS AS J1
TABLE FILE NEWACCTS....

This of course persumes that the CUST_ID is a keY in ACCTS.


Leah
March 14, 2008, 01:48 PM
mgrackin
Try the following to get a clean file to use in the subsequent WHERE clause.

SET HOLDLIST=PRINTONLY

TABLE FILE ACCTS
SUM CNT_NEW_ACCTS NOPRINT
BY CUST_ID
WHERE TOTAL ( CNT_NEW_ACCTS EQ 0 );
ON TABLE SAVE FORMAT ALPHA
END

TABLE FILE ACCTS
PRINT
CUST_ID
ACCT_NBR
WHERE (CUST_ID IN FILE HOLD);
ON TABLE PCHOLD FORMAT EXL2K
END


Thanks!

Mickey

FOCUS/WebFOCUS 1990 - 2011
March 14, 2008, 01:52 PM
mgrackin
Of course you can do this all in one request:

TABLE FILE ACCTS
SUM CNT_NEW_ACCTS NOPRINT
BY CUST_ID
PRINT ACCT_NBR
BY CUST_ID
WHERE TOTAL ( CNT_NEW_ACCTS EQ 0 );
ON TABLE PCHOLD FORMAT EXL2K
END


Thanks!

Mickey

FOCUS/WebFOCUS 1990 - 2011