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 dd function.

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

The function dd must be invoked providing:

internal file name
link value string

The link value string must contain the following information:

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).

Binding a file

To bind a file, internal filename and external file information must be provided:

// SRC: //FILEIN  DD DSN=WKCAT.FI.ROW,DISP=(OLD,KEEP)
dd("FILEIN", "WKCAT.FI.ROW,disp=(OLD,KEEP)");

Binding a file with INSTREAM data

The binding of a file with INSTREAM data, is performed by the inStream function

// SRC: //SYSIN   DD *
// SRC: DDY20031212
// SRC: DDY20031212
// SRC: /*
dd("SYSIN", inStream(
              "DDY20031212"+NL+
              "DDY20031212"+NL+
));

Binding a file with multiple files

The mainframe environment allows to bind a file with more than one, eventually adding INSTREAM data too.

The binding of multiple files is performed through the WorkFile objects.

// SRC: //FILEIN   DD DSN=MY.FILE.NT1
// SRC: //         DD DSN=MY.FILE.NT2
// SRC: //         DD *
// SRC: USER DC 1
// SRC: USER DC 2
// SRC: /*
var concatenated=createWorkFile();
concatenated.addDd("MY.FILE.NT1,cat=FLATCAT,disp=(OLD,KEEP),type=flat");
concatenated.addDd("MY.FILE.NT2,cat=FLATCAT,disp=(OLD,KEEP),type=flat");
concatenated.addString(
   "USER DC 1"+NL+
   "USER DC 2"+NL
);
dd("SYSIN", concatenated.getDD());