Under the structured procedure format, an S procedure consists of a procedure head and a procedure body. Within each of these parts, logically associated blocks can be defined. This principle not only results in procedures which are very clear, but it also embodies a practical functional element.
The procedure head always begins with the command /SET-PROCEDURE-OPTIONS, which is used to define the attributes of the procedure. This is followed, where necessary, by a declaration of the procedure parameters.
The procedure body contains the commands, statements and program data. Commands which are logically associated together form a command block, which in turn consists of a part containing the commands, statements and data, and an error-handling part. The command block is enclosed between a /BEGIN-BLOCK and an /END-BLOCK. It is possible to define particular attributes for this block, e.g. different handling of the commands and data. If an error occurs, the assigned /IF-ERROR-BLOCK will automatically be processed. The procedure should be terminated by the /EXIT-PROC command.