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

    Feb 7, 2018 4:23 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.

    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

    Feb 7, 2018 9:49 AM UTC

    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

    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 $?" ;
     '
    /*