This query is pertaining to POINT functionality in Easytrieve.
I had a requirement where i had to read a file based on an account (one part of the key). Of all the records existing for that account in the file, if any one had a schedule as 'Y'; i should dump all the records for the account in an extract.
I have two ways to go about it
1) Set partial key...do a point and read records for account..till a schedule of 'Y' is found; if schedule is 'Y', set dump=Y and then go back to Set partial key and this time dump all records based on dump='Y' flag.
:
Rec1 Account1 N
Rec2 Account1 N
Rec3 Account1 Y ---go back to point and restart from Rec1
:
Rec1 Account1 N
Rec2 Account1 N
Rec3 Account1 Y ---go back to point and restart from Rec1
:
2) Have two DD's pointing to same file. Process DD1...set partial key, do a point and read records for account..till a schedule= 'Y' is found; if schedule is 'Y', then set a point in DD2 for same account and start dumping records for the account.
DD1 DD2
:
Account1 N Account1 N
Account1 N Account1 N
Account1 Y---- do a point in DD2 and dump Account1 Y
:
:
Account1 N Account1 N
Account1 N Account1 N
Account1 Y---- do a point in DD2 and dump Account1 Y
:
Step 1 is what i used but i was suggested to refrain from using it. I have not understood why.
Can some one please suggest which way is better and why?
Thank you,
AB.