Page 1 of 1

SYSOUT sent to 2 destination

PostPosted: Wed Feb 01, 2012 4:05 am
by arshadhrashid
Hi
Can a Jobs's output sysout be sent to 2 different destinations?
For example In a JCL, in Job card if MSGCLASS=J (Sends it to JHS system)
and
//SYSPRINT DD SYSOUT=*
Directs the output to MSGCLSS.

I would like to know if I can send my job's output to my message class and also to a DATASET.

Thansk

Re: SYSOUT sent to 2 destination

PostPosted: Wed Feb 01, 2012 5:31 am
by BillyBoyo
No, because you can't specify DSN= and SYSOUT= on the same DD statement.

You could print your dataset to SYSOUT= in a later step, or pick up the spool file from the SYSOUT and copy it to a dataset in a later step.

Re: SYSOUT sent to 2 destination

PostPosted: Wed Feb 01, 2012 5:45 am
by arshadhrashid
Thanks for your reply.
But I would appraqcite if you give me an example on how to print sysout or pick up spool file in alter step?

Re: SYSOUT sent to 2 destination

PostPosted: Wed Feb 01, 2012 6:41 am
by BillyBoyo
If you have written to a dataset, read the dataset and print the data.

If you want to copy the print output from the spool, what are you using to look at spool datasets? Look at documentation/use google to see how to do that.

Re: SYSOUT sent to 2 destination

PostPosted: Wed Feb 01, 2012 7:22 am
by steve-myers
BillyBoyo wrote:... or pick up the spool file from the SYSOUT and copy it to a dataset in a later step.

Unfortunately Billyboyo is oversimplifying this concept. There is no standard JCL to perform this task.

Nor is it generally possible to route a single output stream to both a dataset and SYSOUT. The usual way to do this is to create a disk dataset, and then "print" the dataset using a copy tool such as IEBGENER or your installation's sort product.

You can use the // OUTPUT JCL statement and the OUTPUT parameter on DD statements that specify SYSOUT=class. This include MSGCLASS output. This is discussed in detail in the JCL reference manual for your release, and I won't attempt to summarized a complex setup, especially since we do not know your site's standards. You can use // OUTPUT and the OUTPUT parameter to route output for a single DD statements to several destinations, with several forms and output classes. Again, I refer you to the JCL reference manual for details.

We can attempt to clarify particular issues, but we cannot provide intelligent tutorials for setups that can be both complex and very site dependent.

Re: SYSOUT sent to 2 destination

PostPosted: Thu Feb 02, 2012 2:47 am
by arshadhrashid
Thanks Steve and Billy,
As per your suggestion I checked the JCL manuial and I could write the following JCL.
The JCL works and my output goes to the given dataset and also to the SystemWare's JHS (Job history System, MSGCLASS=J)
But in JHS I dont have the output of the command that was the result of my SYSIN card.
Any idea? - Thanks

//ARSDBCHK JOB (H00000210,22),'DBA',CLASS=A,MSGCLASS=J
//STEP01 EXEC PGM=IKJEFT01
//STEPLIB DD DSN=HLQ.DB2.V9R1M0.SDSNLOAD,DISP=SHR
// DD DSN=HLQ.DB2.V9R1M0.RUNLIB.LOAD,DISP=SHR
//SYSTSPRT DD DSN=HLQ.KA.DISPDB.OUTPUT,
// DISP=(NEW,CATLG,DELETE),UNIT=SYSDA,
// DCB=(RECFM=FB,LRECL=1024,BLKSIZE=0),
// SPACE=(CYL,(5,5),RLSE)
//SYSPRINT DD SYSOUT=*
//SYSUDUMP DD SYSOUT=*
//SYSTSIN DD *
//OUT1 OUTPUT CLASS=J
//OUT2 OUTPUT CLASS=X
//DD1 DD SYSOUT=*,OUTPUT=(*.OUT1,*.OUT2)
DSN SYSTEM(XDX)
-DISPLAY DATABASE (DB001) LIMIT(*)

Re: SYSOUT sent to 2 destination

PostPosted: Thu Feb 02, 2012 3:39 am
by NicC
Did you look at other 'print' DDnames e.g. SYSPRINT to see if the output is there?

Re: SYSOUT sent to 2 destination

PostPosted: Thu Feb 02, 2012 9:42 pm
by arshadhrashid
The job has created only the following 3 DDs
JESMSGLG,
JESJCL ,
JESYSMSG,

They dont contain the output,

Re: SYSOUT sent to 2 destination

PostPosted: Thu Feb 02, 2012 10:31 pm
by Peter_Mann
I don't believe IKJEFT01 will write output to SYSPRINT, all output returned from SYSTSIN will be returned to SYSTSPRT whick is where you've written to a dataset, that's why Steve and others have given some suggetions to write the output to a dataset then use IEBGENER to copy to the SYSOUT

Re: SYSOUT sent to 2 destination

PostPosted: Fri Feb 03, 2012 1:00 am
by steve-myers
arshadhrashid wrote:The job has created only the following 3 DDs
JESMSGLG,
JESJCL ,
JESYSMSG,

They dont contain the output,
Those datasets are not created by DD statements; they are system datasets created by JESx. The JESMSGLG dataset is usually call the JES2 job log dataset; it contains the messages sent to the operator console for your job. The JESJCL dataset shows your JCL with some error messages. The JESYSMSG dataset shows more error messages as well as the job scheduler status messages from when your job was run.