Authority for new objects in a library

You can specify the authority for new objects in a library.

Every library has a parameter called CRTAUT (create authority). This parameter determines the default public authority for any new object that is created in that library. When you create an object, the AUT parameter on the create command determines the public authority for the object. If the AUT value on the create command is *LIBCRTAUT, which is the default for most commands, the public authority for the object is set to the CRTAUT value for the library.

For example, assume that library CUSTLIB has a CRTAUT value of *USE. Both of the commands below create a data area called DTA1 with public authority *USE:
  • Specifying the AUT parameter:
    CRTDTAARA DTAARA(CUSTLIB/DTA1) +
       TYPE(*CHAR) AUT(*LIBCRTAUT)
  • Allowing the AUT parameter to default. *LIBCRTAUT is the default:
    CRTDTAARA DTAARA(CUSTLIB/DTA1) +
       TYPE(*CHAR)
The default CRTAUT value for a library is *SYSVAL. Any new objects created in the library using AUT(*LIBCRTAUT) have public authority set to the value of the QCRTAUT system value. The QCRTAUT system value is shipped as *CHANGE. For example, assume that the ITEMLIB library has a CRTAUT value of *SYSVAL. This command creates the DTA2 data area with public authority of change:
CRTDTAARA DTAARA(ITEMLIB/DTA2) +
   TYPE(*CHAR) AUT(*LIBCRTAUT)

Assigning authority and ownership to new objects shows more examples of how the system assigns ownership and authority to new objects.

The CRTAUT value for a library can also be set to an authorization list name. Any new object created in the library with AUT(*LIBCRTAUT) is secured by the authorization list. The public authority for the object is set to *AUTL.

The CRTAUT value of the library is not used during a move (MOVOBJ), create duplicate (CRTDUPOBJ), or restore of an object into the library. The public authority of the existing object is used.

If the REPLACE (*YES) parameter is used on the create command, then the authority of the existing object is used instead of the CRTAUT value of the library.