$DSCALL OPT=CREATE

Creates a new data set.

&CONTROL SHRVARS=($DS)
EXEC $DSCALL OPT=CREATE
             DSN=dataset_name
             FORMAT=format
             ORG=dataset_organization
             RLSE={ NO | YES }
             SPACE= { TRK | CYL } , pri, sec [ ,dir ]
           [ BLKSIZE=blocksize ]
           [ DATACLS=class ]
           [ FREE= { UNAL | CLOSE } ]
           [ LRECL= logical_record_length ]
           [ MGMTCLS=class ]
           [ MOUNT= { NO | YES } ]
           [ STORCLS=class ]
           [ VOL=volser [ UNIT=unit ] ]

This call is used to create a new data set on DASD. This call is similar to the $DSCALL OPT=ALLOC call except the data set must not be a temporary or SYSOUT data set. The data set is cataloged and does not remain allocated to your product region on completion of the operation.

Operands:

OPT=CREATE

Specifies that a data set is to be created.

DSN=dataset_name

Specifies the data set name to create.

FORMAT=format

Specifies the format of the created data set. Valid values are: F, FB, FS, FBS, FA, FBA, FSA, FBSA, FM, FBM, FSM, FBSM, V, VB, VS, VBS, VBSA, VM VBM, VSM, VBSM, U, UA, UM.

ORG=dataset_organization

Specifies the data set organization for a new data set. Valid values are: PS, PO, PSU, and POU.

RLSE={ NO | YES }

Specifies whether to have a secondary space release option.

SPACE={ TRK | CYL } , pri, sec [ ,dir ]

Specifies the space allocation in tracks or cylinders. The SPACE type and primary allocation quantity are required. The directory allocation quantity is required if the data set is a PDS.

BLKSIZE=blocksize

Specifies the block size for a new data set. The value must be an integer in the range 1 to 32,760.

DATACLS=class

Specifies the SMS data class option.

FREE={ UNAL | CLOSE }

Specifies whether the data set is to be deallocated by explicit request only (FREE=UNAL) or is to be deallocated when the file is closed (FREE=CLOSE).

LRECL=logical_record_length

Specifies the logical record length for a new data set. The value must be an integer in the range 1 to 32,760.

MGMTCLS=class

Specifies the SMS management class option.

MOUNT={ NO | YES }

Specifies whether a volume mount is allowed. If MOUNT=NO is specified, and an allocation request requires a volume which is offline, the allocation request fails. If MOUNT=YES is specified and an allocation request requires a volume which is offline, a MOUNT request for the volume is issued.

STORCLS=class

Specifies the SMS storage class option.

VOL=volser [ UNIT=unit ]

Specifies the volume serial number and unit name for a new allocation. If the VOL operand is omitted, the operating system determines if the allocation is allowed, and may choose to allocate the data set or any volume which the requesting user is authorized for.

Return Codes:

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

Return Variables:

&$DSDSN

Full data set name with member name omitted, and true name if an alias was entered

&$DSORG

Data set organization; values are PS, PO, PSU, POU, CX, CQ, MQ, GS, X, TQ, and TR

&$DSVOL

First volume

&$DSRECF

Record format; values are F,FB, FS, FBS, FA, FBA, FSA, FBSA, FM, FBM, FSM, FBSM, V, VB, VS, VBS, VBSA, VM, VBM, VSM, VBSM, U, UA, UM

&$DSRECL

Logical record length

&$DSRECA

Actual usable record length. If the record format is variable length, then the value is record length minus 4. In all other cases, the value is the same as record length.

&$DSBLKS

Block size

&$DSSTORCLS

SMS storage class if SMS is active for this data set

&$DSMGMTCLS

SMS management class if SMS is active for this data set

&$DSDATACLS

SMS data class if SMS is active for this data set

&$DSDYNEC

Dynamic allocation error code

&$DSDYNIC

Dynamic allocation information code

Example: OPT=CREATE

EXEC $DSCALL OPT=CREATE DSN=DEV.SAMPLE.PDS.WORK02 +
   SPACE='TRK,10,5,1' ORG=PO FORMAT=FB +
   LRECL=80, BLKSIZE=4000, STAT=NEW