1

I have gone through the below link for connecting to mainframe and extracting files from a PDS.

Downloading text files with Python and ftplib.FTP from z/os

But, am having few doubts on the line:

sess.sendcmd("site sbd=(IBM-1047,ISO8859-1)")

Could anyone please tell, what it stands for? When we write the sess.sendcmd("site sbd=...."), is this machine specific or is it a generic one?

Martin Prikryl
  • 188,800
  • 56
  • 490
  • 992

1 Answers1

3

Text data on z/OS is (mostly) encoded in an EBCDIC code page, IBM-1047 being one of them. The z/OS FTP server is aware of the fact that text data outside z/OS is (mostly) encoded in some other (non-EBCDIC) code page, such as ISO8859-1. It therefore translates data when transfering in text (ASCII) mode (not binary or image mode). While the server has some default for both the z/OS side code page as well as the "network" side code page, you can change that default with:

SITE SBDATACONN=(file-system-cp,network-cp)

Where file-system-cp is the encoding used on the z/OS side and network-cp is the encoding in which the data is sent over the network, i.e. your non-z/OS encoding.

phunsoft
  • 2,674
  • 1
  • 11
  • 22