Open-source Languages & Tools for z/OS

 View Only
  • 1.  BPXBATSL ends with 9 with some garbage in STDERR

    Posted 06-18-2019 02:39

    The simplest python program print(‘hello’) fails with 9.

    JCL is:
    //BPX EXEC PGM=BPXBATSL,
    // PARM=‘PGM /C/Rocket/python36/bin/python /a/private_folder/test.py’
    //*
    //STDOUT DD SYSOUT=*
    //STDERR DD SYSOUT=*
    //*
    //STDENV DD *
    PATH=$PATH:$HOME:/C/Rocket/python36/bin
    PYTHON_HOME=/C/Rocket/python36
    PYTHON_PATH=/C/Rocket/python36/lib/python3.6
    LIBPATH=$LIBPATH:$PYTHON_HOME/lib
    LANG=C
    LC_ALL=en_US
    TERM=xterm
    _BPX_SHAREAS=YES
    _BPX_BATCH_SPAWN=YES
    _BPXK_AUTOCVT=“ON”
    //*

    STDERR contains some garbage:
    ?..%…%…`…?>……?../…>?..?.>…?…?…%…>…

    If I change BPXBATSL to BPXBATCH with sh instead of pgm in PARM, then job is successful, but I’m going to use DDNs in the future scripts. Is there any idea why the code fails and how to see normal letters?

    Python 3.6.1



  • 2.  RE: BPXBATSL ends with 9 with some garbage in STDERR

    Posted 11-29-2019 03:27

    Vladamir
    I am facing exactly the same issue. Any solutions you have found so far?

    Thank you
    Nagaraj



  • 3.  RE: BPXBATSL ends with 9 with some garbage in STDERR

    Posted 11-29-2019 03:45

    Nagaraj,
    I saw that only with Python 3.6. With Python 2.7 I see normal error message. Since version 3.6 can’t work with opening data sets using DD cards i.e. f = open(’//DD:INDD’, ‘r’) doesn’t work, I use only Python 2.7 where there is no garbage.



  • 4.  RE: BPXBATSL ends with 9 with some garbage in STDERR

    Posted 11-29-2019 05:41

    Hi Vladimir
    Thank you very much for your quick response. My JCL looks like as below. I am simply trying to print(“Hello World”) in the program hello.py which is /u/sys1156/temp directory. I am getting a RC of 9 with garbage printed in STDERR. I am not reading any instream data in any of the DD cards in my JCL as you can see below. The stdparm and envvars files I used are also shown below. I am still getting a RC of 9. Any ideas?
    //SYS1156B JOB (1TPF0160),‘BPXBATCH’,CLASS=A,MSGCLASS=X,
    // NOTIFY=&SYSUID
    //*
    //STEP01 EXEC PGM=BPXBATSL
    //*
    //STDPARM DD PATH=’/u/sys1156/temp/stdparm’,
    // PATHOPTS=ORDONLY
    //STDERR DD PATH=’/u/sys1156/temp/pgmout’,
    // PATHOPTS=(OWRONLY,OCREAT,OTRUNC),PATHMODE=SIRWXU
    //STDOUT DD SYSOUT=*
    //SYSPRINT DD SYSOUT=*
    //SYSOUT DD SYSOUT=*
    //*
    //STDENV DD PATH=’/u/sys1156/temp/envvars’,
    // PATHOPTS=ORDONLY
    //*---------------------------------------------------------------------
    BROWSE /u/sys1156/temp/envvars

    PY36=/usr/lpp/python/py36/python-2017-04-12-py36/python36
    LIBPATH=/usr/lpp/python/py36/python-2017-04-12-py36/python36
    PYTHON_HOME=/usr/lpp/python/py36/python-2017-04-12-py36/python36
    _BPXK_AUTOCVT=“ON”
    _BPX_SHAREAS=MUST
    _BPX_BATCH_SPAWN=YES
    ******************************** Bottom of Data *****************
    /u/sys1156/temp/stdparm

    pgm /usr/lpp/python/py36/python-2017-04-12-py36/python36/bin/python
    /u/sys1156/temp/hello.py
    ******************************** Bottom of Data *******************



  • 5.  RE: BPXBATSL ends with 9 with some garbage in STDERR

    Posted 11-29-2019 06:53
    1. Try to execute it in omvs to see how it works there
    2. Then try to use EXEC PGM=BPXBATCH,PARM=‘SH program-name’ to see how that way works
    3. Then try to use EXEC PGM=BPXBATCH,PARM=‘PGM program-name’ to see how it works. Here you need to provide your ENV also.

    If all 1 and 2 ways work fine and 3 fails, then obviously problem in your env. Something might be missing. You need to put everything from your .profile to be sure that you’ve got all the needed. Keep in mind that in .profile you can have symbolic variables like $PATH. In EVN data set you need to provide paths as they are.



  • 6.  RE: BPXBATSL ends with 9 with some garbage in STDERR

    Posted 11-29-2019 07:06

    Hi Vladimir
    Thank you very much for your quick response again. The problem was that I was browsing the STDERR file, instead when I viewed/edited it using ISPF 3.17 (Z/OS UNIX Directory List) option, what was being shown as garbage started showing up as readable text.
    The problem in my program was that I did not create the file with appropriate encoding. I followed the below advice given in this forum, but as a response to a different question, after which it all worked:
    <<Advice I followed - begin>>
    I would recommend you to delete existing file, create the file again (touch test1.py), tag it (chtag -tc ISO8859-1 test1.py). After that add a content into the file and run it.
    Thanks,
    Tatyana
    <<Advice I followed -end >>