1. I have a variable length file. I want to know if there is a Sort Utility which would eliminate the first and the last record (the ones marked blue in the file layout). I dont know the number of records in the file.
2. I want to know if there is a way I can convert the Variable length record to a fixed length record.
My requirements are such that from the variable file, I want only a part of the variable data and I dont need the fixed data. I tried using the OUTREC option for variable fields and also tried using the CONVERT option, both of which failed.
Say the file is 32756 bytes and I have fixed data to 200 bytes. I want only the variable data and from the 201st byte (want only the part which is marked in Red).
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
There are a lot of examples in the forum showing how this can be done, so,
a) Have you searched the forum looking at some examples.
b) Have you read your sort documentation.
c) If you have tried for yourself - please post your code and error messages.
Joined: 18 Jul 2007 Posts: 2146 Location: At my coffee table
sriramd wrote:
1. I have a variable length file. I want to know if there is a Sort Utility which would eliminate the first and the last record (the ones marked blue in the file layout). I dont know the number of records in the file.
yes, INCLUDE/OMIT if you can uniqicly identify the records that you want to skip....
Quote:
2. I want to know if there is a way I can convert the Variable length record to a fixed length record.
yes....
Quote:
My requirements are such that from the variable file, I want only a part of the variable data and I dont need the fixed data. I tried using the OUTREC option for variable fields and also tried using the CONVERT option, both of which failed.
Fixed data in a variable file? What is the recfm and lrecl of the input?