March 14, 2008, 01:31 PM
BobVHold 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#7001036132But 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
March 14, 2008, 01:44 PM
LeahDo 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.
March 14, 2008, 01:48 PM
mgrackinTry the following to get a clean file to use in the subsequent WHERE clause.
SET HOLDLIST=PRINTONLYTABLE FILE ACCTS
SUM CNT_NEW_ACCTS
NOPRINTBY 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
March 14, 2008, 01:52 PM
mgrackinOf 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