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
 
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 SORT BUT RETAIN HIGHEST VALUE ON NON-... leondan22 DFSORT/ICETOOL 0 Thu Dec 14, 2017 8:13 pm
No new posts query to fetch record which has only ... maxsubrat DB2 12 Mon Dec 11, 2017 5:03 pm
No new posts Extract record for change in combinat... Trinadh DFSORT/ICETOOL 6 Thu Nov 23, 2017 3:32 pm
No new posts Extract Record using range of Data scorp_rahul23 DFSORT/ICETOOL 3 Wed Nov 15, 2017 11:54 pm
No new posts VBS and VB, COBOL syntax is the same ... natt.sut COBOL Programming 3 Sun Nov 12, 2017 6:36 am

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