IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

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


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
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
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
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 Developer


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

PostPosted: Tue May 24, 2005 8:59 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Copy only TEXT or String from a record SYNCSORT 4
No new posts JCL sort to compare dates in two file... DFSORT/ICETOOL 2
No new posts Is this possible via sort (in one pass)? SYNCSORT 4
No new posts REXX/CMS How to place command console... CLIST & REXX 4
No new posts combine multiple unique records into ... DFSORT/ICETOOL 2
Search our Forums:

Back to Top