View previous topic :: View next topic |
Author |
Message |
Aswin Beginner
Joined: 12 Jun 2007 Posts: 22 Topics: 6
|
Posted: Mon Jul 09, 2007 10:50 am Post subject: how to i extract first n rec form input file. |
|
|
hi,
I have file and i want the fist 40 rec of the file to be written to output based on the condition. |
|
Back to top |
|
|
Aswin Beginner
Joined: 12 Jun 2007 Posts: 22 Topics: 6
|
Posted: Mon Jul 09, 2007 10:54 am Post subject: |
|
|
thanks you .
i got the answer . we can use stratrec and endrec.
SORT FIELDS=COPY
OUTFIL FNAMES=SORTOUT1,STARTREC=5,ENDREC=9
OUTFIL FNAMES=SORTOUT1,STARTREC=12,ENDREC=14 |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12376 Topics: 75 Location: San Jose
|
Posted: Mon Jul 09, 2007 10:58 am Post subject: |
|
|
Aswin,
Try this
Code: |
//STEP0100 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=YOUR INPUT FILE,
// DISP=SHR
//SORTOUT DD SYSOUT=*
//SYSIN DD *
INCLUDE COND=(P,M,F,EQ,C'YOUR CONDITION')
OPTION STOPAFT=40
SORT FIELDS=COPY
/*
|
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12376 Topics: 75 Location: San Jose
|
Posted: Mon Jul 09, 2007 10:59 am Post subject: |
|
|
Aswin wrote: | thanks you .
i got the answer . we can use stratrec and endrec.
SORT FIELDS=COPY
OUTFIL FNAMES=SORTOUT1,STARTREC=5,ENDREC=9
OUTFIL FNAMES=SORTOUT1,STARTREC=12,ENDREC=14 |
If you are running syncsort then the job will fail with duplicate Fnames
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
|
Aswin Beginner
Joined: 12 Jun 2007 Posts: 22 Topics: 6
|
Posted: Mon Jul 09, 2007 1:49 pm Post subject: |
|
|
thanks,
Its working fine. I have used stopaft condition. |
|
Back to top |
|
|
|
|