June 23, 2006, 05:23 PM
BethanyHold file table to select data from a table
I want to use a hold file to select records in a table.
Sample Hold File data:
DEPTH DETAIL
1 40
2 200
3 330
Sample Table data:
ACCOUNT DETAIL_01 DETAIL_02 DETAIL_03
123456 10 200 0
456789 40 0 0
876543 20 220 330
258369 20 220 340
741258 10 200 0
So, the depth from the hold file indicates which detail column will have the detail number.
I thought a loop might work but I'm unsure how to write it. I am also open to other ideas.
Any assistance is appreciated.
June 23, 2006, 08:10 PM
wf1998create a hold with detail field, use detail hold file in Table data wgere clause..
Ex:
TABLE FILE depthhold
PRINT
DEATIL
ON TABLE HOLD AS DHOLD FORMAT ALPHA
END
-* Use this hold file in where clause..
EX:
TABLE FILE ACCOUNT
PRINT
-* table selection
WHERE DETAIL_01 IN FILE DHOLD
END
-RUN
let me know if you need more deatils ..