Products Resources Support About Us

Rocket Software

How open an in-stream data set like SYSIN in Python 3.6.1?

f2 = open(’//DD:SYSIN’,‘r’) fails with
FileNotFoundError: .Errno 129. EDC5129I No such file or directory.: ‘//DD:SYSIN’

Have you tried with Python 2.7?

Otherwise you might have to wait for an upcoming release as discussed in

:slightly_smiling_face:

Mainframe is not a place where it’s easy try something… So we use what is installed for everybody to use… And it’s Python 3.6.1. And the developed thing is also not just to try - it’s to be used in business…

Could you, please, when the release is coming

Sorry, I am not from Rocket Software but I am a fan of their Python releases on z/OS :slight_smile:

So as I see it: the efforts to read from files referenced via DD names:

  1. need to use Python 2.7 which can be installed side by side with Python 3.6
  2. need to use BPXBATSL because it spawns Python local rather than in a separate jobstep
  3. BPXBATSL does not expand symbolic variables

Here a test job with some comments added at that time:

//BPX      EXEC PGM=BPXBATSL                                 
//SMF      DD DISP=SHR,DSN=MM.SMF,DCB=(RECFM=U)    
//STDPARM  DD *                                              
PGM /u/ada/mm/py27/bin/python                           
   /u/ada/mm/apy/smfreader.py -b dd:SMF                
//STDOUT   DD SYSOUT=*                                       
//STDERR   DD SYSOUT=*                                       
//STDENV   DD PATH='/u/ada/mm/apy/batsl.env',PATHOPTS=ORDONLY
//                                                           
                                                             
//* Batch Unix Program Spawn Local (BPXBATSL)                
//* - allows to pass references to files per DD name         
//*   and this allows to overwrite DCB parameters, e.g.      
//*   to access BDW and RDW with DCB=(RECFM=U)               
//*   which would be skipped when reading a VB blocked file  
//*                                                          
//* Note: - Environment Variables are not expanded in PARM   
//*         and in STDENV, but can use symbolic links (ln cmd
//*       - STDENV needed to set env (profile not used)      
//*       - STDPARM overcomes line limitation, parameters    
//*         may be split over several lines                  
//*         (a parameter in quotes is not supported)         
//*                                                          

See also Unix System Services Command Reference
Appendix D. Running shell scripts or executable files under
MVS environments

Hope that clarifies things,
MM

Could you write more detailed about this:
Environment Variables are not expanded in PARM
//* and in STDENV, but can use symbolic links (ln cmd
//* - STDENV needed to set env (profile not used)

what did you mean is that thing like this: export GIT_SHELL=/C/Rocket/ported/bin/bash doesn’t work?