Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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 SORT BUT RETAIN HIGHEST VALUE ON NON-... leondan22 DFSORT/ICETOOL 2 Thu Dec 14, 2017 8:13 pm
No new posts Inefficient BUILD - VB records paddin... Daniel Prosser SYNCSORT 6 Thu Dec 14, 2017 3:52 pm
No new posts ISSUE IN copying Sequential file reco... thesumitk JCL & VSAM 2 Wed Dec 13, 2017 3:07 pm
No new posts Merging 2 records at multiple rows wi... Bijesh DFSORT/ICETOOL 2 Wed Dec 06, 2017 1:50 am
No new posts File Tailoring -- Temporary dataset i... samzee71 CLIST & REXX 3 Fri Dec 01, 2017 3:12 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us