There are a couple of ways of writing a message to the operator and to the system log, but it took me a while to understand the differences. For example what are the circumstances when the following messages are produced (or not produced)?
- BPXM023I (COLIN) A Message
- A Message
- A Message
- +A Message
- @A Message
Note the messages in 2. and 3. were produced by different methods, and I got message 3. before lunch and message 4. after lunch.
I spent most of a day trying to find out why 3. and 4. were different; why 4. had a plus sign at the start of the message.
Background to operator messages
Message description
Message written to the operator or syslog have a description field which control how they are displayed. For example
- 1 System Failure : The message indicates an error that disrupts system operations. To continue, the operator must reIPL the system or restart a major subsystem.
- 2 Immediate Action Required: The message indicates that the operator must perform an action immediately. The message issuer could be in a wait state until the action is performed or the system needs the action as soon as possible to improve performance.
- 3 Eventual Action Required: The message indicates that the operator must perform an action eventually.
- 6 Job Status: The message indicates the status of a job or job step.
- 7 Task-Related: The message is issued by an application or system program. Messages with this descriptor code are deleted when the job step that issued them ends.
Most applications will use description 3, 6, and 7. They will not use 1 (System Failure) or
2 (Immediate Action Required).
Action messages many have an * sign or @ sign displayed before the first character of the message. The * sign indicates that the WTO was issued by an authorized program. The @ sign indicates that the WTO was issued by an unauthorized program.
From the IBM documentation
Message routing
On a busy production system there are many messages produced. Some messages need an action taken, other messages are for information.
You can route where messages get sent to. For example if you want a tape mounted, then only those people involved with tapes are interested in these messages. Messages about security should be routed to security people. Messages which require operator action should be routed to an operator.
You specify where messages get sent to using the ROUTCDE field. These are documented in the documentation for WTO.
You control which console get which messages by the CONSOLxx member of SYS1.PARMLIB concatenation, or use the vary console command.
In the syslog output you get information like
N 4000000 S0W1 22204 10:02:46.19 JOB08909 00000090 @CP Desc 1
The 4000000 is the routing codes. 8000000 is routing code 1, 4000000 is routing code 2 etc.
You can configure which consoles get which messages for example
V 703,CONSOLE,ROUT=ALL
You can use this command to add (AROUT=rtcode) or delete (DROUT=rtcode) routing codes from the console.
Creating messages
Use of __console2().
There is a C runtime function __console2() which allows you to write a message to the console.
- If the userid is has read access to BPX.CONSOLE in the FACILITY class or running as a super user (id(0) ), you get “A Message”
- If the user does not have access to BPX.CONSOLE in the FACILITY class, and is not a super user, you get “BPXM023I (userid) A Message”
Use of Write To Log (WTL)
There is an assembler macro WTL which allows an application to write to the system log. This was not in my SYS1.MACLIB (which has all of the standard z/OS macros), and I could not find it. The documentation says
Note: IBM recommends you use the WTO macro with the MCSFLAG=HRDCPY parameter instead of WTL, because WTO supplies more data than WTL
Use Write To Operator
The assembler macro
wto 'A Message'
Gives
+A message
The assembler services documentation has
If the user supplies a descriptor code in the WTO macro, an indicator is inserted at the start of the message. The indicators are: a blank, an at sign (@), an asterisk (*), or a blank followed by a plus sign (+). The indicator inserted in the message depends on the descriptor code that the user supplies and whether the user is a privileged or APF-authorized program or a non-authorized problem program. Table 1 shows the indicator that is used for each descriptor code.
With the assembler code
wto 'CP Desc 1',DESC=1 wto 'CP Desc 2',DESC=2 wto 'CP Desc 3',DESC=3 wto 'CP Desc 11',DESC=11 wto 'CP Desc 12',DESC=12
You get messages of different colours, and the messages may or may not be displayed!
Operator console
The operator screen is where messages are sent which require the operator to do something. These days automation processes many of the messages, so there should only be a few messages appearing on the operator console. Some of these messages can roll off the top of the screen.
APF authorised program

Not APF authorised program

From this
- the APF authorised library includes messages with Descr 1 and 2. It uses “*” and ” ” as data prefix.
- the non APF authorised library used prefix ” +” and “@”. It does not display messages with description 1 or 2, as an application should not be issuing messages of type “System Failure” or “Immediate Action Required”!
SYSLOG (from SDSF)
APF authorised

Not APF authorised

All messages are displayed. From the message prefix you can tell if the message came from an APF library or not.
Job log
APF authorised

Not APF authorised

The same information is displayed, allowing for the difference in the APF library.
Why did the + change over lunch?
The reason why it was different after lunch, was I had dynamically APF authorised my load library. I had re-ipled over lunch, so the load library was no longer authorised, and so it puts the “+” on the front – it is obvious now you know.
Make a decision on what you want
If you are going to use __console2 or WTO to write to the operator or syslog. You need do decide
- If you want the operator to see it; for example some messages appear on the operator console, some do not appear there.
- If the operator needs to take action messages prefixed with “*” or “@”
- Which console to send the message to – just to hard copy, to the operator, or to the tape library