ASSIGN (Assign I/O Device) Macro

The macro is used to dynamically assign and unassign tape, disk, and unit-record devices.

The system selects a free or specified unit and assign it to a free or specified programmer logical unit. (Not all functions are defined for all device types; for details, see the ASPL parameter list in the z/VSE System Macros User's Guide.)

When it has made the assignment, the system returns to your program the logical and physical unit numbers of the assigned unit. This information can be used by the RELEASE macro to release a unit dynamically when it is no longer needed.

A skeleton example that shows how tape drives are assigned and unassigned dynamically is also given in the z/VSE System Macros User's Guide.

Format

Read syntax diagramSkip visual syntax diagramnameASSIGN ASPL=name1( r1),SAVE=name2( r2)

Requirements for the caller

AMODE:
24 or 31
RMODE:
24 or ANY
ASC Mode:
Primary

Parameters

ASPL=name1 | (r1)
Specifies the address of the parameter list, in which you indicate the function (assign or unassign) to be performed. Use the mapping DSECT generated by the ASPL macro to interpret the fields in the parameter list.
SAVE=name2 | (r2)
Specifies a 72-byte save area that must be reserved by the problem program.

Return Codes in Register 15

00
Assignment successful.
04
No free LUB entry found.
08
Device not found in PUB table.
0C
cuu has wrong device type.
10
cuu is down.
18
No free tape unit found.
1C
Invalid logical unit for unassign.
20
cuu reserved by space management or by pending mount request.
24
Invalid function code.
28
No GETVIS space available.
2C
Device to be unassigned is not assigned.
30
Device is owned by another partition.
34
Conflicting I/O assignment. Device is not assigned.
38
The specified logical unit number is invalid or not free.
3C
No device with the specified mode was found.
40
No tape unit found which supports the specified mode.