Previous Topic: AS400LIB Statement—Specify the Name of a LibraryNext Topic: ATTRIBUTE Statement—Specify the MBean Attribute to Query or Set


ASSIGN Statement—Assign a Logical File Name to a Physical File

The ASSIGN statement enables you to assign a logical file name to a physical file. Additionally, you can specify the characteristics of the physical file. The ASSIGN statement eliminates the requirement to hard-code file names in the program.

Supported Job Types

This statement is optional for the HP Integrity NonStop job type.

Syntax

This statement has the following format:

ASSIGN "logical-file-name;file-name
       [;file-attribute=value;file-attribute=value...]"
logical-file-name

Specifies the logical file name that is assigned to a physical file.

Limits: Maximum of 31 characters. Can contain alphanumeric characters, hypens ( - ), and circumflexes ( ^ ).

file-name

Specifies the name of the physical file.

Limits: The physical file name must have three qualifiers separated by periods. Each qualifier cannot be longer than eight characters.

file-attribute=value

Specifies an attribute of the physical file. The attributes are as follows:

PEXT

Specifies the size of the primary file extent that is allocated to the file.

Limits: An integer in the range from 1 through 65535

Example: PEXT=1024

SEXT

Specifies the size of the secondary file extent that is allocated to the file.

Limits: An integer in the range from 1 through 65535

Example: SEXT=512

EXL

Specifies the exclusion mode for the logical-unit, which determines the circumstances under which other processes can access the file.

Limits: Value can be EXCLUSIVE, SHARED, or PROTECTED

Example: EXL=EXCLUSIVE

ACC

Specifies the access mode for the logical-file-name, which specifies the file operations that can be performed.

Limits: Value can be I-O, INPUT, or OUTPUT

Example: ACC=I-O

CODE

Specifies the file code to assign to the logical-file-name.

Limits: Maximum is 22222

Example: CODE=101

REC

Specifies the record size.

Limits: An integer in the range from 1 through 65535

Example: REC=300

BLOCK

Specifies the size of data blocks that the logical unit uses.

Limits: Any integer in the range from 1 through 65535.

Example: BLOCK=4096

Notes:

Example: ASSIGN Statement

In this example, the ASSIGN statement assigns logical name $VOL.SUBVOL.FILE1 to physical file $VOL1.SUBVOL1.FILE2.

AGENT PROAGENT
USER prod.glsys
COMMAND $C35.PROD.OABC
ENVAR STDOUT=$C35.PROD.cafout1
ENVAR STDERR=$c35.PROD.caferr1
ASSIGN "$VOL.SUBVOL.FILE1;$VOL1.SUBVOL1.FILE2"
PARAMETER NAME(ABC) VALUE(100)
DEFINE "MYFIL1;CLASS=MAP;FILE=$DATA2.PROD.FINFOJOB"