I used the following codes but the error message is as follows. I dont know how to fix it. THis is the error. '501 Invalid data set name "Qxxx.Pxxx.xxxxxx.xxxx.xxx.xxxxx". Use MVS Dsname conventions. Can you please help me?
ftp_host = "host"
ftp_user = "username"
ftp_password = "passw"
filename = 'Qxxx.Pxxx.xxxxxx.xxxx.xxx.xxxxxx'
try:
ftp_server = FTP(ftp_host, ftp_user, ftp_password)
print("good")
ftp_server.set_pasv(False)
with open(filename,'wb') as file:
ftp_server.retrbinary(f'RETR {filename}',file.write)
except Exception as e:
print(e)
Review if the filename meets requirements bellow.
The data set name must:
From: https://www.ibm.com/docs/en/zos/2.1.0?topic=5rc-501-invalid-data-set-name-use-mvs-dsname-conventions