assign

Date:

10-20-2011

NAME

ASSIGN, ASNUNIT, ASNFILE, ASNRM - Provides library interface to assign processing

SYNOPSIS

CALL ASSIGN(cmd, ier)

CALL ASNUNIT(iunit, astring, ier)

CALL ASNFILE(fname, astring, ier)

CALL ASNRM(ier)

DESCRIPTION

ASSIGN provides an interface to assign(1) processing from Fortran.

ASNUNIT and ASNFILE assign attributes to units and files, respectively. As with the assign(1) command, these attributes are examined only during OPEN processing. Setting or changing these attributes does not have an effect on Fortran units or files that are already open.

ASNRM removes all entries currently in the assign environment.

All arguments must be of default kind unless documented otherwise. The default kind is KIND=4 for integer, real, complex, and logical arguments.

These routines support the following arguments:

cmd

A Fortran character variable containing a complete assign(1) command in the format also acceptable to ishell(3f). The -V option cannot be processed by the ASSIGN routine.

ier

A KIND=4 integer variable that is assigned the exit status on return. 0 indicates a normal return; >0 indicates a specific error status.

iunit

A KIND=4 integer variable or constant containing the unit number to which attributes are assigned.

astring

A Fortran character variable containing any attribute options and option values that could be passed to assign(1). Control options -I, -O, and -R can also be passed.

fname

A character variable or constant containing the file name to which attributes are assigned.

Users are encouraged to use the ASSIGN library routines rather than a shell command for the assign command.

EXAMPLES

Example 1:

The following is equivalent to assign -s unblocked f:file

INTEGER(KIND=4) IER
CALL ASSIGN('assign -s unblocked f:file' ,ier)

Example 2:

The following has the same effect as assign -I -n 2 u:99

INTEGER(KIND=4) IUN, IER
IUN = 99
CALL ASNUNIT(IUN,'-I -n 2',IER)

SEE ALSO

asnctl(3f), asnqfile(3f), asnqunit(3f)

assign(1)