Previous Topic: IF, AND, ORNext Topic: INLIM


INFILE

Use the INFILE keyword to identify the sequential data set the command uses for INFILE processing. This data set needs to be created and populated with the necessary data before referencing it. The ROOTKEY keyword must also be included for INFILE processing. For a full description of how the INFILE directs the database processing, see the ROOTKEY keyword.

If this optional keyword is not specified, the sequential data set referenced by the INFILE DD statement is used

Syntax:

INFILE({[INFILE| dsname[(member)]|ddname][,RESET|,RETAIN]})

Parameters:

INFILE

Default ddname

dsname

Identifies the sequential data set name that contains the keys and data required for processing.

ddname

Identifies the sequential data set's ddname that contains the keys and data required for processing.

RESET

This parameter value closes the INFILE after the command has completed processing.

RETAIN

When the RETAIN parameter is used, the current job step's subsequent command begins processing with the next record from the INFILE.

Example 1

The following syntax inserts the ATTEND segment for the STUDENT and HISTORY segments' keys located in the INFILE data set. The INFILE data set is defined by the DD NEWATTN and contains the key information as well as the data to be inserted.

UPDATE,
  DBD(DBDIVP),
  INFILE(NEWATTN),
  ROOTKEY(1),
  IF(HISTORY,HISTORY-KEY,EQ,INFILE(6,12)),
     MOVE(CLEAR),
     MOVE(1,INFILE(18,29)),
     INSERT(ATTEND)

Example 2

This example deletes all the SUBJECT segments, and all of their subordinate children that match the SUBJECT-CODE values found in locations 6 – 9 of the sequential file's records referenced by ddname INDD. The STUDENT (ROOT) segments are read directly from the root key found in the first five bytes of the INFILE record.

UPDATE,
  DBD(DBDIVP),
  INFILE(INDD),
  ROOTKEY(1),
  IF(SUBJECT,SUBJECT-CODE,EQ,INFILE(6,4)),
     DELETE(SUBJECT)