z/OS Tools & Language

Expand all | Collapse all

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

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

    Posted 06-18-2019 14:15

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



  • 2.  RE: How open an in-stream data set like SYSIN in Python 3.6.1?

    Posted 06-19-2019 04:53

    Have you tried with Python 2.7?

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

    :slightly_smiling_face:



  • 3.  RE: How open an in-stream data set like SYSIN in Python 3.6.1?

    Posted 06-19-2019 06:32

    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



  • 4.  RE: How open an in-stream data set like SYSIN in Python 3.6.1?

    Posted 08-15-2019 06:08

    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



  • 5.  RE: How open an in-stream data set like SYSIN in Python 3.6.1?

    Posted 08-15-2019 13:45

    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?



  • 6.  RE: How open an in-stream data set like SYSIN in Python 3.6.1?

    Posted 11-30-2019 22:38

    Hi Vladimir
    IBM’s documentation of BPXBATCH, under the section usage notes says the following:
    A program that is run by BPXBATCH cannot use allocations for any files other than stdin, stdout, or stderr.
    The URL for the documentation I am referring to is https://www.ibm.com/support/knowledgecenter/en/SSLTBW_2.2.0/com.ibm.zos.v2r2.cbcux01/bpxbatr.htm
    Could this be the reason for your error?



  • 7.  RE: How open an in-stream data set like SYSIN in Python 3.6.1?

    Posted 12-02-2019 03:46

    As it was said, Python 2.7 supports this feature, but Python 3.6 doesn’t. Even when you use BPXBATSL.