I have a requirement where I will have to select all the distinct accounts only whose credit-amount <> 0 and credit-correction-amount <> 0 with overlay of A for credit and C for correction.
For the above example:
I will have to select distinct accounts whose credit-amount with an overlay of A in front.
Code:
A0000000001
A0000000002
A0000000003
A0000000005
and also select distinct accounts with credit-correction-amount <> 0 with overlay of C in front.
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
You'll need two OUTFIL statements, one for each file.
On the OUTFIL you can INCLUDE=(state,length,ZD,NE,0) for each of your fields, the BUILD=(C'A' and the data you need for one, and BUILD=(C'C' and the data you need for the other.
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
Assuming that the data is already sorted on the key (1,10), the following DFSORT JCL will give you the desired results
The trick here is to the use the same file twice and pick the credit-amount > 0 records from file 1 and build the record as A...... . From File 2 we pick all the records with Credit-correction-amount > 0 and build the record as C......
Now we will match the 2 files and get the desired results.