COMO

COMO

Top  Previous  Next

 

The COMO command controls recording of terminal output in a como (command output) file.

 

 

Format

 

COMO ON {filename} id {APPENDING}Commence recording of terminal output in named record.

 

COMO SUSPENDTemporarily suspends logging output in the como file.

 

COMO RESUMEResumes logging out output after a previous use of the SUSPEND option.

 

COMO OFFTerminate recording of terminal output.

 

COMOReport current logging status.

 

 

When enabled, all output that is directed to the user's terminal by the process in which the COMO command is executed is also written to the named record in the como file.

 

The COMO command is mainly intended as a diagnostic aid during application development but can be used as a general logging mechanism. It can be used, for example, to look back at an error message that was overwritten on the screen before the user had time to read it.

 

Como records are normally stored in a file named $COMO. This is created automatically when the COMO ON command is first used. The default pathname of $COMO under the account directory can be changed by creating the file in an alternative place. The file used for storing como data must be a directory file. On an ECS mode system, the encoding to be used for the $COMO file can be specified in field 7 of the VOC entry in the same way as for any other directory file. If no encoding is specified, the low order 8 bits of each character will be written.

 

An alternative file can be used by including the filename element of the COMO command. This file must already exist as a directory file on the QM server.

 

If id is not valid as an operating system file name, it will be transformed to a valid name in the same way as any other directory file record id.

 

The APPENDING keyword allows data to be appended to an existing como record. If there is no record with the given id, a new record is created.

 

The COMO SUSPEND command increments a counter that inhibits logging of output data. The corresponding COMO RESUME command decrements the counter. Output is logged only when the counter is zero. The action of these commands cannot take the counter out of the range 0 to 100. By maintaining a counter instead of a simple on/off toggle, it is possible for stacked operations to manipulate the inhibit mechanism correctly.

 

Except when started with the NO.LOG option, a phantom process behaves as though it started with a COMO ON command, logging all output that would have been sent to the terminal if the same commands had been executed by a foreground process. For more details, see the PHANTOM command.

 

 

Example

 

COMO ON LOG

RUN END.OF.YEAR

COMO OFF

SPOOL $COMO END.OF.YEAR

 

The above command sequence turns on command output logging using a record named LOG, runs an end of year processing program, turns off logging and then sends this log file to the default printer (print unit 0).