| View previous topic :: View next topic | 
	
	
		| Author | Message | 
	
		| nadh Intermediate
 
 
 Joined: 08 Oct 2004
 Posts: 192
 Topics: 89
 
 
 | 
			
				|  Posted: Mon Apr 04, 2005 6:01 am    Post subject: how to strip first 8 characters in vb format file |   |  
				| 
 |  
				| Hi, 
 I want to strip first 8 characters in a VB recfm file.
 I have executed the following code
 
  	  | Code: |  	  | //STEP0100 EXEC PGM=SORT
 //SYSOUT   DD SYSOUT=*
 //SORTIN   DD DSN=DFE.DB20342A.TS02613A.LOAD.APR1,
 //            DISP=SHR
 //SORTOUT  DD DSN=DFE.DB20342A.TS02613A.LOAD.TEMP,DISP=OLD
 //          DISP=(NEW,CATLG,DELETE),
 //            UNIT=SYSDA,
 //            SPACE=(CYL,(1,1),RLSE)
 //SYSIN    DD *
 SORT FIELDS=COPY
 OUTREC FIELDS=(9,145)
 //*
 
 | 
 but it is giving the error. Input file is VB and rec length =156. How should i give outrec fields data. i tried with 13 (vb starts with 5) and 152 also. should the output file also be VB file or i can copy into FB format file.
 
 thanks in adavance.
 
 nadh
 |  | 
	
		| Back to top |  | 
	
		|  | 
	
		| kolusu Site Admin
 
  
 
 Joined: 26 Nov 2002
 Posts: 12394
 Topics: 75
 Location: San Jose
 
 | 
			
				|  Posted: Mon Apr 04, 2005 7:18 am    Post subject: |   |  
				| 
 |  
				| Change your Sysin cards to the following . Since your input file is VB you need to use the parm CONVERT to copy into a FB file. 
 
  	  | Code: |  	  | //SYSIN    DD *
 SORT FIELDS=COPY
 OUTFIL CONVERT,
 OUTREC=(9,145)
 /*
 
 | 
 
 Hope this helps...
 
 Cheers
 
 kolusu
 _________________
 Kolusu
 www.linkedin.com/in/kolusu
 |  | 
	
		| Back to top |  | 
	
		|  | 
	
		| nadh Intermediate
 
 
 Joined: 08 Oct 2004
 Posts: 192
 Topics: 89
 
 
 | 
			
				|  Posted: Mon Apr 04, 2005 9:17 am    Post subject: |   |  
				| 
 |  
				| If i try like that it is giving the below error 
 SORT FIELDS=COPY,
 OUTFILL CONVERT,
 $
 0 INVALID SORT OR MERGE STATEMENT OPERAND
 OUTREC FIELDS=(9,145)
 
 
 pls. help me out.
 
 nadh
 |  | 
	
		| Back to top |  | 
	
		|  | 
	
		| kolusu Site Admin
 
  
 
 Joined: 26 Nov 2002
 Posts: 12394
 Topics: 75
 Location: San Jose
 
 | 
			
				|  Posted: Mon Apr 04, 2005 9:34 am    Post subject: |   |  
				| 
 |  
				| Nadh, 
 Take a closer look at your control cards. You had an extra L in the OUTFIL.
 ie.
 
 
 Remove the extra L and your job will run fine
 
 Hope this helps...
 
 Cheers
 
 Kolusu
 _________________
 Kolusu
 www.linkedin.com/in/kolusu
 |  | 
	
		| Back to top |  | 
	
		|  | 
	
		| nadh Intermediate
 
 
 Joined: 08 Oct 2004
 Posts: 192
 Topics: 89
 
 
 | 
			
				|  Posted: Mon Apr 04, 2005 9:46 am    Post subject: |   |  
				| 
 |  
				| i executed with outfil it is giving the following error. 
 SORT FIELDS=COPY
 OUTFIL CONVERT
 OUTREC FIELDS=(13,145)
 0 RECORD TYPE IS V - DATA STARTS IN POSITION 5
 0 INCONSISTENT *OUTREC  IFTHEN 0 REFORMATTING FIELD FOUND
 3 END OF DFSORT
 
 
 Pls. help me out.
 
 nadh
 |  | 
	
		| Back to top |  | 
	
		|  | 
	
		| kolusu Site Admin
 
  
 
 Joined: 26 Nov 2002
 Posts: 12394
 Topics: 75
 Location: San Jose
 
 | 
			
				|  Posted: Mon Apr 04, 2005 9:58 am    Post subject: |   |  
				| 
 |  
				| nadh, 
 With outfil you only need OUTREC instead of OUTREC FIELDS
 
 i.e
 
  	  | Code: |  	  | //SYSIN    DD *
 SORT FIELDS=COPY
 OUTFIL CONVERT,
 OUTREC=(9,145)
 /*
 
 | 
 
 Why don't you simply copy the control cards from my prior posts? You are missing a Comma after convert and you used OUTREC FIELDS in your latest control cards
 
 Kolusu
 _________________
 Kolusu
 www.linkedin.com/in/kolusu
 |  | 
	
		| Back to top |  | 
	
		|  | 
	
		| nadh Intermediate
 
 
 Joined: 08 Oct 2004
 Posts: 192
 Topics: 89
 
 
 | 
			
				|  Posted: Mon Apr 04, 2005 10:10 am    Post subject: |   |  
				| 
 |  
				| It worked fine Kolusu, 
 Thank you very much
 
 Regards
 Nadh
 |  | 
	
		| Back to top |  | 
	
		|  | 
	
		| Frank Yaeger Sort Forum Moderator
 
  
 
 Joined: 02 Dec 2002
 Posts: 1618
 Topics: 31
 Location: San Jose
 
 | 
			
				|  Posted: Mon Apr 04, 2005 10:14 am    Post subject: |   |  
				| 
 |  
				| nadh, 
 The first 4 bytes in a VB file are the RDW.  So when you say you want to strip the first 8 characters, it's not clear if you want to remove the RDW and the first 4 data bytes after the RDW, or remove the RDW and the first 8 data bytes after the RDW.
 
 If you want go VB to VB and remove the first 4 data bytes after the RDW, you can use:
 
 
  	  | Code: |  	  | OPTION COPY
 OUTREC FIELDS=(1,4,5:9)
 
 | 
 
 If you want to go VB to VB and remove the first 8 data bytes after the RDW, you can use these DFSORT statements:
 
 
  	  | Code: |  	  | OPTION COPY
 OUTREC FIELDS=(1,4,5:13)
 
 | 
 
 If you want to go VB to FB and remove the first 4 data bytes (and the RDW), you can use these DFSORT statements:
 
 
  	  | Code: |  	  | OPTION COPY
 OUTFIL VTOF,OUTREC=(9,148)
 
 | 
 [/code]
 
 If you want to go VB to FB and remove the first 8 data bytes (and the RDW), you can use these DFSORT statements:
 
 
  	  | Code: |  	  | OPTION COPY
 OUTFIL VTOF,OUTREC=(13,144)
 
 | 
 _________________
 Frank Yaeger - DFSORT Development Team (IBM)
 Specialties: JOINKEYS, FINDREP, WHEN=GROUP,  ICETOOL, Symbols, Migration
 DFSORT is on the Web at:
 www.ibm.com/storage/dfsort
 |  | 
	
		| Back to top |  | 
	
		|  | 
	
		| nadh Intermediate
 
 
 Joined: 08 Oct 2004
 Posts: 192
 Topics: 89
 
 
 | 
			
				|  Posted: Mon Apr 04, 2005 10:47 am    Post subject: |   |  
				| 
 |  
				| Thank you. |  | 
	
		| Back to top |  | 
	
		|  | 
	
		|  | 
	
		|  |