COBOL Manual for TNS and TNS/R Programs
Calling Other Programs and Routines
HP COBOL Manual for TNS and TNS/R Programs—522555-006
23-10
Operating System Routines
If the calling program cannot access RETURN-CODE, the value of RETURN-CODE is 
unchanged.
Operating System Routines
Operating system routines are written in TAL, pTAL, HP C, and HP C++. The language 
in which an operating system routine is written does not matter to the HP COBOL 
program that calls it. Operating system routines execute in system code space, using 
both system data space (for system tables) and user data space (for temporary 
storage). When an HP COBOL program calls an operating system routine, it uses the 
ENTER statement.
Some operating system routines never need to be called by HP COBOL programs—
file system routines, for example. File system routines are called by the HP COBOL 
run-time routines to do their input and output operations. Although it is possible to call 
file system routines explicitly from an HP COBOL program, you are advised not to 
apply both HP COBOL I-O statements and explicit calls to file system routines to the 
same file, as the HP COBOL run-time routines do significant preprocessing and 
postprocessing. 
Examples of operating system routines that are useful to an HP COBOL program are 
ABEND, which signals an abnormal termination, and PURGEDATA, which erases all 
data in a file but does not purge the file itself.
Topics:
•
Parameters
•
Resolution
•
Extensible and Variable Parameter Lists
•
Generations of Operating System Routines
Parameters
Guardian operating system routines are documented in the Guardian Procedure Calls 
Reference Manual. When calling system routines from an HP COBOL program, use 
Table 23-3 to determine the appropriate form for the COBOL parameters.
Note. If you use operating system routines to do nowait I-O (you call a routine to do an input 
or output operation and then call AWAITIO to wait for the operation to finish), be aware that the 
HP COBOL run-time routines perform nowait I-O in some cases. The AWAITIO routine can 
wait for any I-O operation to complete, or wait for the I-O operation on a specific file to 
complete. It is best to apply AWAITIO to a specific file. Using the command PARAM WAITED-
IO ON allows you some latitude, however.










