Determining
Record Length
The previous article
concluded with my explanation of how to use the VMS CONVERT command with
an FDL file to translate a STREAM format file into a VARIABLE format file.
This article begins with the next step: to determine the appropriate record
length.
The RD we plan to
use to load this data file has a record length of 591 characters. (Note:
to see the record length of an RD, use the command SHOW RD <name>
FIELD COLUMN, then look at the last entry. Usually this will be the full
record length.)
At my request, the
customer, who originally asked how to load this large text file, modified
the SIZE quality in the RECORD section of the FDL file to be this length:
+RECORD + BLOCK_SPAN yes + CARRIAGE_CONTROL carriage_return + FORMAT variable + SIZE 591
|
|
When the file was
modified, the customer used that FDL file with the CONVERT command to
translate the data file, then tried to load it into the dataset from System
1032. To reduce the time necessary to test the updated file, I suggested
the use of the MAXIMUM option in the LOAD command, to limit the number
of records to be read in to only the first 10 records.
Unfortunately, there
was still a problem. When the CONVERT command was attempted, the following
error occurred:
Convert-I-RTL, record longer than maximum record length.
|
|
Consulting HELP/MESSAGE,
I found the following explanation:
$ HELP/MESSAGE/FACILITY=CONVERT RTL RTL, record longer than Maximum Record Length Facility: CONV, Convert Utility Explanation: The record from the input file is longer than the maximum record length specified in the output file. This is an exception condition; the record will not be written to the output file. If the /EXIT qualifier is specified, processing will stop. User Action: Specify the /TRUNCATE qualifier.
|
|
This suggested to
me that the SIZE quality we specified in the FDL file was not adequate.
Although 591 bytes is the amount of data to be read into the dataset,
it is not necessarily the length of the record in the input file.
Back
to the beginning
It seemed as though
we had just come back to the beginning with no forward progress. We needed
to examine the record to find out how long it actually is, but we could
not do that, because we could not open the file in the editor. If we could
open the data file, we could inspect a record and check for a LineFeed
character, which marks the end-of-record.
So, we discussed
two approaches: