MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

how to i extract first n rec form input file.

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL)
View previous topic :: View next topic  
Author Message
Aswin
Beginner


Joined: 12 Jun 2007
Posts: 22
Topics: 6

PostPosted: Mon Jul 09, 2007 10:50 am    Post subject: how to i extract first n rec form input file. Reply with quote

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
View user's profile Send private message
Aswin
Beginner


Joined: 12 Jun 2007
Posts: 22
Topics: 6

PostPosted: Mon Jul 09, 2007 10:54 am    Post subject: Reply with quote

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
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12376
Topics: 75
Location: San Jose

PostPosted: Mon Jul 09, 2007 10:58 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12376
Topics: 75
Location: San Jose

PostPosted: Mon Jul 09, 2007 10:59 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
Aswin
Beginner


Joined: 12 Jun 2007
Posts: 22
Topics: 6

PostPosted: Mon Jul 09, 2007 1:49 pm    Post subject: Reply with quote

thanks,

Its working fine. I have used stopaft condition.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL) All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group