I wanted to run a job/started task which prompts the operator for a password. Of course being a password, you do not want it written to the job log for every one to see.
In assembler you can write a message on the console, and have z/OS post an ECB when the message is replied to.
WTOR 'ROUTECD9 ',reply,40,ecb,ROUTCDE=(9)
wait 1,ECB=ECB
...
ECB DC F'0'
REPLY DS CL40
The documentation for ROUTCDE says
- 9 System Security. The message gives information about security checking, such as a request for a password.
When this ran, the output on the console was as follows The … is where I typed R 6,abcdefg
@06 ROUTECD9
...
R 6 SUPPRESSED
IEE600I REPLY TO 06 IS;SUPPRESSED
With ROUTCDE=(1) the output was
@07 ROUTECD1
R 7,ABCDEFG
IEE600I REPLY TO 07 IS;ABCDEFG
With no ROUTCDE keyword specified the output was
@08 NOROUTECD
R 8 SUPPRESSED
IEE600I REPLY TO 08 IS;SUPPRESSED
The lesson is that you have to specify ROUTCDE=(1) if you want the reply to be displayed. If you omit the ROUTCDE keyword, or specify a value of 9 – the output is supressed.
Can I do this from a C program?
The C run time _console2() function allows you to issue console messages. If you pass and address for modstr, the _console2() function waits until there is an operator stop of modify command issued for the job. If a NULL address is passed in the modstr, then the message is displayed, and control returns immediately. The text of the modify command is visible on the console.
To get suppressed text you would need to issue the WTOR Macro using __ASM(…) in your C program.