_allot() function


The _allot() function allocates a tape unit to a specified DD name.

Syntax

x = _allot(<ddName>, <unitName>, <retentionPeriod>, <dataSetName>, <action>, <expirationDate>, <maximumVolumes>, <storageClass>, <managementClass>, <dataClass>)

The following table describes the parameters for this function:

Parameter

Description

ddName

The name of the DD that you want to allocate

unitName

The name of the tape unit that you want to allocate

retentionPeriod

(optional) The number of days to retain the allocation

dataSetName

(optional) The name of a data set to include in the allocation

action

Action to take:

  • NOWAIT (the default) tells the function to fail if no unit is available for the allocation.
  • WAIT tells the function to wait until a unit is assigned to the DD.
  • OFFLINE tells the function to consider offline units to be allocated.

expirationDate

(optional) The expiration date for the allocation

maximumVolumes

(optional) The maximum number of volumes for the allocation

storageClass

(optional) The SMS storage class for the allocation

managementClass

(optional) The SMS management class for the allocation

dataClass

(optional) The SMS data class for the allocation

Restriction

You cannot use this function in the XSUTGLOB or XSUT0000 automation control point.

Values returned

The _allot function returns one of the following values:

Value

Description

OK

Allocation was successful

Error message

An error occurred while the function was attempting to complete the allocation.

Information
Example

 The following example dynamically allocates an LP1 tape unit if it is not currently allocated:

/* rexx XCPYINIT */
ddname = 'LP1'    /* Local primary   */
unit   = 'CART' /* Unit of cart    */
retpd  = 90 /* 90 days retention*/                         
hlq = userid()
ran = random()
dsname = hlq'.'ddname'.T'ran
dsname = space(dsname,0)
If _CHECKDD(ddname) <> 1 Then Do /* Is LP1 allocated?*/
  DSNAME = LEFT(DSNAME,44,' ') /* Set a temp dataset*/
  X=_ALLOT(DDNAME,UNIT,RETPD,DSNAME) /* allocate tape unit */
End

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*

BMC AMI Load for Db2 13.1