Products Resources Support About Us

Opening an MVS file with Python


#1

I’m attempting to open an MVS file with Python.

I can do a:

cat “//‘XXX.YYY’”

and display the file just fine.

However, I’m having trouble opening the file with Python.
Pretty sure it has something to with needing to ESCAPE some of the characters in the file name

Any ideas?

Thanks,


#2

Hi Kent,

Not sure which version (2.7 or 3.6) of Python you are using. But, It worked fine for me in 2.7…having the same issue in 3.6…Let us know if you get any solution to this problem.

Below is the code used in .py file
f2=open(’//DD:DDIN’,‘r’) /*DDIN - //DDIN DD DISP=SHR,DSN=AAAAAA.BBBB.CCCCC(DDDDD) in JCL */


#3

Hi Kent,

You might want to read followed topics also:


Thanks,
Alexander