| View previous topic :: View next topic | 
	
	
		| Author | Message | 
	
		| sanjeevkumarchauhan Beginner
 
 
 Joined: 03 Oct 2005
 Posts: 3
 Topics: 2
 Location: India
 
 | 
			
				|  Posted: Mon Oct 24, 2005 3:47 pm    Post subject: Writing Records into an Output File thru JCL |   |  
				| 
 |  
				| 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 |  | 
	
		|  | 
	
		| kolusu Site Admin
 
  
 
 Joined: 26 Nov 2002
 Posts: 12394
 Topics: 75
 Location: San Jose
 
 | 
			
				|  Posted: Mon Oct 24, 2005 4:26 pm    Post subject: |   |  
				| 
 |  
				| 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 |  | 
	
		|  | 
	
		| sanjeevkumarchauhan Beginner
 
 
 Joined: 03 Oct 2005
 Posts: 3
 Topics: 2
 Location: India
 
 | 
			
				|  Posted: Tue Oct 25, 2005 10:18 am    Post subject: Thanks for the reply |   |  
				| 
 |  
				| Hi Kolusu, 
 I'm really thankful for the information provided on this problem
 
 Thanks & Regards
 SK CHauhan
 _________________
 Thanks
 SK Chauhan
 |  | 
	
		| Back to top |  | 
	
		|  | 
	
		| bablack Beginner
 
 
 Joined: 04 Dec 2002
 Posts: 71
 Topics: 0
 Location: Little Falls, NJ
 
 | 
			
				|  Posted: Tue Oct 25, 2005 1:47 pm    Post subject: |   |  
				| 
 |  
				|  	  | 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 |  | 
	
		|  | 
	
		|  | 
	
		|  |