Previous Topic: Coding a HeadingNext Topic: Defining Input Record Fields


Defining a Table

 USER 'XYZ COMPANY, INC.'
 PERSONEL:  INPUT DATACOM  RECORD EQ 375  NAME EQ PMF DBID EQ 001
 DEFINE PERSONEL-COMMAND      001-005   X
 DEFINE PERSONEL-KEY          006-010   X
 DEFINE PERSONEL-ELMLIST      191-201   X
 DEFINE PERSONEL-NUMBER       301-305   X '  ID  ' 'NUMBER'
 DEFINE PERSONEL-NAME         306-329   X 'EMPLOYEE NAME'
 DEFINE PERSONEL-CITY         354-368   X 'CITY'
 DEFINE PERSONEL-STATE        369-370   X
 DEFINE PERSONEL-ZIP-CODE     371-375   X 'ZIP'   'CODE'
 MOVE 'GETIT' TO PERSONEL-COMMAND
 MOVE 'EMPNO' TO PERSONEL-KEY
 MOVE 'ADEMP' TO PERSONEL-ELMLIST
 GET PERSONEL
 GOTO EOJ WHEN PERSONEL EQ 'E'
 REPORT 'EMPLOYEE SUMMARY - TEXAS'
 SELECT PERSONEL-STATE EQ 'TX'
 CONTROL PERSONEL-CITY
 PRINT PERSONEL-NAME PERSONEL-NUMBER PERSONEL-CITY
      PERSONEL-ZIP-CODE
 END

After the USER statement, the input table must be defined to the Reporting Facility with the INPUT statement.

For a CA Datacom/DB table the INPUT command has the following format:

►►─ filename: ─ INPUT ─ DATACOM ─ RECORD ─ EQ ─ xxx ─ NAME ─ EQ ─ xxx ──►

►─ DBID ─ EQ ─ xxx ─┬────────────────────┬─┬─────────────────┬──────────►
                    └─ SIDNAME=xxxxxxxx ─┘ └─ DBIDUSER=9999 ─┘

►─┬───────────────┬─────────────────────────────────────────────────────►◄
  └ DBIDMIF=9999 ─┘

The sample program INPUT statement looks like this:

 PERSONEL:  INPUT DATACOM RECORD EQ 375 NAME EQ PMF DBID EQ 001

PMF is the three-character CA Datacom/DB name for the table that is accessed from CA Datacom/DB and used in the report. 001 is the numeric database ID of the same table.

The RECORD EQ xxx parameter is used by the Reporting Facility to define the total length, in characters, of all the elements to be read from this database table. When calculating the length for a CA Datacom/DB table, add 300 characters to the total length of all the elements to supply the space needed to communicate with CA Datacom/DB.

Coding the RECORD EQ xxx parameter requires an understanding of table definition and input record fields as discussed in the next section.

The INPUT statement tells the Reporting Facility:

The following parameters are used to request data from multiple MUFS and are optional:

Note: Code and link the DBSIDPR macro as xxxxxxxx matching the SIDNAME=parameter coded. For more information about coding the DBSIDPR macro, see the CA Datacom Database and System Administration Guide.