The following table shows the LE dynamic file allocation services that are supported by this COBOL system.
Routine | Description | Supported? |
---|---|---|
PUTENV | Dynamically allocate a missing DD | Yes |
SETENV | Dynamically allocate a missing DD | Yes |
CALL “PUTENV” USING BY VALUE ADDRESS OF PUTENV-PARMS RETURNING RC END-CALL
DCL PUTENV ENTRY(POINTER VALUE) OPTIONS(COBOL FETCHABLE) RETURNS(FIXED BIN(31)); RC = PUTENV(ADDR(PUTENV_PARMS));
Where PUTENV-PARMS is a null-delimited character string or structure, and RC is a full word binary variable.
The contents of PUTENV-PARMS generally follows the syntax of the TSO ALLOCATE command parameters, except for the DDNAME. Note that there must be no embedded spaces between the parentheses of the DSN specification. DDname values must be unique within the context of a single job step, such that you cannot reuse the same DDname on multiple calls to PUTENV.
DDNAME1=DSN(MFI01.DYNALLOC.DATASET1) MOD CATALOG
This will allocate a sequential dataset to the DDname "DDNAME1", with default DCB attributes. If the dataset already exists, the existing attributes will be retained.
DDNAME2=DSN(MFI01.DYNALLOC.DATASET2) NEW RECFM(VB) LRECL(133) CATALOG
This will allocate a new sequential dataset to the DDname "DDNAME2", using the specified record format and record length. If the dataset already exists, a non-zero RC value will be returned.
DDNAME3=DSN(MFI01.DYNALLOC.DATASET3) NEW DSORG(PO) RECFM(FB) LRECL(80) CATALOG
This will allocate a new PDS dataset to the DDname "DDNAME3" using the specified DCB values.
DDNAME4=DSN(MFI01.DYNALLOC.DATASET4) SHR
This will allocate an existing dataset to the DDname "DDNAME4". If the dataset does not already exist, a non-zero RC value will be returned.