todsn dynamic allocation goes to separate sysout

Discussion of Dovetailed Technologies Dataset Pipes tools
Post Reply
tsdjim
Posts: 64
Joined: Fri May 07, 2010 2:21 am

todsn dynamic allocation goes to separate sysout

Post by tsdjim » Tue Jan 29, 2013 10:20 am

I am dynamically allocating a few SYSOUTs to differents DDs, and the sysouts are produced successfully, however they are produced as separate outputs in the JES queue, I want a single output in the Q. Even with the spin or without I get the same result.

My todsn is similar to the following

todsn -x "dd(SYSOUT1) recfm(v,b) lrecl(133) sysout(X)" //SYSOUT1
todsn -x "dd(SYSOUT2) recfm(f,b) lrecl(133) sysout(X)" //SYSOUT2
etc

dovetail
Site Admin
Posts: 1913
Joined: Thu Jul 29, 2004 12:12 pm

Re: todsn dynamic allocation goes to separate sysout

Post by dovetail » Wed Jan 30, 2013 12:53 pm

I'm not sure what can be done, or even what controls the grouping of spun output for a job. We use BPXWDYN for dynamic allocation; if there is a keyword that would cause the kind of grouping that you want I'm not aware of it.

But, I do have a question:
How are you running these commands?
- from within a batch job (say, under COZBATCH)
- from withing a interactive z/OS shell (ssh, telnet)
- remotely?

tsdjim
Posts: 64
Joined: Fri May 07, 2010 2:21 am

Re: todsn dynamic allocation goes to separate sysout

Post by tsdjim » Wed Jan 30, 2013 1:33 pm

I am running the coz: Launcher in z/os, the todsn is part of a bash script within which is the todsn. It reads a file from Linux puts it to the JES spool using the todsn dynamic allocation. The DDNAMEs are passed by another application and hence the requirement for dynamic allocation.

I will do some further research on this.

dovetail
Site Admin
Posts: 1913
Joined: Thu Jul 29, 2004 12:12 pm

Re: todsn dynamic allocation goes to separate sysout

Post by dovetail » Wed Jan 30, 2013 1:57 pm

so, the DD names are not already pre-allocated in the job step?

tsdjim
Posts: 64
Joined: Fri May 07, 2010 2:21 am

Re: todsn dynamic allocation goes to separate sysout

Post by tsdjim » Wed Jan 30, 2013 3:19 pm

No, they are not pre-allocated, because the ddnames are passed from another linux application and are unknown until runtime. So they have to be dynamically allocated as the application passes them.

dovetail
Site Admin
Posts: 1913
Joined: Thu Jul 29, 2004 12:12 pm

Re: todsn dynamic allocation goes to separate sysout

Post by dovetail » Wed Jan 30, 2013 6:08 pm

I reproduced this with:

Code: Select all

//RUNCOZK EXEC PROC=COZPROC, 
//        ARGS='-LD kirk@linux1.dovetail.com' 
//STDIN DD * 
todsn -x 'dd(sysout1) recfm(v,b) lrecl(133) sysout(x)' //sysout1 \ 
       </etc/profile 
todsn -x 'dd(sysout2) recfm(v,b) lrecl(133) sysout(x)' //sysout2 \ 
       </etc/profile 
// 
If I look under SDSF.ST, I only see one job. The '?' prefix command then shows all of the DDs, including SYSOUT1 and SYSOUT2.
But, if I look under SDSF.O, I see two entries for the job - one for DD SYSOUT1 and one for DD SYSOUT2.
The difference is that SDSF.ST shows "jobs", whereas SDSF.O shows "output groups" (aka "JOE"s) (see the help panel).
I assume that this is what you are asking about.

I discussed this with IBM, and what I learned is that each SYSOUT dataset will appear in its own "output group" (JOE) if it is spun (deallocated) before the end of the job.
The *only* way to avoid this is to not free (unallocate) the sysout dataset, and allow it to go though deallocation at the end of the job step.
There is really no option to do this however with todsn, and I'm not inclined to add an enhancement that would skip freeing the output dataset for such an esoteric requirement.

As a workaround, you could dynamically allocate the DD yourself. One way to do this is to use cozclient to run a z/OS Unix REXX script and call BPXWDYN directly, like this:

Code: Select all

//RUNCOZK EXEC PROC=COZPROC, 
//        ARGS='-LD kirk@linux1.dovetail.com' 
//STDIN DD * 
cozclient /path/to/bpxwdyn.rexx \ 
   "alloc dd(sysout1) recfm(v,b) lrecl(133) sysout(x)" 
                                                                
todsn //DD:SYSOUT1 < /etc/profile 
                                                                
cozclient /path/to/bpxwdyn.rexx \ 
   "alloc dd(sysout2) recfm(v,b) lrecl(133) sysout(x)" 
                                                                
todsn //DD:SYSOUT2 < /etc/profile 
                                                                
// 
If you do this, the two DDs will not be dynamically freed, and will instead go through normal deallocation at the end of the job step. I tried this, and they now show up in one JOE.

Here's the z/OS UNIX REXX script (an executable file in /path/to/bpxwunix.rexx ):

Code: Select all

/* REXX */
/* Command to invoke BPXWDYN with arguments given from the command line */

/* example:  bpxwdyn.rexx "alloc dd(foo) da(hlq.bar) shr msg(2)"   */
parse arg args 
urc = BPXWDYN( args )
exit urc
Hope that helps.

tsdjim
Posts: 64
Joined: Fri May 07, 2010 2:21 am

Re: todsn dynamic allocation goes to separate sysout

Post by tsdjim » Thu Jan 31, 2013 5:14 am

Thanks a lot, that worked.

dovetail
Site Admin
Posts: 1913
Joined: Thu Jul 29, 2004 12:12 pm

Re: todsn dynamic allocation goes to separate sysout

Post by dovetail » Thu Jan 31, 2013 10:48 am

one other suggestion - you might want to add msg(2) to your bpxwdyn keywords so that you see IKJ error messages printed to stderr

Post Reply