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 

Writing Records into an Output File thru JCL

 
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
sanjeevkumarchauhan
Beginner


Joined: 03 Oct 2005
Posts: 3
Topics: 2
Location: India

PostPosted: Mon Oct 24, 2005 3:47 pm    Post subject: Writing Records into an Output File thru JCL Reply with quote

Hi,

In one of the recent interviews I attended, I was asked a question, like what is the way (basically any keyword or Parameter in JCL) thru which the number of records to be written to the output file can be controlled. To be more clear, assume I have an input file with N records and I need to dump say M (M<=N) to another output file not thru any application program but thru the JCL only.

Please let me know , whether any such Keyword or Parameter existing doing this sort of Job for us.

Thanks & Regards
SK Chauhan
_________________
Thanks
SK Chauhan
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Mon Oct 24, 2005 4:26 pm    Post subject: Reply with quote

sanjeevkumarchauhan,

There are 2 parameters in sort to control the no: of output records to be written. You can use the STOPAFT=n operand of OPTION or the ENDREC operand of OUTFIL.

ex:
Code:

  OPTION COPY,STOPAFT=n

or
Code:
 
  OPTION COPY
  OUTFIL ENDREC=n 

where n is the desired number of records.


Hope this helps..

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
sanjeevkumarchauhan
Beginner


Joined: 03 Oct 2005
Posts: 3
Topics: 2
Location: India

PostPosted: Tue Oct 25, 2005 10:18 am    Post subject: Thanks for the reply Reply with quote

Hi Kolusu,

I'm really thankful for the information provided on this problem

Thanks & Regards
SK CHauhan
_________________
Thanks
SK Chauhan
Back to top
View user's profile Send private message
bablack
Beginner


Joined: 04 Dec 2002
Posts: 71
Topics: 0
Location: Little Falls, NJ

PostPosted: Tue Oct 25, 2005 1:47 pm    Post subject: Reply with quote

Quote:
like what is the way (basically any keyword or Parameter in JCL) thru which the number of records to be written to the output file can be controlled. To be more clear, assume I have an input file with N records and I need to dump say M (M<=N) to another output file not thru any application program but thru the JCL only.


To answer your exact question, no, there is no JCL parameter which can control the number of records to be written to an output file. If the output is to a disk dataset, you can control the size of the dataset, which indirectly controls the number of records, but the program will ABEND when the file is full.

Kolusu's answer referred to SORT parameters, which are valid only if you are copying records with SORT or one of the utilties which come with your SORT product. But those are parameters to the application, which is SORT in this case, not JCL parameters.

If you were copying records from file to file with the IBM utility IDCAMS, with the REPRO function, the COUNT(nn) parameter will limit the number of records copied. But again this is a parameter to the IDCAMS program, not JCL.
_________________
Bruce A. Black
Senior Software Developer
Innovation Data Processing
Back to top
View user's profile Send private message Send e-mail Visit poster's website
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