Page 1 of 1

Regarding Sort Cards

PostPosted: Sun Jan 15, 2012 5:22 pm
by reebahs
Hi All,

How are you ?

I have a query on JCL Sorts. How Can we route out only odd records to OUT-FILE1 and even records to OUT-FILE2 from SORTIN file ?

Eg:

I/P File :

First Record
Second Record
Third Record
Fourth Record
Fifth Record
Sixth Record

after job executed,

OUT-FILE1 should have
First Record
Third Record
Fifth Record

OUT-FILE2 should have

Second Record
Fourth Record
Sixth Record




Thanks In Adv.
Reebahs.

Re: Regarding Sort Cards

PostPosted: Sun Jan 15, 2012 5:34 pm
by BillyBoyo
What Sort product are you using, DFSORT, SyncSort or another?

If you don't know, look at the output messages from a Sort step, and tell us the message prefix (ICE = DFSORT, WER = SyncSort).

Are you saying you just want alternate records on the different output files?

Re: Regarding Sort Cards

PostPosted: Sun Jan 15, 2012 5:41 pm
by reebahs
Hi BillyBoyo,

ThankQ for your Quick response.

I`m using DFSORT.

Reg,
Reebahs.

Re: Regarding Sort Cards

PostPosted: Sun Jan 15, 2012 6:19 pm
by BillyBoyo
This is simplified from an example in the "Smart DFSORT Tricks" publication, where the records were distributed between three output files. Have a look at that publication and see that there are several different ways to "split" a file. Have a look through the Table of Contents to give you some idea of what is inside. Then, when you have a particular task next time, you might remember where to find well-documented examples. Don't forget the "Getting Started" and "Reference" are also available on the web.

I have used SYSOUT=* for the output datasets, just for testing.

//SPLIT EXEC PGM=SORT OR ICEMAN
//SYSOUT   DD SYSOUT=*
//SYSIN DD *
                                                     
   OPTION COPY
   OUTFIL FNAMES=(OUT1,OUT2),SPLIT
                                                     
//OUT1 DD SYSOUT=*
//OUT2 DD SYSOUT=*
//SORTIN DD *
1 FOR OUT1
2 FOR OUT2
3 FOR OUT1
4 FOR OUT2
5 FOR OUT1
6 FOR OUT2

Re: Regarding Sort Cards

PostPosted: Mon Jan 16, 2012 11:14 pm
by Frank Yaeger