DD & DLBL

Top  Previous  Next

Both DD & DLBL define the file association between the program internal file name and the external one. In the XFRAME Batch Environment, the are replaced by the dlbl_ environment variables.

Through these environments you can associate the data file-names used in your program with the cluster name - in case of VSAM files - or physical names - in case of standard UNIX files -. Just remember to code the clause EXTERNAL in your ASSIGN TO statements.

The association between cluster name and physical file name whenever necessary will be provided by the xrun interface.

As described above, the physical name of a file is specified using an environment variable, therefore all corresponding environment variables for the referenced files must be exported / set before the program is executed.

The environment variable referring to a file link must be named:

dlbl_<FILENAME>

where FILENAME is the internal name of the file, and its value must contain the following infomation:

cluster name
file type
catalog name (optional)
dispositions (optional)
gdg (optional)
fcc (optional)

according to this syntax:

"<cluster>[,cat=<catalog>],type=(flat|vsam)[,disp=<dispositions>][,gdg=<version>]

where:

<cluster>

specifies the physical name of the file.

<catalog>

is the catalog name of files or the path, relative to $XVSAM, to the file.

type=(flat|vsam)

specifies the file type:

vsam
flat

<dispositions>

specifies the file dispositions

<gdg>

specifies the file GDG version

Dispositions are expressed in a similar way as in the VSE/MVS environment:

(<start-state>,<exit-state>,<fault-state>)

where <start-state> indicates the initial state of the required file for further execution of the program:

OLD  file exists
SHR  file exists
NEW  file doesn't exist
MOD  file exists and open for append

Both <exit-state> and <fault-state> indicate the states of file after execution, in case of normal and abnormal termination:

KEEP leaves the file on the system
DELETE removes it.

The default value for disposition is (OLD,KEEP).

Example

//EXEC   PGM=MERGE01
//INPUT1 DD DSN=FILE1.KSDS,DISP=(OLD,KEEP,KEEP)
//INPUT2 DD DSN=FILE2.ESDS(+2),DISP=(OLD,DELETE)
//OUTX   DD DSN=SORT.IN,DISP=(NEW,KEEP)
 

becomes

setenv dlbl_INPUT1 "FILE1.KSDS,disp=(OLD,KEEP,KEEP),type=vsam"
setenv dlbl_INPUT2 "FILE2.ESDS,disp=(OLD,DELETE),type=flat,gdg=+2"
setenv dlbl_OUTX   "SORT.IN,disp=(NEW,KEEP),type=flat"
xrun MERGE01

and the COBOL code:

INPUT-OUTPUT SECTION.
FILE-CONTROL.
  SELECT FILE1 ASSIGN TO EXTERNAL INPUT1
         ORGANIZATION IS INDEXED
         RECORD KEY IS R-KEY
         ACCESS IS DYNAMIC.
  SELECT FILE2 ASSIGN TO EXTERNAL INPUT2
         ORGANIZATION IS SEQUENTIAL.