Problem solve Get help with specific problems with your technologies, process and projects.

Resolving issues with batch FTP

Expert Mark Zelden shares how to ensure batch ftp defaults are the same in test and production environments.

I do an FTP get against a production server. When I do it on our test box it creates a file of fixed block format...

with an LRECL of 128 bytes. When I run the exact same FTP against the same server on our production mainframe it creates a variable blocked file of 256 bytes. Very odd. Different data pools? Different defaults? What do I do to make the file produced in production be FB/128?

It sounds like the defaults are different on the "test box" (is this a different LPAR than the production mainframe you mention?) and the production mainframe. There are defaults that come with the system and they are customizable by the system programmer. There is a somewhat complicated search order for where these defaults can be specified or overridden by the user (see the manuals I quote below for details), but they are in a file called FTP.DATA or FTPSDATA. The default LRECL is 128 and the default RECFM is VB if the system programmer does not change any of the defaults. The file also controls things like the default space allocation size and type (trk vs.cyl) and whether the default FTP environment is z/OS MVS or z/OS Unix.

The best way to ensure you always get the file format you want is to use the SITE or LOCSITE commands prior to issuing a GET or PUT in your FTP process. If you are doing a GET from the mainframe you would use LOCSITE prior to the GET. If you were doing a PUT from another platform to the mainframe, you would use the SITE command - which you need to send via "QUOTE SITE".

Here is an example of doing a GET from an FTP batch job on the mainframe (assume the server is at

locsite LRECL=80 BLKSIZE=27920 RECFM=FB
get /dir1/dir2/mydata.bin 'USERID.MY.DATA'

Next Steps

For more information on using FTP on z/OS see the IP User's Guide and Commands

For more information on customizing FTP on z/OS see the IP Configuration Reference

Read the full IP Configuration Guide

Dig Deeper on IBM system z and mainframe systems

Join the conversation

1 comment

Send me notifications when other members comment.

Please create a username to comment.

Hello , I have a problem beetween a z/os v2.1 mainframe with a zpdt with z/os 2.1 using the ftp. I was trying to transfer a obj member from zpdt to mainframe, I got the messages :
EZA1701I >>> PASV
 227 Entering Passive Mode (10,1,1,194,55,82)
 EZA1701I >>> STOR CBBD1K72
 125 Transferring load module
 551 Reload of the load library failed
 EZA1735I Std Return Code = 27551, Error Code = 00002
 EZA1701I >>> QUIT
 221 Quit command received. Goodbye.

I put binary in the zpdt jcl , the obj goes to pds to pds etc, 
I will like to know if anyone has idea that how to resolve this issue.