SYSOUT stuff

The things covered in other notes have been about input and output data sets for programs. But often you also want a sysout, which JES will store on the spool.

At minimum the type of SYSOUT created by your job includes condition codes produced from running of programs, resources allocated to the job, statistics and any significant messages. There are other types of SYSOUTs as well

Different organisations will have different standards regarding how different types of printed output are created. They will also have rules for how long it will remain on the spool.

if your job does not have a SYSOUT data set DD statement that a program requires, it will likely cause issues and cause errors. Some programs might still work and just include an error / warning in the log, while others, especially if their output is meant to be visual might just stop your job from working properly.

sysout parameter

The most common parameter when dealing with SYSOUT is the SYSOUT parameter

SYSOUT

This parameter in its simplest form is used to assign a class to output directed to that DD statement. Classes and their attributes are defined during JES initialization and any deviation from those are shown as overrides of the defaults.
Pasted image 20241210233531.png

The value of this parameter should be a valid JES class, however it can also be an asterisk *

When this happens, the class will be taken from the MSGCLASS JOB Positional parameters

This parameter can also take a few sub parameters to alter how it works. Those parameters are positional so you need a comma to skip them.
Pasted image 20241210233917.png

Writer-name

An external writer may be required to process the sysout that cannot be handled by JES. For example to esnd the data to a specific printer or data set not supported by JES
Pasted image 20241210234020.png

Form-name

If the sysout needs to be printed on a specific type of form, then you can specify a 1-4 character form name to be used. Once created it can only be printed when a printer definition has been configured to process that specific form name and class.
Pasted image 20241210234140.png

INTRDR

This instructs the system to use the sysout as an input job stream.
This can be used when your job creates some customized JCL to submit it to the internal reader (hence the name)
Pasted image 20241210234250.png

Code-name

The code name is used if you need to reference an earlier JES2 /*OUTPUT statement. If the name is not the name of one, the system will assume that it is a form name.

Nullification

you might encounter a situation where you have to code a SYSOUT statement but you need to nullify a sysout data set. You can just assign nothing or (,) to the parameter

If you assign an incorrect class to the sysout there are a few things that might happen

multiple copies

You might encounter a scenario where you need multiple copies of SYSOUT printerd. You can do that with the COPIES parameter

COPIES

If you want to print multiple copies of a SYSOUT, you can specify the number of copies you want to print with this parameter
Pasted image 20241211000435.png

Routing the output somewhere else

DEST

Normally when you create a output with just SYSOUT parameter, it would be sent to the default destination for the input device. This is usually suitable, but you can also redirect it to another destination with this parameter.

it takes few different types of values

  • LOCAL
    • The local node on a local node
  • name
    • This can be any installation specific name defined during JES2 initialization
  • node
    • This is used to specify the node that the output is being sent to. The syntax for specifying this is Nnnnnn. So N1 would be the node number one that was defined during initialization
  • node and remote
    • There are a few ways of specifying this but it boils down to N**R** where the number after the N is the node number and the number after the R is the remote number. Up to six numbers can be combined to create this destination
  • remote
    • This can specify a defined remote destination with R12312 (numbers preceded by R)
  • (node,userid)
    • This format can be used to send output ot a TSO user, or a VM user at a specified node
  • userid
    • This can be used to send output to a specified user
  • U12312
    • this notation (numbers preceded by U) can be used to send the ouput t oa local terminal that has special routing.

You can also achieve the same with a /* statement
Pasted image 20241211001634.png

Pasted image 20241211001642.png
Those JES2 statements are usually placed after the JOB statement so its easy to see them.

The advanced stuff

OUTLIM

OUTLIM

Sometimes you need to curb the enthusiasm of the output and limit how long it can be.
You can use the OUTLIM parameter to limit the maximum amount of records to be produced in the sysout data set before the system limit exit routine is called.
in most cases this will result in the job being terminated with the 722 system code
Pasted image 20241211002643.png

HOLD

HOLD

You can use this parameter to place a hold on sysout.
You might want to do this for a few reasons

  • The output needs to be printed and should be inspected by a real person beforehand
  • The output is very large and you don't want it to take over the printer for a long time when it is needed
  • It needs a special form that might not be always handy
    It has a very simple syntax with the value of YES holding the output and the default of NO not doing that
    Pasted image 20241211002915.png

FREE

FREE

If the output is to be printed the system will normally wait until the job has completed and then attempt to find an available printer.

If you have a job that runs for a very long time, you can use
FREE=CLOSE parameter which will un-allocate the sysout data set when it is closed.
This will let the output to be considered for printing immediately after it is closed, not after the job has finished

Pasted image 20241211004449.png

JES2 OUTPUT statement

This has been mentioned before, but you might see the JES2 output statement. Pasted image 20241211004706.png

This allows you to code the requirements only once and reference them later on.

The OUTPUT JCL statement is recommended over this approach, as it includes more parameters.
Pasted image 20241211004812.png
Note that when referencing the JCL statement the OUTPUT parameter needs to be included.

As well as being able to assign several extra attributes, this statement can be processed in multiple ways. You cna see the sysout being processed twice here
Pasted image 20241211005117.png

You can also merge inline parameters with the ones from the previous statement like this Pasted image 20241211005159.png

You can also make an OUTPUT statement default
Pasted image 20241211005253.png
and then only override what you need from there

When using the OUTPUT statement you can also extend the DEST parameter to include IP addresses
Pasted image 20241211005340.png

You can also include PRTY in the OUTPUT statement, this cannot be done with a usual DD statement!
Pasted image 20241211005440.png

You can also use it to tell the system what to do with the output after the job has finished

Pasted image 20241211005539.png

Some of the other parameters of the OUTPUT statement can be seen below
Pasted image 20241211005609.png