Previous Topic Next topic Print topic


DDI statements - IMS DB

Restriction: This topic applies only when the AppMaster Builder AddPack has been installed, and applies only to Windows platforms.

The following three types of DDI statements specify your Program Specification Blocks (PSBs), Data Base Definitions (DBDs), and their COBOL record descriptions.

Description and Syntax:
Statement Type Description and Syntax
*DDI DBD *DDI DBD specifies the DBD statement in the database.
 
 *DDI DBD NAME=dbdname
*DDI REC Specifies the SEGM statement/copybook
 
*DDI REC NAME=copybookrec|[new-COBOL-recordname],
*DDI     SEG=segname, [COPY=membername|[new-copybookname]],
*DDI     [GEN01=Y|N]
*DDI FLD Specifies the FIELD and XDFLD statement/copybook field
 
*DDI FLD NAME=copybookfldname, 
IMSNAME=fldname,*DDI     [PIC=copybookpic]
Parameters:
DDI Statement Argument Value Len Req Default
*DDI DBD NAME dbname 8 yes none
*DDI REC NAME copybookrec 30 yes DBD value of SEGM NAME=
  SEG DBD value of SEG NAME= 8 yes none
  COPY Membername 8 no SEG NAME
  GEN01 Y or N 1 no Y
*DDI FLD NAME copybookfieldname 30 yes DBD value of FIELD NAME= or DBD value of XDFLD NAME=
  IMSNAME DBD value of FIELD NAME= or DBD value of XDFLD NAME= 8 yes none
  PIC copybookpic 24 no x(n), where n = the value of the BYTES keyword in the DBD
Comments:
  • Code your IMS DDI source file as follows:
    • Code a DDI DBD statement to correspond to the DBD statement in the database.
    • Code DDI REC statements for each segment you want to import that corresponds to the SEGM statement in the database and its copybook record. Specify the name of the copybook record that corresponds to the DBD segment identified on the DDI DBD statement using the NAME parameter. The name of the copybook member that contains the segment copybook record should be the same as the segment name. If it is not, specify the copybook member name with the COPY parameter.
    • Code a DDI FLD statement to correspond to the copybook record field. You must code a DDI FLD statement for each field statement in the DBD.
    • If the XDFLD has multiple SRCH fields, include SRCH fields. Code a DDI FLD statement. When there are multiple SRCH fields, AppMaster Builder defaults the name value to the XDFLD value. Code a dummy COBOL name that is different than any copybook field name of the SRCH fields in the NAME parameter to override the default. Alternatively, specify the DBD value of XDFLD using the IMSNAME parameter. Use the dummy name you specified on the DDI FLD statement in database commands to qualify on a secondary index composed of multiple SRCH fields.
    • If the XDFLD has one SRCH field, code DDI DBD and DDI REC statements only. It is not necessary to code a DDI FLD statement for the XDFLD because the Micro Focus Generator refers to the SRCH field definition.
  • To indicate the level number of the top level copybook records, set the &GEN-DB-REC-01 NAMES flag in the AMB CNTL file, APSDBDC as follows:
    • If the top level copybook records begin with 01, set the flag to 0 (default).
    • If the top level copybook record does not begin with 01, set the flag to 1 and assign a unique 01-level name using the NAME parameter.
    • Alternatively, use the GEN01 parameter on the DDI DBD statement to override the value of this flag. Specify GEN01=n to indicate that the top level copybook record level number begins with an 01 level number or specify GEN01=y to indicate that the top level numbers do not begin with 01.
  • When you load and build IMS DDI source into a data view, AppMaster Builder converts the following special characters in data names:
    Special Character Converts to
    $ X
    # Y
    @ Z
  • If the database contains secondary indexes, you can search on a secondary index field without having to generate DDISYMB for the index database.
  • If you write a database command against a PCB that uses a secondary index, use the proper COBOL name for the index field to be qualified upon. The Micro Focus Generator recognizes a secondary index by the presence of the PROCSEQ or INDICES parameters, and generates segment search arguments (SSA) naming the IMS XDFLD.
  • To access the index database itself, define the index DBD in DBD source, and include PCBs for it in PSBs you load and build into the data view.
  • If a PSB contains multiple PCBs for the database, use the VIEW or PCB parameter when you code the database rule to ensure that the correct PCB is used for the generated call.
  • To reference logical relationships in your data view, code a DDI DBD statement and a DDI REC statement. In the DDI REC statement, do not include information for segments in a logical DBD if the logical segment has a single physical source segment or the same IMS name as its physical source segment. The IMS Generator does not validate IMS logical Insert/Delete/Replace rules.
Example: DBD and Copybook DDI Statements

DBD statements:

DBD    NAME=DBD1,ACCESS=(HDAM,VSAM), ...
SEGM   NAME=S1,BYTES=100,PTR=T, ...
FIELD  NAME=S1FLD,START=1,BYTES=3,TYPE=N, ...
SEGM   NAME=S2,BYTES=80, ...
FIELD  NAME=S2FLD,START=1,BYTES=30,TYPE=C, ...

copybook record (S1):

01  SALES-REC.
    05  REGION-FLD          PIC 9(03).

          .

copybook record (S2):

01  CUST-REC.
    05  LOCATION-FLD        PIC X(30).
          .

DDI Statements:

*DDI DBD NAME=DBD1
*DDI REC NAME=SALES-REC,SEG=S1,COPY=S1,
*DDI     GEN01=Y
*DDI FLD NAME=REGION-FLD,IMSNAME=S1FLD,PIC=9(03)
*DDI REC NAME=CUST-REC,SEG=S2,COPY=S2,
*DDI     GEN01=Y
*DDI FLD NAME=LOCATION-FLD,IMSNAME=S2FLD,PIC=X(30)
Previous Topic Next topic Print topic