Products Resources Support About Us

Access a MVS flat file, pds file and vsam file using python in jcl

Can anyone please help me in accessing mainframe flat file using python? I tried running below jcl but it is giving me error.

// SET T1=‘PGM /u/mm/py27/bin/python’
//BPX EXEC PGM=BPXBATSL,PARM=’&T1. /u/mm/apy/ddreader.py’
//*
//DDIN DD DISP=SHR,DSN=TSOID.TEST.JCL(Member)
//*
//STDOUT DD SYSOUT=*
//STDERR DD SYSOUT=*
//STDENV DD *
_PY27=/u/mm/py27
LIBPATH=/u/mm/py27/lib:/lib:/usr/lib:.
PYTHONHOME=/u/mm/py27
PYTHONPATH=/u/mm/py27/lib/python2.7
_BPXK_AUTOCVT=“ON”
_BPX_SHAREAS=MUST
_BPX_BATCH_SPAWN=YES
//*

ddreader.py file:

f2=open(’//DD:DDIN’,‘r’)
print ‘— Reading from //DD:DDIN’
print ‘— ddreader.py terminated’