Janet, I don't know if this applies to your case, but I have always found that when using the ftp client from Windows to z/OS I have to use "quote site" and not just "site" to get the z/OS ftp server to set the DCB parameters (or any other z/OS ftp server variables) successfully. For example:
quote site notrail ispfs quote site sbdataconn=(ibm-1047,iso8859-1) HTH Peter -----Original Message----- From: IBM Mainframe Discussion List [mailto:IBM-MAIN@LISTSERV.UA.EDU] On Behalf Of Janet Graff Sent: Wednesday, June 24, 2015 1:58 PM To: IBM-MAIN@LISTSERV.UA.EDU Subject: Python FTP binary object file upload I am using a cross compiler to produce Object files on Windows. My automation uses OOREXX to upload the files via FTP to z/OS to an object PDS. I am upgrading my automation to be run by RobotFramework using Python and I am having trouble converting the OOREXX to use the Python ftplib storbinary. The file upload properly as binary but I cannot get the blocking to work properly. The first 14 records are blocked correctly but then the following lines are off by 3 bytes. The file being uploaded is the same for the OOREXX and the python so the problem isn’t in the source dataset. My python looks like this (leaving out the error handling and the local file opening) ftp = FTP(ZOS_IPADDR, ZOS_USERID, ZOS_PASSWORD) ftp.sendcmd('SITE RECFM=FB LRECL=80 BLKSIZE=3200') ftp.storbinary('STOR '+member_name, temp_handle, 3200) The Python trace shows this (somewhat sanitized to remove userid and IP address) *cmd* 'PWD'*put* 'PWD\r\n' *get* '257 "\'XXX.\'" is working directory.\r\n' *resp* '257 "\'XXX.\'" is working directory.' *cmd* u"CWD 'XXX.CUNIT.OBJECT'" *put* u"CWD 'XXX.CUNIT.OBJECT'\r\n" *get* '250 The working directory "XXX.CUNIT.OBJECT" is a partitioned data set\r\n' *resp* '250 The working directory "XXX.CUNIT.OBJECT" is a partitioned data set' *cmd* 'SITE RECFM=FB LRECL=80 BLKSIZE=3200' *put* 'SITE RECFM=FB LRECL=80 BLKSIZE=3200\r\n' *get* '200 SITE command was accepted\r\n' *resp* '200 SITE command was accepted' *cmd* 'TYPE I' *put* 'TYPE I\r\n' *get* '200 Representation type is Image\r\n' *resp* '200 Representation type is Image' *cmd* 'PASV' *put* 'PASV\r\n' *get* '227 Entering Passive Mode (192,nn,nn,nn,19,248)\r\n' *resp* '227 Entering Passive Mode (192,nn,nn,nn,19,248)' *cmd* u'STOR HTODECKS' *put* u'STOR HTODECKS\r\n' *get* '125 Storing data set XXX.CUNIT.OBJECT(HTODECKS)\r\n' *resp* '125 Storing data set XXX.CUNIT.OBJECT(HTODECKS)'*get * '250 Transfer completed successfully.\r\n' *resp* '250 Transfer completed successfully.' done storing file HTODECKS *cmd* 'QUIT' *put* 'QUIT\r\n' *get* '221 Quit command received. Goodbye.\r\n' *resp* '221 Quit command received. Goodbye.' Does anyone else have experience with this? I’ve tried it with the blocking on the storbinary as 3200, 80, and default and it doesn’t see to affect the output. The DCB information for the target dataset is correct. Janet ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN This message and any attachments are intended only for the use of the addressee and may contain information that is privileged and confidential. If the reader of the message is not the intended recipient or an authorized representative of the intended recipient, you are hereby notified that any dissemination of this communication is strictly prohibited. If you have received this communication in error, please notify us immediately by e-mail and delete the message and any attachments from your system. ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN