Previous Topic: ArrayNext Topic: Labels


Field Name Qualification

Define scalar variables and arrays as being either within the input record area or the General Storage Area (GSA). Each storage location is associated with a specific input file or a location in the GSA. You may assign duplicate field names if the duplicates are not in the same input file or the GSA.

Reference to the qualified field is in the following format:

Field Name Qualification

►►─ qualifier.fieldname ──────────────────────────────────────────────────────►◄
qualifier

The unique file name associated with the FILE command where the field resides, or GSA if the field resides in the General Storage Area.

fieldname

The symbolic name assigned to the scalar variable or array element to be referenced.

The following demonstrates common uses and benefits of field name qualification:

MASTER:  FILE   DATACOM   RECORD EQ 250             File 1 definition
	  DEFINE DB-COMMAND        1-5 X
           .
         DEFINE AMOUNT-FIELD 246-250 P4
           .
PAYROLL: FILE   DATACOM   RECORD EQ 100             File 2 definition
         DEFINE DB-COMMAND         1-5 X
           .
         DEFINE AMOUNT-FIELD  96-100 P4
           .
         DEFINE AMOUNT-FIELD(7.4)=0                  GSA Field
           .
         MOVE   'GETIT' TO MASTER.DB-COMMAND         Program body
           .
         MOVE   'REDKG' TO PAYROLL.DB-COMMAND
           .
         COMPUTE GSA.AMOUNT-FIELD EQ
                 (MASTER.AMOUNT-FIELD + PAYROLL.AMOUNT-FIELD

Note the following: