Joined: 08 Oct 2007 Posts: 27 Location: Dallas, TX
I also have another requirement with this.
In the above requirement I said I will be using a VSAM file (RECL of 304) and a Non VSAM input files (RECL of 80) to create a non VSAM output file (RECL of 160). If the input criteria matches I take a part of input VSAM file (a length of 160) and put it in the Output file.
The output file will be of the format like:
1-----....-----80 81----..........----160
------------------------------------------
1111.....11111 aaaa..........aaaaaa
2222.....22222 cccc............cccccc
2222.....22222 bbbb..........bbbbbb
1111.....11111 dddd..........dddddd
I should Sort this output file with the first 80 bytes and then with the next 80 bytes.
So after sorting I will get a sorted file like this:
1-----....-----80 81----..........----160
-----------------------------------------
1111.....11111 aaaa..........aaaaaa
1111.....11111 dddd..........dddddd
2222.....22222 bbbb..........bbbbbb
2222.....22222 ccccc...........cccccc
From this sorted file I should create a Master Output file (RECL of 80) which has no repetitions in the first 80 bytes. For example the Master output will look like:
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
Here's a DFSORT job that will do what I think you asked for. I assumed your 5-byte PD date field in the VSAM file starts at position 161. If not change the INCLUDE statement appropriately.
Joined: 08 Oct 2007 Posts: 27 Location: Dallas, TX
Thanks Frank.
It was absolutely what I required.
I have a small doubt here!.
In my previous post , I said:
I should Sort this output file with the first 80 bytes and then with the next 80 bytes.
So after sorting I will get a sorted file like this:
1-----....-----80 81----..........----160
-----------------------------------------
1111.....11111 aaaa..........aaaaaa
1111.....11111 dddd..........dddddd
2222.....22222 bbbb..........bbbbbb
2222.....22222 ccccc...........cccccc
But I could see
SORT FIELDS=(1,160,CH,A)
in the above code you gave.
Should I have to change it to
SORT FIELDS=(1,80,CH,A,81,80,CH,A)
Please advise.
Also is there anyway for me to find what is happening during the SORT, like what is the content of the intermediate file and what is the flow of the SORT?. Are there any tools like XPEDITOR to see this. Please let me know.
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
Since the first 80 bytes and next 80 bytes are contiguous
Code:
SORT FIELDS=(1,160,CH,A)
and
Code:
SORT FIELDS=(1,80,CH,A,81,80,CH,A)
are equivalent. You can specify it either way and get the same results.
Quote:
Also is there anyway for me to find what is happening during the SORT, like what is the content of the intermediate file and what is the flow of the SORT?. Are there any tools like XPEDITOR to see this. Please let me know.
I don't know what you're looking for here or why you need it. DFSORT's internal algorithms are proprietary. The actual contents of the work files would not be meaningful to you.