SETCODE statement

The SETCODE statement assigns a specified authorization code to the output load module or program object. The authorization code is placed in the directory entry for the output load module or program object.

The binder allows any numeric value between 0 and 255. The MVS™ Authorized Program Facility (APF) determines that a module is authorized if the authorization code has a value of 1. The module is unauthorized if the authorization code has any other value. Refer to z/OS MVS Programming: Authorized Assembler Services Guide for additional information on the APF.

The syntax of the SETCODE statement is:

SETCODE          AC(authorizationcode)
authorizationcode
A decimal number from 0 to 255. Specifying AC() results in an authorization code of zero.
Placement: A SETCODE statement can be placed before, between, or after object modules or other control statements. It must precede the NAME statement for the module, if one is present.
Note:
  1. The authorization code assigned by the SETCODE statement overrides the authorization code assigned by the AC parameter in the PARM field of the EXEC statement.
  2. If more than one SETCODE statement is encountered in the bind of a load module or program object, the last valid authorization code assigned is used.
  3. To provide APF authorization of a z/OS® UNIX file you must set the authorization code using SETCODE, but you must also set extended attributes for the file using SETOPT.