View previous topic :: View next topic
|
Author |
Message |
janmejay Warnings : 1 New User
Joined: 22 Jun 2007 Posts: 85 Location: bangalore
|
|
|
|
I have an input file with record length of 600. In the output file I want , only the coln position 1-2 should be skipped and the remaining fields should be copied.
By using outrec we can do this , but in this case we need to specify every fields that to be come in the output file .
is it possible only the coln posn 1-2 is skipped and remaining should copied to output file by using outrec.
i tried outrec=(1:3,600)
but its showing error 'OUTREC FIELD OUTSIDE RANGE' |
|
Back to top |
|
|
krisprems
Active Member
Joined: 27 Nov 2006 Posts: 649 Location: India
|
|
|
|
Try the below sort card,
Code: |
outrec=(1:3,600,2X) |
i have padded 2 blanks at the end of each record to compensate the record length to be 600 after removing column 1-2.
If you are still facing problems the post your sysout messages |
|
Back to top |
|
|
Prasanthhere
Active User
Joined: 03 Aug 2005 Posts: 306
|
|
|
|
When you are skipping 2 fields the output file will be 598 ie, you are getting an error .
OUTREC FIELDS=(1:3,598) will work fine. If you need the o/p file as 600 itself you have pad the 2 extra spaces |
|
Back to top |
|
|
janmejay Warnings : 1 New User
Joined: 22 Jun 2007 Posts: 85 Location: bangalore
|
|
|
|
OUTREC=(1:3,600,2X) its also showing same error.
OUTREC=(1:3,598) its working fine. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Isn't the syntax (1:pos,length,......)
Which means that there will be an error using 3,600 for a 600 byte records, as there can not be 600 bytes of record left from pos 3 onwards. |
|
Back to top |
|
|
krisprems
Active Member
Joined: 27 Nov 2006 Posts: 649 Location: India
|
|
|
|
yes, expat that's true |
|
Back to top |
|
|
|