TSO/batch command - Hercules command interface The sends a command to the Hercules console and retrieves the response, which can be shown on the console, listed in TSO as OUTTRAPable or as batch sysout. The program operates in 3 modes, console, TSO or batch. Console mode is selected when the job step program is not IKJ-something and the parm field is not SYSIN. The command is in the parm field, the response is written to the operator console using WTO. Maximum command length is 160, opsys permitting. TSO mode is selected when the job step program is IKJ-something and the parm field is not SYSIN. The command is in the parm field, maximum command length is 160. The response is written to the TSO session using PUTLINEs, making it OUTTRAPable in a REXX pgm. Batch mode is selected when the parm field is SYSIN. Commands are read from the HRCCMD libref, one line per command. File defs are FB/80. Responses are written to the HRCLST libref with filedefs FB/140. Commands are echoed to the output, input lines starting with an asterix (*) are comments and are ignored, as are blank lines. In all cases the maximum total size of the response buffer is 4096, which still allows for rather a lot of lines. Batch sample: //HRCB EXEC PGM=HERCCMD,PARM='SYSIN' //HERCLST DD SYSOUT=* //HERCCMD DD * * Program version cmdver * List all dasd devices devlist dasd Console sample: //HRCC EXEC PGM=HERCCMD,PARM='devlist dasd' TSO sample (well, REXX actually): zz=outtrap('lst.') Address TSO "HERCCMD devlist dasd" zz=outtrap('off') do n=1 to lst.0 say '->' lst.n end Return codes 0 All ok 1 List truncation occurred >1 Something bad happened, a message will explain what. Notes - In the console or TSO mode you can use the CMDVER command to return the program version. The version is automatically written in batch mode. - The respose buffer is set to 4096 bytes, so long responses like a large DEVLIST might be truncated.