Regarding Sort Cards



JES, JES2, JCL utilities, IDCAMS, Compile & Run JCLs, PROCs etc...

Regarding Sort Cards

Postby reebahs » Sun Jan 15, 2012 5:22 pm

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.
reebahs
 
Posts: 28
Joined: Thu Dec 09, 2010 1:03 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Regarding Sort Cards

Postby BillyBoyo » Sun Jan 15, 2012 5:34 pm

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?
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: Regarding Sort Cards

Postby reebahs » Sun Jan 15, 2012 5:41 pm

Hi BillyBoyo,

ThankQ for your Quick response.

I`m using DFSORT.

Reg,
Reebahs.
reebahs
 
Posts: 28
Joined: Thu Dec 09, 2010 1:03 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Regarding Sort Cards

Postby BillyBoyo » Sun Jan 15, 2012 6:19 pm

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
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: Regarding Sort Cards

Postby Frank Yaeger » Mon Jan 16, 2012 11:14 pm

Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
User avatar
Frank Yaeger
Global moderator
 
Posts: 1079
Joined: Sat Jun 09, 2007 8:44 pm
Has thanked: 0 time
Been thanked: 15 times


Return to JCL

 


  • Related topics
    Replies
    Views
    Last post