In its simplest form, an S procedure is a sequence of ordinary commands that is stored sequentially (i.e. in the order in which the commands are to be executed) in a text file or a library element. Each command must be preceded by a slash. Statements for programs may be inserted at a suitable position between the commands; all program statements must be preceded by two slashes. Data lines (for input from SYSDTA) may also be inserted; these are identified by the absence of a slash in the first column.
An S procedure may additionally contain specific SDF-P commands and special character strings that may be used for specific processing control, to modify commands and to influence the sequence of command execution (i.e. for purposes of procedure programming proper). These are, however, optional. For instance, the following is a complete
S procedure:
/CREATE-FILE #HELLO, SUPPRESS-ERRORS=*FILE-EXIST
/WRITE-TEXT 'Hello, world!'
The procedure can be called repeatedly. This may be done by means of the CALL-PROCEDURE command in which all that has to be specified is the name of the procedure file.