The following steps show you how to upload a variable length data file whose records are between 100 and 400 bytes long:
- Convert your variable-length PC file to VRECGEN2 input format using the Data File Converter. Specify the minimum and maximum
record lengths as 100 and 400 respectively. Note that because the Data File Converter prepends two bytes containing the record
length, the actual minimum and maximum lengths are 102 and 402 respectively. If the file is in ANSI format, you should also
convert it to EBCDIC format at the same time.
- On the mainframe, allocate a data file to receive the file from the PC. Use the following parameters:
- FORMAT = VB
- RECLEN = 406
- BLKLEN = 410
- Upload the file. Don't set CRLF insertion. If you converted to EBCDIC at step 1, don't specify ANSI.
- Change the source of
vrecgen2.cbl on your mainframe so that the FD for the output file matches the format of the required mainframe data file
- Compile and link
vrecgen2.cbl
- Run VRECGEN2. The JCL is the same as for VRECGEN, except for the following changes:
- The program-name should be VRECGEN2
- The output file definition should be consistent with the output FD in VRECGEN2
- Specify:
- RECFM=FB
- LRECL=404
- BLKSIZE=408
A valid variable length file should result as the output. The following shows the format of a VRECGEN2 format file, using
a record length of 100 bytes as an example:
Bytes
|
Contents
|
1-4
|
Record Descriptor Word.
|
5-6
|
Record length.
|
7-106
|
Record data. The record is padded with null bytes if it is shorter than the maximum record size.
|
Note: The VRECGEN and VRECGEN2 file formats are incompatible in that VRECGEN format is used to download files from the mainframe
and VRECGEN2 format is used to upload Micro Focus format files to the mainframe.