Created On:  08 October 2010
Problem:
The goal was to move a variable length file from the mainframe to Micro Focus COBOL on Windows and on UNIX/Linux. First, I created a VRECGEN file on the mainframe, then using the program "mfdasmx" from the Micro Focus Mainframe Express package, I copied the VRECGEN file to a Windows PC . Then, I used ftp to copy the VRECGEN file from the mainframe to the UNIX/Linux platform, and used the "dfconv" command within Micro Focus Server Express to process the file and convert it to Micro Focus variable length format. The file created by mfdasmx on the PC was larger than the file created by dfconv on UNIX/Linux.  I was not able to determine which file was correct.  What is the best way of moving and converting variable length files from the mainframe?
Resolution:
If you create a VRECGEN file on the mainframe, each record contains a record length header in the first two bytes followed by the original record data.  This file is then ready to ftp to a Windows PC or to UNIX/Linux.  You then use DFCONV to processes the VRECGEN file and convert it to Micro Focus variable length format.  DFCONV removes the two-byte "record length" header and leaves the rest of the record intact.
If you use Drag & Drop (instead of ftp) to download a VRECGEN file from the mainframe to the Windows PC, this creates another VRECGEN file from the original VRECGEN file, adding another two-byte header onto each record, where each record already has a two-byte header. If you then use DFCONV to convert the file to Micro Focus variable length, each record will contain two extra bytes, and the file will be corrupted.
Instead, if you want to use Drag & Drop to move the file from the mainframe, do not bother to create a VRECGEN file on the mainframe in the first place, instead drag & drop the original mainframe variable length file.
The method of creating a VRECGEN file on the mainframe to prepare for ftp transfer to the PC predates the Drag & Drop method. The Drag & Drop method can now be used to move the file from the mainframe to the PC. DFCONV will then successfully process the file.
If you use Drag & Drop (instead of ftp) to download a VRECGEN file from the mainframe to the Windows PC, this creates another VRECGEN file from the original VRECGEN file, adding another two-byte header onto each record, where each record already has a two-byte header. If you then use DFCONV to convert the file to Micro Focus variable length, each record will contain two extra bytes, and the file will be corrupted.
Instead, if you want to use Drag & Drop to move the file from the mainframe, do not bother to create a VRECGEN file on the mainframe in the first place, instead drag & drop the original mainframe variable length file.
The method of creating a VRECGEN file on the mainframe to prepare for ftp transfer to the PC predates the Drag & Drop method. The Drag & Drop method can now be used to move the file from the mainframe to the PC. DFCONV will then successfully process the file.
Old KB# 31897
#Enterprise
#variablelength
#Mainframe
#MainframeExpressandMFE
#VARIABLE-LENGTH
#MFDS
#COBOL
#EnterpriseDeveloper
#Linux
#ServerExpress
#VRECGEN

