Assuming that in both the files the second field starts in the same position
i have given this soln, hope this helps
Code:
//STEP EXEC PGM=SORT
//SORTIN DD *
A 01
B 02
C 01
D 02
E 03
F 04
// DD *
G 01
H 02
I 01
J 02
K 03
L 04
/*
//SORTOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY
INCLUDE COND=(10,2,CH,EQ,C'01')
/*
//*
i have coded it with in-stream u can use ur files instead
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
Hmmm ... there seems to be a whole lot of confusion about what LinkinPark is trying to do. The way I read it, it's just a matter of putting the records with '01' into output file1 and the records with '02' into output file2? How are the rest of you interpreting it? Where did the idea about the "first 5 records" come from?
LinkinPark,
If any of the solutions given is the one you need, please say so, and explain why. If none of the solutions given are the one you need, please explain exactly what it is you do need.
Joined: 20 Nov 2005 Posts: 44 Location: DALIAN,CHINA
Hi
Frank, it's what you say , I wanna put the records with '01' into output file1 and the records with '02' into output file2 using program "SORT".
but , I dont know "ICEMAN", what is it ?How to use it ? Can I change to "SORT"?Is there any document about it like "SORT" u provide me ?
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
PGM=ICEMAN and PGM=SORT both invoke the sort product installed at your site which may be DFSORT (ICE messages), Syncsort (WER messages) or CA-SORT (CAS messages). You can use PGM=SORT instead of PGM=ICEMAN if you like - they are identical.
Since you're not familiar with DFSORT and DFSORT's ICETOOL, I'd suggest reading through "z/OS DFSORT: Getting Started". It's an excellent tutorial, with lots of examples, that will show you how to use DFSORT, DFSORT's ICETOOL and DFSORT Symbols. You can access it online from the link above.
Joined: 20 Nov 2005 Posts: 44 Location: DALIAN,CHINA
Hi Frank Yaeger,
The method u provide me is not feasibe VASM data set,
"SORTIN VSAM CONCATENATED SORTIN NOT ALLOWED"
How about VASM ? Can I use the "MERGE" instead of "SORT" ?
Joined: 10 Mar 2005 Posts: 432 Location: Milan, Italy
Hi Frank an LinkinPark, I suppose that as usual I'm wrong.
I try to explain my interpreted solution:
We have two file like:
Code:
----------------
NAME ID
----------------
0 1 26 2
----------------
A 01
B 02
C 01
D 02
E 03
F 04
Code:
----------------
NAME ID
----------------
0 1 26 2
----------------
G 01
H 02
I 01
J 02
K 03
L 04
that LinkinPark call S1.KE and S2.KE.
Nobody asked to Linkin if the header is repeated with jump page or other thing so I assume that we have only 5 record for the header.
If the layout is the same(but if is different nothing change) we can accept that the header can be unique for these two file(or more).
Now LinkinPark told us that he need as output this layout:
Code:
----------------
NAME ID
----------------
0 1 26 2
----------------
A 01
C 01
G 01
I 01
that for what I can see is the same of previous except for the content of body section. So I assume that LinkinPark need to filter the content of body only!
For this reason, if the header is not repeated, you can divide, using ICETOOL the header from first or second file and after make a filter like the sample above. If he needs only item 01 and 02, in my opinion he can use this method... I can't see complication in this...
If linkinPark has doubt about ICETOOL noone other than Frank can explain better how it work.
I repeate the sample above using your DD (SORTINnn and SORTOUTn)
Code:
//STEP010S EXEC PGM=ICETOOL
//DFSMSG DD SYSOUT=*
//TOOLMSG DD SYSOUT=*
//SORTIN01 DD *
----------------
NAME ID
----------------
0 1 26 2
----------------
A 01
B 02
C 01
D 02
E 03
F 04
//SORTIN02 DD *
----------------
NAME ID
----------------
0 1 26 2
----------------
G 01
H 02
I 01
J 02
K 03
L 04
//SORTOUT1 DD SYSOUT=*
//SORTOUT2 DD SYSOUT=*
//TOOLIN DD *
COPY FROM(SORTIN01) USING(CTL1)
COPY FROM(SORTIN01) USING(CTL2)
COPY FROM(SORTIN02) USING(CTL2)
//CTL1CNTL DD *
OUTFIL FNAMES=SORTOUT1,ENDREC=5
OUTFIL FNAMES=SORTOUT2,ENDREC=5
//CTL2CNTL DD *
OUTFIL FNAMES=SORTOUT1,STARTREC=6,INCLUDE=(10,2,CH,EQ,C'01')
OUTFIL FNAMES=SORTOUT2,STARTREC=6,INCLUDE=(10,2,CH,EQ,C'02')
and your output will be:
SORTOUT1:
Code:
----------------
NAME ID
----------------
0 1 26 2
----------------
A 01
C 01
G 01
I 01
SORTOUT2
Code:
----------------
NAME ID
----------------
0 1 26 2
----------------
B 02
D 02
H 02
J 02
Now Mr Linkin, has you input a variable header or repetitive?
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
MGIndaco,
Oh, I see. You assumed that the "headers" were actually part of the file. I assumed they were just for illustrative purposes and not actually in the file.
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
Linkinpark,
Why didn't you mention that the input files were VSAM? That's kind of an important thing to leave out. Are the records in the VSAM files all the same length (fixed-length) or different lengths (variable-length)?
What type of VSAM file is it? Does it have a key? If so, how was the key defined?
Are the output files VSAM or non-VSAM?
It's true that the system does not allow concatenation of VSAM files.
You can only use MERGE if the VSAM files are already sorted by the key you want to merge on.
Quote:
abend with error code 16 ,How to solve this problem?
When you get an error or an ABEND, you need to show the information that tells us why you got the error or ABEND. For DFSORT, that would be the //SYSOUT messages.
I suspect the files were not in order by the key you specified, but I couldn't say for sure without seeing the messages.
If you can't merge the files, then you may have to copy them individually.
If you want people to help you in a timely way, you need to learn how to give all of the details of what you're trying to do when you post.