z/OS Tools & Language

Expand all | Collapse all

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

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

    Posted 09-14-2017 15:15

    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.



  • 2.  RE: Getting Return Code 1792 with CURL 7.52.1 using mainframe z/OS and BPXBATCH

    Posted 09-15-2017 09:01

    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



  • 3.  RE: Getting Return Code 1792 with CURL 7.52.1 using mainframe z/OS and BPXBATCH

    Posted 09-15-2017 11:24

    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



  • 4.  RE: Getting Return Code 1792 with CURL 7.52.1 using mainframe z/OS and BPXBATCH

    Posted 09-18-2017 17:30

    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.



  • 5.  RE: Getting Return Code 1792 with CURL 7.52.1 using mainframe z/OS and BPXBATCH

    Posted 09-19-2017 09:27

    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



  • 6.  RE: Getting Return Code 1792 with CURL 7.52.1 using mainframe z/OS and BPXBATCH

    Posted 09-19-2017 14:02

    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.



  • 7.  RE: Getting Return Code 1792 with CURL 7.52.1 using mainframe z/OS and BPXBATCH

    Posted 09-19-2017 16:29

    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



  • 8.  RE: Getting Return Code 1792 with CURL 7.52.1 using mainframe z/OS and BPXBATCH

    Posted 09-21-2017 15:49

    (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.



  • 9.  RE: Getting Return Code 1792 with CURL 7.52.1 using mainframe z/OS and BPXBATCH

    Posted 09-25-2017 11:56

    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



  • 10.  RE: Getting Return Code 1792 with CURL 7.52.1 using mainframe z/OS and BPXBATCH

    Posted 09-25-2017 13:13

    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
    
     '
     /*


  • 11.  RE: Getting Return Code 1792 with CURL 7.52.1 using mainframe z/OS and BPXBATCH

    Posted 09-25-2017 16:39

    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



  • 12.  RE: Getting Return Code 1792 with CURL 7.52.1 using mainframe z/OS and BPXBATCH

    Posted 02-07-2018 04:23

    Hello

    any new ideas about this topic? I have the same problem. I tried

    BPXBATCH SH +
    . /usr/lpp/rocket/u_prof_cont_samp; +
    /usr/lpp/rocket/bin/curl -k https://xx.xxx.xxxx.xx/hello.html

    and get

    Logged on using a terminal on device not a tty
    Welcome to z/OS 2.2 Unix System Services
    .ÇÈ_%…Â?À..çá<<!.ï!ê<à...Â?À…ÇÈ_%…
    …è?È/%…êÁ[ÁÑÎÁÀ…ìÃÁÊÀ… ÎÁÊ/ÅÁ.ëøÁÁÀ…èÑ_Á…èÑ_Á…èÑ_Á…{ÍÊÊÁ>È.

    Regards
    Dirk



  • 13.  RE: Getting Return Code 1792 with CURL 7.52.1 using mainframe z/OS and BPXBATCH

    Posted 02-07-2018 09:49

    Does the following job work?

    //STEP1 EXEC PGM=BPXBATCH
    //STDOUT  DD SYSOUT=*
    //STDERR  DD SYSOUT=*
    //*
    //* Replace the value of TOOLSDIR with the path to curl.
    //*
    //* Make sure every line of the shell input ends with a semicolon,
    //* and DO NOT add any comment lines; they will cause the remaining
    //* commands to be treated as comments.
    //*
    //* The output of curl is redirected to a file. If it is allowed
    //* to go to STDOUT as allocated to SYSOUT, all lines will be
    //* truncated to the LRECL, and since there are often no newlines
    //* in HTML, the output will be truncated.
    //*
    //* The output file will be encoded (and tagged) as ASCII.
    //*
    //STDPARM DD *
    SH /bin/sh -c '
    
     TOOLSDIR=/rsusr/ported ;
     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=${TOOLSDIR}/bin:/bin ;
     export LIBPATH=/${TOOLSDIR}/lib:/usr/lib ;
     set -x ;
     curl --version  ;
     curl --verbose -k https://www.google.com > ~/curltest.txt ;
     echo "Done, with return code $?" ;
     '
    /*