If the records are already in sorted order as shown, then you could do a merge instead of a sort (change SORTIN to SORTIN01 and change SORT to MERGE).
Thanks for that answer Frank.
But when I try to write this to a sortout file which has double the recordlength of the input file its abending with this info:
1 - CONTROL STATEMENTS FOR 5694-A01, Z/OS DFSORT V1R5 - 18:41 ON WED DEC 21, 200
SORT FIELDS=COPY
OUTFIL REMOVECC,NODETAIL,
SECTIONS=(1,5,
TRAILER3=(1,5,X,COUNT=(M11,LENGTH=1)))
0 RECORD TYPE IS F - DATA STARTS IN POSITION 1
0 5 BYTE FIXED RECORD LENGTH IS NOT EQUAL TO 7 BYTE LRECL FOR SORTOUT
0 C5-K05352 C6-Q95214 C7-K90000 C8-K05352 E9-K06751 E7-K90000
3 END OF DFSORT
Here I have a input file of length 5. And I need to write the ouput to a file of record length 7.
Also what shud I do to write only those records whose count exceeds certain limit only. Like
Input File:
aaaa
bbbb
aaaa
aaaa
bbbb
ccccc
I need an output file with only those records whose count is equal to 3. So my output file shud be like
aaaa
Please help.
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
Nithin,
It would really help if you gave all the information needed for somebody to figure out what you want to do in your first post. You showed an example of your input records and what you wanted for output. I showed you how to do that. Now you're telling me you want this and this and ... It's very hard to hit a moving target. In the future, please try to give all of the information needed in your first post.
If your input file has LRECL=5 and you want the output file to have LRECL=7, change the OUTFIL statement to:
Frank,
Thanks for all your help. My problem got resolved by using the second method you provided me. Again, now I am stuck with a different problem.
Here I have multiple input files having the same format and I need a single output file having the same format as that of input file having only those records present all the different input file.
Like :
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
In the future, please start a new topic for a new question - it makes it easier to search.
You say
Quote:
having only those records present all the different input file.
Your output has AAA and CCC, but Input3 only has CCC. AAA is not present in all the input files so why would you expect it to be in the output file?. Please clarify.
Sorry, that was a mistake i made while sending the query. It shud be like
Input1:
AAA
AAA
BBB
CCC
DDD
Input2:
AAA
AAA
BBB
CCC
Input3:
AAA
CCC
My outptu file shud be like
Output file:
AAA
CCC
So basically I need those records common all the input files with no dups.
Frank Yaeger wrote:
In the future, please start a new topic for a new question - it makes it easier to search.
You say
Quote:
having only those records present all the different input file.
Your output has AAA and CCC, but Input3 only has CCC. AAA is not present in all the input files so why would you expect it to be in the output file?. Please clarify.