| View previous topic :: View next topic | 
	
	
		| Author | Message | 
	
		| sivafdms Intermediate
 
 
 Joined: 29 May 2007
 Posts: 165
 Topics: 77
 
 
 | 
			
				|  Posted: Mon Jan 25, 2016 8:58 am    Post subject: Fill spaces with data in particular column using first rec |   |  
				| 
 |  
				| Hi, 
 Can you please let me know if we can output file this below using SORT.
 
 Input file (FB/80)
 
 
  	  | Code: |  	  | 
 1111          Siva        Company1
 Ram         Company1
 Redd         Company1
 
 2222          Jetty       Company2
 Tulasi      Company2
 Venakat     Company2
 
 
 | 
 
 
 Output file (FB/80)
 
 
  	  | Code: |  	  | 
 1111          Siva        Company1
 1111          Ram         Company1
 1111          Redd         Company1
 
 2222          Jetty       Company2
 2222          Tulasi      Company2
 2222          Venakat     Company2
 
 
 | 
 
 Thanks,
 Siva
 |  | 
	
		| Back to top |  | 
	
		|  | 
	
		| William Collins Supermod
 
 
 Joined: 03 Jun 2012
 Posts: 437
 Topics: 0
 
 
 | 
			
				|  Posted: Mon Jan 25, 2016 10:02 am    Post subject: |   |  
				| 
 |  
				| Yes, look at IFTHEN=(WHEN-GROUP), and PUSH the four-digit code to the position you want. RECORDS=3. 
 Have a go. If you can't get to it, tell us whether the blank records you show in your data are actually there or not.
 |  | 
	
		| Back to top |  | 
	
		|  | 
	
		| kolusu Site Admin
 
  
 
 Joined: 26 Nov 2002
 Posts: 12394
 Topics: 75
 Location: San Jose
 
 | 
			
				|  Posted: Mon Jan 25, 2016 10:33 am    Post subject: |   |  
				| 
 |  
				| sivafdms, 
  	  | Code: |  	  | //SYSIN    DD *
 OPTION COPY
 INREC IFTHEN=(WHEN=GROUP,BEGIN=(1,4,CH,NE,C' '),PUSH=(1:1,4))
 //*
 | 
 _________________
 Kolusu
 www.linkedin.com/in/kolusu
 |  | 
	
		| Back to top |  | 
	
		|  | 
	
		|  | 
	
		|  |