One thing I see wrong with your JCL is the STDENV DD is supposed to be "DD *" input, not "SYSOUT=*" output. STDENV is where you set environment variables (like PATH, etc.). That is where you would put "BPX_SHAREAS=YES" to make the "exec" run in the same address space as the COBOL program. You might need "BPX_SHAREAS=MUST", depends on your environment I think. Check my spelling for that BPX variable in the Fine Manuals, I'm not sure I have typed it accurately.
Do you get any output at all on SYSOUT from the COBOL program? What do you see there? If the z/Unix call runs in a separate OMVS address space, you will get nothing in the SYSOUT's of the COBOL address space. Peter -----Original Message----- From: IBM Mainframe Discussion List [mailto:IBM-MAIN@LISTSERV.UA.EDU] On Behalf Of scott Ford Sent: Saturday, March 17, 2018 3:23 PM To: IBM-MAIN@LISTSERV.UA.EDU Subject: Cobol-Unix EXTERNAL EMAIL I am trying to understand how to issue a unix via a Cobol Program running in Batch ..I found an example IBM supplied... Working-storage section. 01 Start-Filler pic x(41) value '********** Working Storage Begin ********'. 01 exec-path pic x(100). 01 exec-path-ptr pointer. 01 exec-parm1 pic x(100). 01 exec-parm1-ptr pointer. 01 exec-parm2 pic x(100). 01 exec-parm2-ptr pointer. 01 null-ptr pointer value null. Local-storage section. 01 rc pic s9(9) binary. Procedure division. Move Z'tsocmd' to exec-path. Move Z'SEARCH CLASS(USER)' to exec-parm1 Set exec-path-ptr to address of exec-path Set exec-parm1-ptr to address of exec-parm1 Set exec-parm2-ptr to address of exec-parm2 Call 'execl' using by value exec-path-ptr by value exec-parm1-ptr by value null-ptr returning rc if rc = 0 then display 'tsocmd worked' end-if Goback. My problem is how to i route the output back the caller ? I thought if I used STDOUT it would , but apparently not. //ETESTR4 JOB SYSTEMS,MSGLEVEL=(1,1),MSGCLASS=X,CLASS=A,PRTY=8, // NOTIFY=&SYSUID,REGION=4096K //STEP1 EXEC PGM=CBLUNIX,REGION=0K, // PARM='POSIX(ON) ALL31(ON) ENVAR("_CEE_ENVFILE=DD:STDENV")/' //STEPLIB DD DSN=IDF.TESTUNIX.LOADLIB,DISP=SHR //SYSPRINT DD SYSOUT=* //SYSOUT DD SYSOUT=* //STDENV DD SYSOUT=* /* I am unsure how this works, if someone could point me a to a manual I would be 'Happy Happy'.. -- Regards, *IDMWORKS * Scott Ford z/OS Dev. “By elevating a friend or Collegue you elevate yourself, by demeaning a friend or collegue you demean yourself” www.idmworks.com scott.f...@idmworks.com Blog: www.idmworks.com/blog *The information contained in this email message and any attachment may be privileged, confidential, proprietary or otherwise protected from disclosure. If the reader of this message is not the intended recipient, you are hereby notified that any dissemination, distribution, copying or use of this message and any attachment is strictly prohibited. If you have received this message in error, please notify us immediately by replying to the message and permanently delete it from your computer and destroy any printout thereof.* ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN This message and any attachments are intended only for the use of the addressee and may contain information that is privileged and confidential. If the reader of the message is not the intended recipient or an authorized representative of the intended recipient, you are hereby notified that any dissemination of this communication is strictly prohibited. If you have received this communication in error, please notify us immediately by e-mail and delete the message and any attachments from your system. ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN