Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
Arun,
This is a VB input file, but you've padded the output records as if it were an FB file. If the input records started out as 38 bytes, the output records will be 80 bytes instead of 38 bytes. Not good!
leo_sangha,
Here's a DFSORT/ICETOOL job that uses the new SELECT FIRST(n) function available with z/OS V1R5 PTF UK90013 (July, 2008) to do what you asked for and preserve the record lengths:
If you don't have the July, 2008 PTF and can't get your System Programmer to install it, you can use this DFSORT/ICETOOL job without SELECT FIRST(n) which will also preserve the record lengths:
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
Arun,
Quote:
I had assumed both input and output files as VB, LRECL=80 and the results were looking just fine.
You are confusing the LRECL of a VB file with the lengths of the records. The LRECL gives the maximum length. The records can be shorter than the maximum length (that's the point of a variable-length record).
The results would only look fine if every input record was 80 bytes long which, though possible, is not usual for VB files. And it's certainly not something you should ever assume about a VB file.
Quote:
Will padding all the records at 81 st position make the VB file look like an FB file of fixed record length?
You question really doesn't make any sense. A VB file has an RDW in positions 1-4 with the length of the record in the first two bytes (in binary) - the data starts in position 5. An FB file does not have an RDW - the data starts in position 1. VB records can have different lengths up to the LRECL. FB records are all the LRECL length. Padding VB records unnecessarily just wastes space - the point of a VB file is to have different length records as needed.
Quote:
How do we verify whether record lengths are preserved for a VB file?
You can display the record length and data before and after. You can use a DFSORT job like the following to display VB records for verification:
When I used this for your output, it showed the record length as 80 for every output record even though my input file had shorter records. The job I showed preserves the record lengths from input to output.
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
Quote:
Will padding all the records at 81 st position make the VB file look like an FB file of fixed record length?
Frank,
I should have put this in a different way. What I meant to ask was, whether padding makes the RDW field of all the records the same value thereby causing wastage of space.