Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

How to sort the even number of records from file using jcl

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
badal

New User


Joined: 05 Sep 2004
Posts: 21

PostPosted: Sun Sep 05, 2004 4:45 pm    Post subject: How to sort the even number of records from file using jcl
Reply with quote

hai
any can one tell me ,how to sort the even number of records from file using jcl
thaknk u in advance
Back to top
View user's profile Send private message

Ramya A

Active User


Joined: 26 Jul 2004
Posts: 104

PostPosted: Sat Sep 11, 2004 12:23 pm    Post subject:
Reply with quote

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.
Back to top
View user's profile Send private message
badal

New User


Joined: 05 Sep 2004
Posts: 21

PostPosted: Sun Jun 05, 2005 9:58 pm    Post subject: Re: sort selected number of records
Reply with quote

Hi,
thanks for replay.
badal.[/b]
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


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

PostPosted: Mon Jun 06, 2005 1:32 am    Post subject:
Reply with quote

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
/*
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


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

PostPosted: Mon Jun 06, 2005 9:45 pm    Post subject:
Reply with quote

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.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Changing of LRECL of a file abdulrafi DFSORT/ICETOOL 1 Fri Mar 24, 2017 3:25 pm
No new posts splitting a file abdulrafi DFSORT/ICETOOL 3 Fri Mar 24, 2017 11:51 am
No new posts Receive a file using PCOMM macro Harald.v.K IBM Tools 0 Thu Mar 23, 2017 6:50 pm
No new posts Export flat file data into excel sheet murali.andaluri DFSORT/ICETOOL 2 Mon Mar 20, 2017 5:39 pm
No new posts Formatting VB File Learncoholic DFSORT/ICETOOL 3 Mon Mar 20, 2017 12:29 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us