|
View previous topic :: View next topic
|
| Author |
Message |
LinkinPark Warnings : 1 New User

Joined: 20 Nov 2005 Posts: 44 Location: DALIAN,CHINA
|
|
|
|
Hi Frank Yaeger,
tell u my requirement:
S1.KE and S2.KE have same layout :
e.g
S1.KE
| Code: |
----------------
NAME ID
----------------
0 1 26 2
----------------
A 01
B 02
C 01
D 02
E 03
F 04
|
S2.KE
| Code: |
----------------
NAME ID
----------------
0 1 26 2
----------------
G 01
H 02
I 01
J 02
K 03
L 04
|
and after sort
make sure
dateset sortout1 include following records which only ID=01
| Code: |
----------------
NAME ID
----------------
0 1 26 2
----------------
A 01
C 01
G 01
I 01
|
sortout2 include following records which only ID=02
.............................................
that's all
Thanks&Regards,
LinkinPark |
|
| Back to top |
|
 |
fixdoubts
New User
Joined: 21 Oct 2005 Posts: 54
|
|
|
|
Hi,
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
the output will be
| Code: |
A 01
C 01
G 01
I 01
|
This is with out headers.
Regards, |
|
| Back to top |
|
 |
Alain Benveniste
New User
Joined: 14 Feb 2005 Posts: 88
|
|
|
|
Linkinpark,,
Do the 5 1st records need to be reported in the output : could you clarify this please
You say
But what field needs to be sorted ?
Alain |
|
| Back to top |
|
 |
fixdoubts
New User
Joined: 21 Oct 2005 Posts: 54
|
|
|
|
Hi,
Sorry i didnt read it completely i think this would do,
| Code: |
//STEP0100 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//FILEIN1 DD *
A 01
B 02
C 01
//FILEIN2 DD *
G 01
H 02
I 01
//OUT DD SYSOUT=*
//OUT1 DD SYSOUT=*
//TOOLIN DD *
COPY FROM(FILEIN1) TO(OUT) USING(CPY1)
COPY FROM(FILEIN2) TO(OUT1) USING(CPY2)
/*
//CPY1CNTL DD *
INCLUDE COND=(10,2,CH,EQ,C'01')
/*
//CPY2CNTL DD *
INCLUDE COND=(10,2,CH,EQ,C'02')
/*
//
|
outut
out
out1
Regards, |
|
| Back to top |
|
 |
Frank Yaeger
DFSORT Developer

Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
LinkinPark,
You didn't actually show the records you wanted in SORTOUT2, but assuming that it's all the records with '02', you can use a DFSORT job like this:
| Code: |
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=S1.KE,DISP=SHR
// DD DSN=S2.KE,DISP=SHR
//SORTOUT1 DD DSN=.. output file1 ('01' records)
//SORTOUT2 DD DSN=.. output file2 ('02' records)
//SYSIN DD *
OPTION COPY
OUTFIL FNAMES=SORTOUT1,INCLUDE=(26,2,CH,EQ,C'01')
OUTFIL FNAMES=SORTOUT2,INCLUDE=(26,2,CH,EQ,C'02')
/*
|
SORTOUT1 will have:
| Code: |
A 01
C 01
G 01
I 01
|
SORTOUT2 will have:
| Code: |
B 02
D 02
H 02
J 02
|
In your example, the records are already sorted by position 1, but if you actually need to sort by position 1, just change OPTION COPY to:
| Code: |
SORT FIELDS=(1,1,CH,A)
|
|
|
| Back to top |
|
 |
MGIndaco
Active User

Joined: 10 Mar 2005 Posts: 432 Location: Milan, Italy
|
|
|
|
Can this help you?
| Code: |
//STEP010S EXEC PGM=ICETOOL
//DFSMSG DD SYSOUT=*
//TOOLMSG DD SYSOUT=*
//IN1 DD *
----------------
NAME ID
----------------
0 1 26 2
----------------
A 01
B 02
C 01
D 02
E 03
F 04
//IN2 DD *
----------------
NAME ID
----------------
0 1 26 2
----------------
G 01
H 02
I 01
J 02
K 03
L 04
//OUT DD SYSOUT=*
//TOOLIN DD *
COPY FROM(IN1) USING(CTL1)
COPY FROM(IN1) USING(CTL2)
COPY FROM(IN2) USING(CTL2)
//CTL1CNTL DD *
OUTFIL FNAMES=OUT,ENDREC=5
//CTL2CNTL DD *
OUTFIL FNAMES=OUT,STARTREC=6,INCLUDE=(10,2,CH,EQ,C'01') |
I hope in this.
P.S.= You can also divide header and body to do the same...
If you try this solution your output must be coded with
|
|
| Back to top |
|
 |
MGIndaco
Active User

Joined: 10 Mar 2005 Posts: 432 Location: Milan, Italy
|
|
|
|
Ops...
for multiple output you must change, after OUT DD SYSOUT=* with:
| Code: |
//OUT01 DD SYSOUT=*
//OUT02 DD SYSOUT=*
//OUT03 DD SYSOUT=*
//OUT04 DD SYSOUT=*
//TOOLIN DD *
COPY FROM(IN1) USING(CTL1)
COPY FROM(IN1) USING(CTL2)
COPY FROM(IN2) USING(CTL2)
//CTL1CNTL DD *
OUTFIL FNAMES=OUT01,ENDREC=5
OUTFIL FNAMES=OUT02,ENDREC=5
OUTFIL FNAMES=OUT03,ENDREC=5
OUTFIL FNAMES=OUT04,ENDREC=5
//CTL2CNTL DD *
OUTFIL FNAMES=OUT01,STARTREC=6,INCLUDE=(10,2,CH,EQ,C'01')
OUTFIL FNAMES=OUT02,STARTREC=6,INCLUDE=(10,2,CH,EQ,C'02')
OUTFIL FNAMES=OUT03,STARTREC=6,INCLUDE=(10,2,CH,EQ,C'03')
OUTFIL FNAMES=OUT04,STARTREC=6,INCLUDE=(10,2,CH,EQ,C'04') |
|
|
| Back to top |
|
 |
Frank Yaeger
DFSORT Developer

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. |
|
| Back to top |
|
 |
LinkinPark Warnings : 1 New User

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 ?
Thank u very much ,
LinkinPark |
|
| Back to top |
|
 |
Frank Yaeger
DFSORT Developer

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.
If you're using DFSORT:
All of the DFSORT documentation is available at:
Use [URL] BBCode for External Links
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. |
|
| Back to top |
|
 |
LinkinPark Warnings : 1 New User

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" ?
Regards&Thanks,
LinkinPark |
|
| Back to top |
|
 |
LinkinPark Warnings : 1 New User

Joined: 20 Nov 2005 Posts: 44 Location: DALIAN,CHINA
|
|
|
|
Hi Frank
I changed the "SORT" to "MERGE" ,following is code :
| Code: |
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN01 DD DSN=S1.KE,DISP=SHR
//SORTIN02 DD DSN=S2.KE,DISP=SHR
//SORTOUT1 DD DSN=.. output file1 ('01' records)
//SORTOUT2 DD DSN=.. output file2 ('02' records)
//SYSIN DD *
MERGE FIELDS=(1,1,CH,A)
OUTFIL FNAMES=SORTOUT1,INCLUDE=(26,2,CH,EQ,C'01')
OUTFIL FNAMES=SORTOUT2,INCLUDE=(26,2,CH,EQ,C'02')
/*
|
abend with error code 16 ,How to solve this problem?
Regards&Thanks,
LinkinPark |
|
| Back to top |
|
 |
MGIndaco
Active User

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?
As usual I hope in my helps but I can be wrong. |
|
| Back to top |
|
 |
Frank Yaeger
DFSORT Developer

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. |
|
| Back to top |
|
 |
Frank Yaeger
DFSORT Developer

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. |
|
| Back to top |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|