Skip to main content
Sep 14, 2017 3:15 PM UTC

Getting Return Code 1792 with CURL 7.52.1 using mainframe z/OS and BPXBATCH

I installed CURL 7.52.1 on our mainframe z/OS 2.1 system and then tried to run a curl command for the first time using batch BPXBATCH. curl --verbose http://www.yahoo.com
It got a message in the STDERR DD but it looks like this. " % < ? / ?? ?_ > "
Thinking it may be ASCII coding instead of EBCDIC I tried using these environment parms which I saw in another post but it still gets the same RC and garbled info in STDERR.
export CEERUNOPTS="FILETAG(AUTOCVT,AUTOTAG) POSIX(ON)"
export BPXKAUTOCVT=ON

Any ideas on what’s wrong here?
Thanks.

    12 replies

    Tatiana Balaburkina
    Rocketeer
    Sep 15, 2017 9:01 AM UTC

    I installed CURL 7.52.1 on our mainframe z/OS 2.1 system and then tried to run a curl command for the first time using batch BPXBATCH. curl --verbose http://www.yahoo.com
    It got a message in the STDERR DD but it looks like this. " % < ? / ?? ?_ > "
    Thinking it may be ASCII coding instead of EBCDIC I tried using these environment parms which I saw in another post but it still gets the same RC and garbled info in STDERR.
    export CEERUNOPTS="FILETAG(AUTOCVT,AUTOTAG) POSIX(ON)"
    export BPXKAUTOCVT=ON

    Any ideas on what’s wrong here?
    Thanks.

    Hi,

    Current version works only in USS. It will be fixed in next release.
    Could you try to use the following syntax:

    curl --verbose http://www.yahoo.com | iconv -f 819 -t 1047

    Sep 15, 2017 11:24 AM UTC

    Hi,

    Current version works only in USS. It will be fixed in next release.
    Could you try to use the following syntax:

    curl --verbose http://www.yahoo.com | iconv -f 819 -t 1047

    Hi Tatyana
    Thank you for looking at this and for the suggestion. I did try the command you sent. It got rid of the return code 1792 (it got RC=0) but still the same garbled message in STDERR. The only thing that gets printed in the STDOUT is system name, date and time.
    z/OS DSYS 01.00 02 2964
    Fri Sep 15 08:31:02 CDT 2017

    If I understand your reply this command won’t work with z/OS BPXBATCH until the next release of CURL. I’ll try again when that release is available.
    Thanks again for your help.
    Jack

    Sep 18, 2017 5:30 PM UTC

    Hi Tatyana
    Thank you for looking at this and for the suggestion. I did try the command you sent. It got rid of the return code 1792 (it got RC=0) but still the same garbled message in STDERR. The only thing that gets printed in the STDOUT is system name, date and time.
    z/OS DSYS 01.00 02 2964
    Fri Sep 15 08:31:02 CDT 2017

    If I understand your reply this command won’t work with z/OS BPXBATCH until the next release of CURL. I’ll try again when that release is available.
    Thanks again for your help.
    Jack

    Can you try running a test with a job that looks something like this?

     //STEP1 EXEC PGM=BPXBATCH
     //STDOUT  DD SYSOUT=*
     //STDERR  DD SYSOUT=*
     //STDPARM DD *
     SH /rsusr/ported/bin/bash -c '
     
     export _BPXK_AUTOCVT=ON ;
     export _CEE_RUNOPTS="FILETAG(AUTOCVT,AUTOTAG) POSIX(ON)" ;
     export _TAG_REDIR_ERR=txt ;
     export _TAG_REDIR_IN=txt ;
     export _TAG_REDIR_OUT=txt ;
     export _BPXK_JOBLOG=STDERR ;
     export _EDC_ADD_ERRNO2=1 ;
     export PATH=/rsusr/ported/bin:/bin ;
     export LIBPATH=/rsusr/ported/lib:/usr/lib ;
     
     curl --verbose http://www.yahoo.com
     
     '
     /*
    

    You will need to change all occurrences of /rsusr/ported to the directory in which you have installed the ported tools.

    Sep 19, 2017 9:27 AM UTC

    I installed CURL 7.52.1 on our mainframe z/OS 2.1 system and then tried to run a curl command for the first time using batch BPXBATCH. curl --verbose http://www.yahoo.com
    It got a message in the STDERR DD but it looks like this. " % < ? / ?? ?_ > "
    Thinking it may be ASCII coding instead of EBCDIC I tried using these environment parms which I saw in another post but it still gets the same RC and garbled info in STDERR.
    export CEERUNOPTS="FILETAG(AUTOCVT,AUTOTAG) POSIX(ON)"
    export BPXKAUTOCVT=ON

    Any ideas on what’s wrong here?
    Thanks.

    Hi jcallen
    Thanks for the JCL. I tried it but got a not found condition.

    /usr/lpp/rocket/bin/bash: FSUM7351 not found
    z/OS DSYS 01.00 02 2964
    Tue Sep 19 08:14:47 CDT 2017

    I don’t see ‘bash’ in my /usr/lpp/rocket/bin directory. Should I change it to my product, curl?
    Jack

    Sep 19, 2017 2:02 PM UTC

    Hi jcallen
    Thanks for the JCL. I tried it but got a not found condition.

    /usr/lpp/rocket/bin/bash: FSUM7351 not found
    z/OS DSYS 01.00 02 2964
    Tue Sep 19 08:14:47 CDT 2017

    I don’t see ‘bash’ in my /usr/lpp/rocket/bin directory. Should I change it to my product, curl?
    Jack

    Do you have the latest bash (4.3) from Rocket installed? If not, you are likely to have problems, as earlier releases of bash didn’t work as well with IBM’s enhanced ASCII support.

    In any case - you need to use the appropriate paths for your installed binaries. The intent here is to use bash as the shell from which curl is then run.

    Sep 19, 2017 4:29 PM UTC

    I installed CURL 7.52.1 on our mainframe z/OS 2.1 system and then tried to run a curl command for the first time using batch BPXBATCH. curl --verbose http://www.yahoo.com
    It got a message in the STDERR DD but it looks like this. " % < ? / ?? ?_ > "
    Thinking it may be ASCII coding instead of EBCDIC I tried using these environment parms which I saw in another post but it still gets the same RC and garbled info in STDERR.
    export CEERUNOPTS="FILETAG(AUTOCVT,AUTOTAG) POSIX(ON)"
    export BPXKAUTOCVT=ON

    Any ideas on what’s wrong here?
    Thanks.

    Hi jcallen
    I did not download Bash in conjuction with installing Curl. Is Bash required or needed to run Curl on the z/OS mainframe?
    Thanks.
    jwbutler

    Sep 21, 2017 3:49 PM UTC

    Hi jcallen
    I did not download Bash in conjuction with installing Curl. Is Bash required or needed to run Curl on the z/OS mainframe?
    Thanks.
    jwbutler

    (My apology for a slow response; I was away on a business trip).

    Bash is not strictly necessary, but you are likely to have fewer problems with it.

    That said - you should be able to run the suggested test job (from above) using /bin/sh instead of bash.

    Sep 25, 2017 11:56 AM UTC

    I installed CURL 7.52.1 on our mainframe z/OS 2.1 system and then tried to run a curl command for the first time using batch BPXBATCH. curl --verbose http://www.yahoo.com
    It got a message in the STDERR DD but it looks like this. " % < ? / ?? ?_ > "
    Thinking it may be ASCII coding instead of EBCDIC I tried using these environment parms which I saw in another post but it still gets the same RC and garbled info in STDERR.
    export CEERUNOPTS="FILETAG(AUTOCVT,AUTOTAG) POSIX(ON)"
    export BPXKAUTOCVT=ON

    Any ideas on what’s wrong here?
    Thanks.

    Hi jcallen
    I tried changing my
    SH /usr/lpp/rocket/bin/bash -c ’ to
    SH /usr/lpp/rocket/bin/bin/sh -c ’

    … and also tried
    SH /usr/lpp/rocket/bin/sh -c ’

    but it keeps getting messages like this;
    /usr/lpp/rocket/bin/sh: FSUM7351 not found
    I don’t think there is an ‘sh’ folder or file. Should I try downloading Bash? Would that help? Or is it something else?
    Thanks.
    jwbutler

    Sep 25, 2017 1:13 PM UTC

    Hi jcallen
    I tried changing my
    SH /usr/lpp/rocket/bin/bash -c ’ to
    SH /usr/lpp/rocket/bin/bin/sh -c ’

    … and also tried
    SH /usr/lpp/rocket/bin/sh -c ’

    but it keeps getting messages like this;
    /usr/lpp/rocket/bin/sh: FSUM7351 not found
    I don’t think there is an ‘sh’ folder or file. Should I try downloading Bash? Would that help? Or is it something else?
    Thanks.
    jwbutler

    Sorry, I wasn’t clear. Here’s the whole script again:

     //STEP1 EXEC PGM=BPXBATCH
     //STDOUT  DD SYSOUT=*
     //STDERR  DD SYSOUT=*
     //STDPARM DD *
     SH /bin/sh -c '
    
     export _BPXK_AUTOCVT=ON ;
     export _CEE_RUNOPTS="FILETAG(AUTOCVT,AUTOTAG) POSIX(ON)" ;
     export _TAG_REDIR_ERR=txt ;
     export _TAG_REDIR_IN=txt ;
     export _TAG_REDIR_OUT=txt ;
     export _BPXK_JOBLOG=STDERR ;
     export _EDC_ADD_ERRNO2=1 ;
     export PATH=/usr/lpp/rocket/bin:/bin ;
     export LIBPATH=/usr/lpp/rocket/lib:/usr/lib ;
    
     curl --verbose http://www.yahoo.com
    
     '
     /*
    Sep 25, 2017 4:39 PM UTC

    I installed CURL 7.52.1 on our mainframe z/OS 2.1 system and then tried to run a curl command for the first time using batch BPXBATCH. curl --verbose http://www.yahoo.com
    It got a message in the STDERR DD but it looks like this. " % < ? / ?? ?_ > "
    Thinking it may be ASCII coding instead of EBCDIC I tried using these environment parms which I saw in another post but it still gets the same RC and garbled info in STDERR.
    export CEERUNOPTS="FILETAG(AUTOCVT,AUTOTAG) POSIX(ON)"
    export BPXKAUTOCVT=ON

    Any ideas on what’s wrong here?
    Thanks.

    jcallen
    Thanks for clarifying that for me. That part works and now it runs for a few minutes but it’s back to getting the return code 1792 and printing garble in the STDERR.
    Also, right after I opened this discussion, Sept. 15th I think, Tatyana mentioned this. "Current version works only in USS. It will be fixed in next release."
    Does this mean that I have to be in USS. Since I’m trying to run Curl from z/OS batch with the BPXBATCH program is originating the CURL commands from z/OS part of the problem I’m having?
    Or could this be a fire wall problem?

    Thanks.
    jwbutler