| View previous topic :: View next topic | 
	
	
		| Author | Message | 
	
		| sivafdms Intermediate
 
 
 Joined: 29 May 2007
 Posts: 165
 Topics: 77
 
 
 | 
			
				|  Posted: Sun Mar 27, 2011 9:56 am    Post subject: Add 1 to each record |   |  
				| 
 |  
				| Hi, 
 I have below input file and attibutes are  Lrecl=80 & Recfm=FB
 
 
  	  | Code: |  	  | 00000
 00001
 00002
 ...
 00099
 
 | 
 
 Output file shoud be  in below way i.e add 1 to each record
 
 
 
  	  | Code: |  	  | 00001
 00002
 00003
 ...
 00100
 
 | 
 
 Can someone provide me a sortcard.
 
 Thanks,
 Siva
 |  | 
	
		| Back to top |  | 
	
		|  | 
	
		| kolusu Site Admin
 
  
 
 Joined: 26 Nov 2002
 Posts: 12394
 Topics: 75
 Location: San Jose
 
 | 
			
				|  Posted: Sun Mar 27, 2011 1:17 pm    Post subject: |   |  
				| 
 |  
				| sivafdms, 
 Is this a trick question? Isn't it as simple as this?
 
 
  	  | Code: |  	  | //STEP0100 EXEC PGM=SORT
 //SYSOUT   DD SYSOUT=*
 //SORTIN   DD *
 00000
 00001
 00002
 00099
 //SORTOUT  DD SYSOUT=*
 //SYSIN    DD *
 SORT FIELDS=COPY
 INREC OVERLAY=(1,5,ZD,ADD,+1,M11,LENGTH=5)
 //*
 | 
 _________________
 Kolusu
 www.linkedin.com/in/kolusu
 |  | 
	
		| Back to top |  | 
	
		|  | 
	
		| sivafdms Intermediate
 
 
 Joined: 29 May 2007
 Posts: 165
 Topics: 77
 
 
 | 
			
				|  Posted: Sun Mar 27, 2011 9:16 pm    Post subject: |   |  
				| 
 |  
				| Thx kolusu.i am not fully aware of M11 in sort |  | 
	
		| Back to top |  | 
	
		|  | 
	
		| Anuj Dhawan Intermediate
 
 
 Joined: 19 Jul 2007
 Posts: 298
 Topics: 7
 Location: Mumbai,India
 
 | 
			
				|  Posted: Mon Mar 28, 2011 4:00 am    Post subject: |   |  
				| 
 |  
				| M11 is just an edit mask - idea is to just add +1 to the numbers in posistion 1 to 5. _________________
 Regards,
 Anuj
 |  | 
	
		| Back to top |  | 
	
		|  | 
	
		|  | 
	
		|  |