View previous topic :: View next topic
|
Author |
Message |
Ganesh K Rajan
New User
Joined: 13 May 2005 Posts: 7
|
|
|
|
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 |
|
|
notonly4u
New User
Joined: 26 Apr 2005 Posts: 87 Location: Hyderabad
|
|
|
|
Hi ganesh,
Try coding stopaft = 1.
This will stop after writing the first record. Hope it works fine.
Regards
Tanden |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
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 |
|
|
|