Problem:
Resolution:
When using ASCII Variable Length Files it might be easiest to use the Micro Focus MFSORT utility program because it understands the underlying file format. The MFSORT utility can also be used for merging or sorting of EBCDIC files.   
 
There is a sample attached to this Knowledge Base article with two files of equal maximum length but with records of different lengths. 
 
For this sample, MFSORT was ran from a Net Express Command Prompt while positioned in the directory where the two input data files exist, but it could have also been ran from a Mainframe Express Command Prompt because the MFSORT command is supported in both products. 
Since this example uses files with record areas that are numerically sequential, the MFSORT MERGE command was used to not only merge the input files but it also resulted in a sorted output file in ascending order by that record area 
by taking advantage of the FIELDS option. Lastly, SYSOUT was set to send the MFSORT output to a specific text file. 
 
#EnterpriseDeveloper
#MFDS

