$DSCALL OPT=ALLOC

Allocates an existing cataloged data set.

&CONTROL SHRVARS=($DS)

EXEC $DSCALL OPT=ALLOC
             DSN=dataset_name
           [ DD=DD_name ]
           [ DISP= { KEEP | DELETE } [, { KEEP | DELETE } ] ]
           [ MIGRATE= { YES | NO } ]
           [ MOUNT= { NO | YES } ]
           [ STAT= { OLD | MOD | SHR } ]
           [ INFO= { YES | WAIT | NOWAIT | NO } ]

This call is used to allocate an existing cataloged data set to your product region. The data set remains allocated to your product region until it is explicitly deallocated, or your product region terminates.

Operands:

If allocation information is requested (INFO=YES, INFO=WAIT, or INFO=NOWAIT), then the information is returned as described in the Return Variables section below. If allocation information is not requested (INFO=NO) or the SYSZTIOT resource is not available after any retries (INFO=YES or INFO=NOWAIT), then the return variables are undefined.

Return Codes:

$DSRC

$DSFDBK

Meaning

0

0

Data set was allocated; allocation details available in &$DS* variables as described below.

0

non-zero

Data set was allocated; however, allocation details are incomplete.

4

non-zero

Data set was not allocated.

8

non-zero

A Dataset Services Interface error has occurred and the function is incomplete. This is typically an application program specification error. The error is indicated in &SYSMSG with message number DSnnnn.

Note: For more information about &SYSMSG, &$DSRC, and &$DSFDBK, see Return Codes and Feedback Codes.

Return Variables:

Examples: OPT=ALLOC

EXEC $DSCALL OPT=ALLOC DSN=CUSTOMER.DATA STAT=SHR

Notes:

Only cataloged data sets are supported. Unit and volume parameters are not supported by this function.

If the data set has been migrated, the allocation may be delayed if a tape mount is required to recover the migrated data set.

Allocation of a data set uses the Dynamic Allocation (SVC 99) services, which require the SYSZTIOT system resource. An unconditional SVC 99 is used at first. This causes the allocation function to wait if SYSZTIOT is unavailable.

If allocation fails, then &$DSRC is set to 4 and specific information is made available in &$DSFDBK, &$DSDYNEC, &$DSDYNIC, and &SYSMSG.

If the data set is allocated, then &$DSRC is always set to zero. If allocation information was requested (INFO=YES, INFO=WAIT, or INFO=NOWAIT), then a conditional SVC 99 is used to obtain the allocation information which is returned in the &$DS* variables. If the information is available in the return variables, then &$DSFDBK is also set to zero. If INFO=YES or INFO=NOWAIT was specified, then failure of the allocation information request due to SYSZTIOT being unavailable is indicated by the following:

&$DSFDBK = 5
&$DSDYNEC = 0254

More information:

$DSCALL OPT=ALLOCINFO


Copyright © 2009 CA. All rights reserved.