1. Home
  2. Troubleshooting
  3. How to set RECFM and LRECL on SFTP Server

How to set RECFM and LRECL on SFTP Server

When transferring files to an IBM OS, you often need to explicitly set the record format and/or logical record length of the uploaded data. These are options not typically encountered on Windows or Linux OS, but are very important for the IBM OS.

If the SFTP server running on the IBM OS is using “Dovetail” (ref: pdf, html)), then there is a specially formatted directory listing (LS) command that can be issued that will set MVS properties such as Record Format (RECFM) and Logical Record Length (LRECL). The special command requires the directory listing end with “/+” followed by the desired settings.

Diplomat MFT supports this feature by supplying the “/+” and desired settings in the “Directory” option of the SFTP transport.

To use, simply append “/+name=value,name=value,name=value” style entries to the end of the SFTP transport’s DIRECTORY field. Anything from the “/+” forward will be issued as an LS after initial connection, and will be removed for all other operations – those commands will be sent at first login, but then will be removed from the path to not affect other operations. 

For example, if your server folder is “//HHCD091”, and you wish to set a logical record length of 80 and a record format of “fb” (fixed block), then use this as your SFTP transport DIRECTORY value:

    //HHCD091/+lrecl=80,recfm=fb
Updated on May 3, 2022

Was this article helpful?

Related Articles