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