Sean,
        The IKJEFT01 / OSHELL combination produces two sysouts because 
ishell allocates STDOUT to a temporary file under /tmp then invokes
BPXBATCH SH to run the desired command.  DD OSHOUT1 is allocated and 
STDOUT copied to it.  This dynamic allocation results in the
separated SYSOUT. 
        I've taken to using the IBM supplied module BPXWUNIX to execute 
shell commands, execs and programs.  I built a tiny
five line Rexx exec to setup and call BPXWUNIX and one of it's options is 
to specify an output DD.  I also use it in Rexx as a procedure
when it's necessary to interface with USS from the MVS side of the house 
because of its small size.  5 lines of code vs  107 for OSHELL.
My Rexx looks like this
/*Rexx   */
Parse Arg uss_cmd 
Call Bpxwunix uss_cmd,, "DD:SYSTSPRT" 
If result<>0 Then Say "Rc(!!"result"!!)" 
Exit result 
 The JCL to invoke it looks like this:
//xxxxxxx JOB ('USSCMD'),MSGCLASS=O,NOTIFY=&SYSUID,REGION=0M 
//TSOBATCH EXEC PGM=IKJEFT1A 
//SYSEXEC DD DSNAME=UNIX.REXX.EXEC,DISP=SHR 
//SYSTSPRT DD SYSOUT=*,LRECL=256,RECFM=V 
//SYSTSIN DD DATA,DLM=## 
usscmd ls -E /u/jim/ 
## 

The net result is all output from the ls command goes to the SYSTSPRT DD.  
 

A word of caution, execution BPXWUNIX does not result in a shell being 
instansiated so there is no inherited path for BPXWUNIX to search.
Therefore you must supply the path to the resource to be executed except 
for internal shell commands.   For example, if you wanted to 
execute the chmount external command, the call might be      usscmd 
/usr/sbin/chmount -R -a /tmp/
with the full path to the directory where chmount lives. 

Doc for BPXWUNIX can be found at 
ftp://ftp.software.ibm.com/s390/zos/tools/rexx/rexxfunc.html 

Jim Holloway  - Metlife 
 
"Smith, Sean M" <[email protected]> wrote on 03/09/2009 
14:37:28 PM:
 ------------------------------
> 
> Date:    Mon, 9 Mar 2009 14:37:28 -0700
> From:    "Smith, Sean M" <[email protected]>
> Subject: Re: one IKJEFT01 job, 2 outputs in sdsf - why?
> 
> I would like to second the question...I understand that the second 
> execution is from the spawned task but is there a way to get the 
> output to come back into the originating execution?
> 
> All that being said, in your example you could use this instead:
> 
> //STEPNAME EXEC PGM=BPXBATCH,PARM='SH ls -la /etc/ | cat' 
> //STDOUT   DD SYSOUT=* 
> //STDERR   DD SYSOUT=* 
> 
> Sean Smith
> 
> -----Original Message-----
> From: IBM Mainframe Discussion List [mailto:[email protected]] On
> Behalf Of Bonno, Tuco
> Sent: Monday, March 09, 2009 12:04 PM
> To: [email protected]
> Subject: one IKJEFT01 job, 2 outputs in sdsf - why?
> 
> cross-posting to ibm-main, mvs-oe
> 
> running z/os 1.9
> 
> 
> 
> when I run this job:
> 
>   //tucopgp1   job    â?¦ msgclass=x â?¦..
> 
> //abc exec pgm=IKJEFT01
> 
> //sysexec dd disp=shr, dsn=sys1.sbpxexec
> 
> //systsprt dd sysout=*
> 
> //systsin dd *
> 
> OSHELL  ls â??la  /etc/  | cat
> 
> 
> 
> the output shows up as TWO entries in sdsf  each w/ the same jobnameand 
jobid:
> 
> (e.g.,)
> 
> tucopgp1    job10694    â?¦..   <tot-rec = 85 >
> 
> tucopgp1    job10694   â?¦..    <tot-rec =90 >
> 
> 
> 
> the 90-line item is the conventional jes2 stuff (log, msg-s, jcl, 
systsprt) ;
> 
> the 85-line item contains the output proper of the omvs â??catâ? 
command.
> 
> 
> 
> what should I add to my jcl to have all the ouput conflated into 
> just one item in sdsf ? 
> 
> thank you.
> 
> 
> 
> 

The information contained in this message may be CONFIDENTIAL and is for the 
intended addressee only.  Any unauthorized use, dissemination of the 
information, or copying of this message is prohibited.  If you are not the 
intended addressee, please notify the sender immediately and delete this 
message.

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html

Reply via email to