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
 

 

Want to write only the first sort out record into the Output

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

New User


Joined: 13 May 2005
Posts: 7

PostPosted: Tue May 24, 2005 4:00 pm    Post subject: Want to write only the first sort out record into the Output
Reply with quote

Hi,

I am using the sort step to sort set of records after sorting i want to write only the first sort out record into the Sort out file..

i.e

In the Sort in file the records are like
10 23423423
4 23423094
15 33495034

after sort step it will be
15 33495034
10 23423423
4 23423094

i want to write only 15 33495034 to the sort out file...

Is it possible can anybody give me the code step.. It is asap.
Rgs,
Ganesh.K
Back to top
View user's profile Send private message

notonly4u

New User


Joined: 26 Apr 2005
Posts: 87
Location: Hyderabad

PostPosted: Tue May 24, 2005 4:47 pm    Post subject:
Reply with quote

Hi ganesh,

Try coding stopaft = 1.

This will stop after writing the first record. Hope it works fine.

Regards
Tanden
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: Tue May 24, 2005 8:59 pm    Post subject:
Reply with quote

Ganesh,

STOPAFT=1 will NOT do what you want. STOPAFT=1 will read one INPUT record and then do the sort. So you'll only get the first INPUT record (10) which is NOT what you want.

Here's a DFSORT job that will do what you want:

Code:

//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=...  input file
//SORTOUT DD DSN=...  output file
//SYSIN DD *
  SORT FIELDS=(...)
  OUTFIL ENDREC=1
/*


OUTFIL is processed AFTER SORT, so ENDREC=1 will give you the first sorted record.
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 How to change 'K' or 'M' use Sort vice_versa DFSORT/ICETOOL 5 Thu May 18, 2017 7:11 am
No new posts find RACF group for access to spooled... jzhardy JCL & VSAM 1 Mon May 08, 2017 11:46 am
No new posts Adding big TEXT lines to each record ... bshkris SYNCSORT 4 Sat May 06, 2017 1:40 am
This topic is locked: you cannot edit posts or make replies. Merge two files and update Trailer re... Yashashri JCL & VSAM 1 Thu May 04, 2017 12:54 pm
This topic is locked: you cannot edit posts or make replies. SORT trick needed bshkris SYNCSORT 6 Tue May 02, 2017 4:35 am


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