Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref

Author Message

New User

Joined: 05 Sep 2004
Posts: 21

 Posted: Sun Sep 05, 2004 4:45 pm    Post subject: How to sort the even number of records from file using jcl hai any can one tell me ,how to sort the even number of records from file using jcl thaknk u in advance

Ramya A

Active User

Joined: 26 Jul 2004
Posts: 104

 Posted: Sat Sep 11, 2004 12:23 pm    Post subject: Let me check if my understanding is right. You need the alternate records from your input to your output. If this is right, then pls find the answer below: Using ICEMAN, you can do the requested operation. SPLIT is a way to split up a data set. It can be used to split the records as evenly as possible among the output data sets. SPLIT writes one record to each output data set in rotation. Here's an example of SPLIT for an input data set with 10 records: //SPLIT EXEC PGM=ICEMAN //SYSOUT DD SYSOUT=* //SORTIN DD DSN=Y897797.INPUT1,DISP=OLD //OUT1 DD DSN=Y897797.SPLIT1,DISP=(NEW,CATLG), // SPACE=(CYL,(5,5)),UNIT=SYSDA //OUT2 DD DSN=Y897797.SPLIT2,DISP=(NEW,CATLG), // SPACE=(CYL,(5,5)),UNIT=SYSDA //SYSIN DD * SORT FIELDS=(21,5,FS,A) OUTFIL FNAMES=(OUT1,OUT2),SPLIT /* The first sorted record is written to the OUT1 data set, the second sorted record is written to the OUT2 data set and the third sorted record is written to the OUT1 data set, and so on in rotation. The resulting output data sets would contain the following records: Y897797.SPLIT1 (OUT1 DD) sorted record 1 sorted record 3 sorted record 5 sorted record 7 sorted record 9 Y897797.SPLIT2 (OUT2 DD) sorted record 2 sorted record 4 sorted record 6 sorted record 8 sorted record 10 Now the second file will give you the even number of records.

New User

Joined: 05 Sep 2004
Posts: 21

 Posted: Sun Jun 05, 2005 9:58 pm    Post subject: Re: sort selected number of records Hi, thanks for replay. badal.[/b]
Frank Yaeger

DFSORT Moderator

Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

Posted: Mon Jun 06, 2005 1:32 am    Post subject:

If you just need the even sorted records (2, 4, 6, ...), you can also do it using this DFSORT job:

 Code: //S1 EXEC PGM=ICEMAN //SYSOUT DD SYSOUT=* //SORTIN DD DSN=...  input file //SORTOUT DD DSN=...  output file //SYSIN DD *    SORT FIELDS=(...)    OUTFIL STARTREC=2,SAMPLE=2 /*
Frank Yaeger

DFSORT Moderator

Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

Posted: Mon Jun 06, 2005 9:45 pm    Post subject:

 Quote: without ICEMAN, in DFHSORT also u can sort these problems.

This makes no sense. ICEMAN is DFSORT. What is DFHSORT?

You asked how to sort the even numbered records. I showed you an easier way to do that with DFSORT. I don't understand the point of your post.
 All times are GMT + 6 Hours
 Page 1 of 1

Search our Forum:

 Topic Author Forum Replies Posted Similar Topics How to Generate JCL using Sort naveen katkuri DFSORT/ICETOOL 7 Tue Mar 13, 2018 3:50 pm Need better approach to create a sort... Vamshi Veludandi DFSORT/ICETOOL 8 Thu Mar 08, 2018 5:59 pm Can we merge these two sort cards int... abdulrafi JCL & VSAM 2 Thu Mar 08, 2018 4:03 pm Copy set of records based on condition krish.deepu SYNCSORT 2 Thu Mar 08, 2018 11:39 am write multiple lines in PS file in cobol Balu5491 COBOL Programming 7 Wed Mar 07, 2018 10:27 am

 © 2003-2017 IBM MAINFRAME Software Support Division
 Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us