ALTER Statement

<alter statement>

── ALTER ──────────────────────────────────────────────────────────────────►
  ┌◄───────────────────────────────── , ─────────────────────────────────┐
  │ ┌◄──────────── , ────────────┐                                       │
►─┴─┴─┬─<long file title>──────┬─┴─ ( ──<alter attribute statement>── ) ─┴─┤
      └─<long directory title>─┘

<alter attribute list>

  ┌◄────────────────────────── , ────────────────────────────┐
──┴─┬─ ALTERNATEGROUPS ── = ── <alternategroups value> ────┬─┴───────────┤
    ├─ PROPAGATESECURITYTODIRS ──┬─ = ─┬─ DONTPROPAGATE ─┬─┤
    ├─ PROPAGATESECURITYTOFILES ─┘     └─ PROPAGATE ─────┘ │
    ├─ ALIGNFILE ── = ──<file title>───────────────────────┤
    ├─ ALIGNMENT ─────┬─┬──────────────────────────────────┤
    ├─ APL ───────────┤ └─ = ──<Boolean expression>────────┤
    ├─ BANNER ────────┤                                    │
    ├─ LOCKEDFILE ────┤                                    │
    ├─ SECURITYADMIN ─┤                                    │
    ├─ SENSITIVEDATA ─┘                                    │
    ├─ CCSVERSION ── = ──<mnemonic value>──────────────────┤
    ├─ EXTMODE ── = ──<mnemonic value>─────────────────────┤
    ├─ FORMID ────┬─ = ──<string primary>──────────────────┤
    ├─ PAGECOMP ──┤                                        │
    ├─ TRANSFORM ─┘                                        │
    ├─<group expression>───────────────────────────────────┤
    ├─ EXTDELIMITER ─┬─ = ──<mnemonic>─────────────────────┤
    ├─ FILEKIND ─────┤                                     │
    ├─ LABEL ────────┤                                     │
    ├─ PRINTERKIND ──┤                                     │
    ├─ TRAINID ──────┘                                     │
    ├─ NOTE ── = ──<string primary>────────────────────────┤
    ├─ PRODUCT ── = ──<string primary>─────────────────────┤
    ├─ RELEASEID ── = ──<string primary>───────────────────┤
    ├─ SAVEFACTOR ── = ──<integer expression>──────────────┤
    ├─ SECURITYGUARD ── = ─┬─<file title>──────────────────┤
    │                      └─ "" ──────────────────────────┤
    ├─ SECURITYMODE ── = ──<integer expression>────────────┤
    ├─ SECURITYTYPE ── = ──<file mnemonic primary>─────────┤
    ├─ SECURITYUSE ── = ──<file mnemonic primary>──────────┤
    └─ USERINFO ── = ──<integer expression>────────────────┘

<alternategroups value>

──┬─ "" ───────────────────────────────────────────┬───────────────────┤
  ├─ # ──<string primary>──────────────────────────┤
  │     ┌◄──────────────── , ────────────────┐     │
  └─ " ─┴─/9\─<name constant>── : ─┬─ RWX ─┬─┴─ " ─┘
                                   ├─ RW ──┤
                                   ├─ RX ──┤
                                   ├─ WX ──┤
                                   ├─ R ───┤
                                   ├─ W ───┤
                                   ├─ X ───┤
                                   └─ NO ──┘

<group expression>

──┬─ GROUP ─┬─ = ─┬─<name constant>───────────────┬─────────────────────┤
  ├─ OWNER ─┘     ├─ # ──<string primary>─────────┤
  │               └─ "" ──────────────────────────┤
  ├─ GROUPRWX ─┬─ = ─┬─ RWX ──────────────────────┤
  ├─ OTHERRWX ─┤     ├─ RW ───────────────────────┤
  ├─ OWNERRWX ─┘     ├─ RX ───────────────────────┤
  │                  ├─ WX ───────────────────────┤
  │                  ├─ R ────────────────────────┤
  │                  ├─ W ────────────────────────┤
  │                  ├─ X ────────────────────────┤
  │                  ├─ NO ───────────────────────┤
  │                  └─ # ── <string primary> ────┤
  ├─ GROUPR ───────┬─┬────────────────────────────┤
  ├─ GROUPW ───────┤ └─ = ──<Boolean expression>──┘
  ├─ GROUPX ───────┤
  ├─ OTHERR ───────┤
  ├─ OTHERW ───────┤
  ├─ OTHERX ───────┤
  ├─ OWNERR ───────┤
  ├─ OWNERW ───────┤
  ├─ OWNERX ───────┤
  ├─ SETUSERCODE ──┤
  ├─ SETGROUPCODE ─┤
  ├─ USEGUARDFILE ─┤
  └─ GUARDOWNER ───┘

Explanation

The ALTER statement changes the file attributes of a disk file.

When ALTER encounters a file that is currently open with EXCLUSIVE = TRUE, ALTER enters a waiting state. To skip the file, enter <mixnumber> OF. To exit without processing any more files, enter <mixnumber> DS.

The following file attributes are available for the <alter attribute statement>. Refer to the File Attributes Programming Reference Manual for more information about each attribute.

Note: Many security attributes are interrelated; therefore changes to one attribute might affect another attribute.

ALIGNFILE

Specifies the name of a printer backup file which contains an alignment pattern for a particular form. This attribute is used by the Print System when the ALIGNMENT attribute is TRUE.

ALIGNMENT

When set to TRUE, the Print System performs alignment before printing the file.

ALTERNATEGROUPS

Specifies a list of up to nine groups whose members can access the file in the manner defined by the corresponding set of permissions. Any process executing a task with a GROUPCODE or SUPPLEMENTARYGROUPS that matches the GROUP attribute of the file or matches one of the groups specified in the ALTERNATEGROUPS attribute—but is not the owner of the file—is granted the corresponding access permissions.

A process matching to multiple groups receives the union of the permissions granted for the individual matches. If the ALTERNATEGROUPS attribute is not set, then it has no effect on file access.

APL

When set to TRUE, specifies that only a program whose code file also has its APL attribute set to TRUE can access the file. If the APL attribute is set to FALSE, the file can be accessed by a program regardless of the APL attribute value in the program code file.

Note: This file attribute can be modified only if the ALTER statement is executed from the ODT.

BANNER

When set to TRUE, a banner page is printed ahead of the desired file to help identify the printed output.

CCSVERSION

Specifies the rules to be used for processing the character data in the file.

When you specify CCSVERSION, it is modified in the file and the EXTMODE attribute is modified to a value compatible with the CCSVERSION specified.

If you specify both CCSVERSION and EXTMODE, and they are compatible with one another, then both attributes are modified in the file. Incompatible values cause ALTER to fail and an error message results.

For character-oriented files, if modifying the value of CCSVERSION or EXTMODE causes the character size to change, ALTER fails and an error message results.

EXTDELIMITER

Specifies the delimiter characters, if any, for identifying the separation of records in the file. EXTDELIMITER is meaningful primarily for FILECLASS=CHARACTERSTREAM files.

EXTMODE

Specifies the external or physical character encoding of the records in the file.

When you specify EXTMODE, it is modified in the file. The CCSVERSION attribute is unaffected if it is compatible with the EXTMODE specified. Otherwise, CCSVERSION reflects a value of NOTSET (–1) in the file.

If you specify both EXTMODE and CCSVERSION, and they are compatible with one another, then both attributes are modified in the file. Incompatible values cause ALTER to fail and an error message results.

For character-oriented files, if modifying the value of EXTMODE or CCSVERSION causes the character size to change, ALTER fails and an error message results.

FILEKIND

Specifies the internal structure and purpose of the file.

FORMID

When specified, the file can be printed only on a device with a matching identification. This attribute is normally applied to indicate the kind of paper to be used.

GROUP

Specifies a group whose members can access the file in the manner defined by the GROUPRWX attribute. Any process executing a task with a GROUPCODE or SUPPLEMENTARYGROUPS that matches the GROUP attribute of the file—but is not the owner of the file—is granted the access permissions defined by the GROUPRWX attribute. If the GROUP attribute is not set, then group access is not granted to any process attempting to access the file.

GROUPR

When set to TRUE, grants group members read-access to the file.

GROUPW

When set to TRUE, grants group members write-access to the file.

GROUPX

When set to TRUE, grants group members execute-access to the file.

GROUPRWX

Specifies the manner in which members of the group matching the group attribute of the file are permitted to access the physical file. The following table lists the valid mnemonic values for GROUPRWX:

Mnemonic

Meaning

RWX

Read, Write, Execute

RW

Read, Write

RX

Read, Execute

R

Read

WX

Write, Execute

W

Write

X

Execute

NO

None

Family substitution is used if the job or task has an active family specification. Only the primary family name is used. Refer to FAMILY Assignment and Interrogating Complex Task Attributes.

GUARDOWNER

Used with the USEGUARDFILE attribute to cause the guard file to define access permissions for the owner of the file.

Note: The GUARDOWNER attribute has no effect if the USEGUARDFILE attribute is reset.

LABEL

For tape files, controls whether labels are written and affects end-of-file action.

For disk and printer files, controls whether banner pages are printed and affects top-of-page action.

LOCKEDFILE

When set to TRUE, prevents disk files from being removed or replaced, and the file name from being changed. However, the locked file can be opened and updated, and the file attributes can be changed. When set to FALSE, this attribute enables files to be removed and changed.

NOTE

Stores a message of up to 250 characters to be printed on the banner page preceding the printer file, punch file, or disk file. The default value is a null string.

OTHERR

When set to TRUE, grants other users (excluding the owner and members of the groups specified by GROUP and ALTERNATEGROUPS) read-access to the file.

OTHERW

When this file attribute is set to TRUE, then other users (excluding the owner and members of the groups specified by GROUP and ALTERNATEGROUPS) are granted write-access to the file.

OTHERX

When set to TRUE, grants other users (excluding the owner and members of the groups specified by GROUP and ALTERNATEGROUPS) execute-access to the file.

OTHERRWX

Specifies the manner in which all other users (excluding the owner and members of the groups specified by GROUP and ALTERNATEGROUPS) are permitted to access the physical file.

The following table lists the valid mnemonic values for OTHERRWX:

Mnemonic

Meaning

RWX

Read, Write, Execute

RW

Read, Write

RX

Read, Execute

R

Read

WX

Write, Execute

W

Write

X

Execute

NO

None

Family substitution is used if the job or task has an active family specification. Only the primary family name is used. Refer to FAMILY Assignment and Interrogating Complex Task Attributes.

OWNER

Modifies the owner of the file.

Note: This attribute can be set only within a permanent directory namespace.

OWNERR

When set to TRUE, grants the owner read‑access to the file.

OWNERW

When set to TRUE, grants the owner write‑access to the file.

OWNERX

When set to TRUE, grants the owner execute‑access to the file.

OWNERRWX

Specifies the manner in which the owner of the file is permitted to access the physical file. The following table lists the valid mnemonic values for OWNERRWX:

Mnemonic

Meaning

RWX

Read, Write, Execute

RW

Read, Write

RX

Read, Execute

R

Read

WX

Write, Execute

W

Write

X

Execute

NO

None

Family substitution is used if the job or task has an active family specification. Only the primary family name is used. Refer to FAMILY Assignment and Interrogating Complex Task Attributes.

PAGECOMP

Specifies formatting options to be used when printing a file.

PRINTERKIND

Specifies the kind of device the file is to be printed on.

PRODUCT

Stores a message of up to 250 characters to specify or determine that a piece of your software belongs to a product group. This attribute associates a piece of software with a specific application, product, and component as defined within the Unisys tracking and reporting system.

PROPAGATESECURITYTODIRS

When set to PROPAGATE on a permanent directory, causes subdirectories within the permanent directory—for which no security attributes have been explicitly set—to be assigned the same security attributes as the parent directory.

PROPAGATESECURITYTOFILES

When set to PROPAGATE on a permanent directory, causes files within the permanent directory—for which no security attributes have been explicitly set—to be assigned the same security attributes as the parent directory.

RELEASEID

Specifies or determines the release level of the file.

SECURITYADMIN

When set to TRUE, restricts access to the file to only those processes marked with the USERDATA granulated privilege. The USERDATA privilege is automatically given to users and processes marked with SECADMIN privilege, if security administrator status is authorized and to privileged users otherwise. This attribute can be set only by processes marked with the USERDATA privilege.

SAVEFACTOR

Indicates the expiration date of a file in terms of the number of days past the creation date.

SECURITYGUARD

Identifies the guard file to be invoked for the file if the SECURITYTYPE attribute is assigned GUARDED or CONTROLLED. For more information about guard files, refer to the Security Overview and Implementation Guide.

SECURITYMODE

Specifies the manner in which users are permitted to access the physical file, including the owner of the file.

SECURITYTYPE

Provides access control over users, other than the owner of a file, to a physical file. The SECURITYTYPE attribute can have a value of PRIVATE (default), PUBLIC, GUARDED, or CONTROLLED:

  • PRIVATE files can be accessed or overwritten only by their owners and privileged users.

  • PUBLIC files can be accessed by tasks with any usercode, as limited by the setting of the SECURITYUSE attribute.

  • GUARDED files can be accessed by the owner, however, nonprivileged users and programs are granted access as defined by the guard file. The guard file, which defines the access rights to files, must be examined before access to a disk file is granted.

  • CONTROLLED files can be accessed after the guard file is examined and access to your disk file is granted. If you are not defined in the guard file, you do not have access to the file.

SECURITYUSE

Specifies how a physical file that is protected by security can be accessed by nonprivileged users using nonprivileged programs. This attribute can have a value of IO (default), IN, or OUT. When a PUBLIC file is accessed by a task with a usercode that differs from the OWNER, the SECURITYUSE attribute permits the following actions based on its value:

  • A value of IO permits reading, writing, overwriting, and purging.

  • A value of IN permits reading, but not writing, overwriting, or purging.

  • A value of OUT permits writing, overwriting, or purging, but not reading.

SENSITIVEDATA

When set to TRUE, causes the disk or pack areas assigned for a file to be overwritten with an arbitrary pattern before the disk space is returned to the system for reallocation.

SETGROUPCODE

When set to TRUE on a code file or job symbol, the program or job executes with an effective GROUPCODE of the group of the file.

SETUSERCODE

When set to TRUE on a code file or job symbol, the program or job executes with an effective USERCODE of the owner of the file.

TRAINID

Specifies the print train to be used on a train printer.

TRANSFORM

Specifies a transform function, which is used to manipulate the data before printing.

USEGUARDFILE

When set to TRUE, a guard file in addition to the SECURITYMODE attribute controls access to the physical file. For the guard file to control access to the file completely, the file access permission flags OWNERRWX, GROUPRWX, and OTHERRWX must be set to TRUE.

USERINFO

Saves site or application-specific information.

Examples

This ALTER statement prevents a file named FILEX from being removed or replaced, and the file name from being changed.

ALTER FILEX (LOCKEDFILE)

This statement locks the files called MYFILE and AFILE so that the files cannot be replaced or removed, and sets their SECURITYUSE attribute to permit reading only.

ALTER MYFILE, *SOURCE/AFILE (LOCKEDFILE=TRUE, SECURITYUSE=IN)

The first line of this statement locks the file called FILEY and all files in the directory called MYFILE, and changes the SENSITIVEDATA attribute for those files. The second line of this statement sets the expiration date of FILEX to 30 days past its creation, sets the NOTE attribute of FILEX to “Banner Page”, and locks the file.

ALTER FILEY, MYFILE/= (SENSITIVEDATA, LOCKEDFILE),
      FILEX (SAVEFACTOR=30, NOTE="Banner Page", LOCKEDFILE)