The following four types of DDI statements specify your VSAM files, record indexes, and COBOL record descriptions.
- Description and Syntax:
-
Statement Type
|
Description andSyntax
|
*DDI VSM
|
Specifies the VSAM file external ddname. Identifies VSAM file attributes.
|
|
*DDI VSM DDN=extddn, TYPE=K|E|R,
VSPREFIX=fileprefix,
[CYL|TRK|REC(size)],
CISZ(cntlintrvalsize),
VOL(volname), CAT=catname,
[idcamskeywrds]
|
*DDI REC
|
Specifies the copybook record name with the longest MAXLEN. Each copybook record must have a *DDI REC statement.
|
|
*DDI REC NAME=recname,
SHORT=shrtrecname, COPY=mbrname,
SOURCE=P|C|, MAXLEN=maxreclen,
AVGLEN=avgreclen
|
*DDI IDX
|
Required for keyed files. Specifies the keyed field name and copybook file name. Must immediately follow the *DDI REC statement. Write overlapping record keys as ordinary DDI IDX statements. AMB generates IDCAMS KEYS keywords according to the OFFSET and KEYLEN keywords on the DDI IDX statement.
|
|
*DDI IDX NAME=cpylibreckeyfldname,
[ALIAS=redefinefld],
TYPE=P|U|D, KEYLEN=keyfldlen,
OFFSET=position,
DDN=indxddname,
PIC=number,[idcamskeywrds]
|
*DDI SUB
|
Specifies the copybook record name(s) used by AMB programs, record processing, batch options, and VSAM file external ddname. Defines a data view for the VSAM file.
Note: To define a data view with multiple VSAM files, assign DDI SUB statement parameters for each VSAM file.
|
|
*DDI SUB NAME=subschemaname,
RECORD=recname,
PROCOPT=A|G|I|D|R,
[ACCESS=opt], [BLOCK=0],
[LABEL=STANDARD],
[ASSIGN=extddname
|
- Parameters:
-
DDI Statement
|
Argument
|
Value
|
Len
|
Req
|
Default
|
*DDI VSM
|
DDN
|
File external
ddname
|
8
|
yes
|
none
|
|
TYPE
|
K(eyed)E(ntry)R(elative)
|
1
|
yes
|
K
|
|
VSPREFIX
|
File prefix
|
NA
|
yes
|
none
|
|
CYL,TRK or REC
|
Choose one
|
NA
|
yes
|
none
|
|
CISZ
|
ControlInterval Size
|
NA
|
yes
|
4096
|
|
VOL
|
Volume name
|
NA
|
yes
|
none
|
|
CAT
|
Catalog name
|
NA
|
yes
|
none
|
|
Other IDCAMS keywords
|
IDCAMS syntax
|
NA
|
no
|
none
|
*DDI REC
|
NAME
|
Recname
|
30
|
yes
|
none
|
|
SHORT
|
Shrtrecname
|
8
|
yes
|
|
|
COPY
|
Membername
|
8
|
yes
|
|
|
SOURCE
|
Method used to put copybook members in program. P=via an %INCLUDE statement; C=via COBOL COPY command
|
1
|
yes
|
none
|
|
MAXLEN
|
Maximum record length
|
NA
|
yes
|
none
|
|
AVGLEN
|
Average record length
|
NA
|
yes
|
MAXLEN
|
*DDI IDX
|
NAME
|
copybook record key field name
|
30
|
yes
|
none
|
|
ALIAS
|
File that uses multiple copybook records. The name of the field that redefines NAME
|
30
|
no
|
none
|
|
TYPE
|
Index type--P(rimary) first index must be P; U(nique);D(uplicate)
|
1
|
yes
|
none
|
|
KEYLEN
|
Length of key field
|
4
|
yes
|
none
|
|
OFFSET
|
Offset position of the field relative to the beginning of the record. The first position is 0
|
4
|
yes
|
none
|
|
DDN
|
Ddname of the index
|
24
|
yes
|
Primary=ddname
|
|
PIC
|
Ddname of the index
|
24
|
yes
|
alphanumeric
|
|
IDCAMS overrides
|
IDCAMS syntax
|
NA
|
no
|
none
|
*DDI SUB
|
NAME
|
Unique data view name
|
8
|
yes
|
none
|
|
RECORD
|
Value of the first (or only) DDI REC statement NAME keyword
|
30
|
yes
|
none
|
|
PROCOPT
|
Process control optionsA(ll)G(et)I(nsert)D(elete)R(eplace)
|
1
|
no
|
A
|
|
ACCESS or ACC
|
Batch access options
|
NA
|
no
|
dynamic for KSDS files; sequential for ESDS/RRDS
|
|
BLOCK
|
0
|
NA
|
no
|
0
|
|
LABEL
|
STANDARD
|
NA
|
no
|
STANDARD
|
|
ASSIGN or AS
|
VSAM file external
ddname
|
8
|
no
|
value of DDN parm in the DDI VSM statement
|
- Comments:
-
- Code a DDI VSM statement to correspond to the VSAM file external ddname. This statement identifies VSAM file attributes.
- Code a DDI REC statement for each copybook record to correspond to the copybook record name and copybook filename with the longest MAXLEN.
- If the top-level copybook records do not begin with 01, set the global flags &VS-GEN-01-USING-RECNAMES and GEN-DB-REC-01-NAMES in AMB CNTL files APVSAMIN and APSDBDC respectively to yes.
- If the VSAM file is keyed, write a DDI IDX statement for each index that corresponds to keyed copybook field name and copybook file name. All DDI IDX statements must immediately follow the DDI REC statement. Write overlapping record keys as ordinary DDI IDX statements. AMB generates IDCAMS KEYS keyword according to the OFFSET and KEYLEN keywords on the DDI IDX statement
- Code a DDI SUB statement to correspond to the copybook record name(s) and VSAM file external ddname. This statement defines a data view for the VSAM file.
- To define a data view with multiple VSAM files, assign a RECORD keyword to each VSAM file you want to include.
- For mixed target data views, the names of the SQL and VSAM or IMS data views must be identical. That is, the CREATE SUBSCHEMA name or SQLDDL\filename must be identical to either the VSAM DDI statement value DDI SUB=subschemaname or the IMS DDI statement value DDI DBD=dbdname.
- Example: DDI for Fixed-length keyed sequential (KSDS) File
-
*DDI VSM DDN=EMPLOYEE
*DDI TYPE=K,VSPREFIX=VQAC6550.APS17X,
*DDI TRK(100 10),CISZ(8192),VOL(SAGE03),
*DDI REPLICATE,FSPC(15 15),SHR(1 3),NOIMBED
*DDI REC NAME=EMPLOYEE-RECORD,SHORT=EMPL,
*DDI COPY=EMPLOYEE,SOURCE=P,
*DDI MAXLEN=56
*DDI IDX NAME=EMPL-EMP-NUM,TYPE=P,KEYLEN=6,OFFSET=0,
*DDI DDN=EMPLOYEE,TRK(5 5),VOL(SAGE03)
*DDI IDX NAME=EMPL-SOURCE-CODE,TYPE=D,
*DDI KEYLEN=6,OFFSET=30,DDN=EMPLOYE1,
*DDI TRK(3 3),VOL(SAGE03),NOIMBED
*DDI IDX NAME=EMPL-SALARY,TYPE=D,
*DDI KEYLEN=4,OFFSET=36,DDN=EMPLOYEZ,
*DDI PIC=9(7)COMP-3,TRK(3 3),VOL(SAGE03)
*DDI SUB NAME=SAMPPGM,RECORD=EMPLOYEE-RECORD,PROCOPT=A,
*DDI LABEL=STANDARD,BLOCK=200,ASSIGN=EMPLOYEE
- Example: Copybook for a Variable-length KSDS file (with one index accessing multiple records)
-
% * CICS RECORDS ARE REDEFINED FOR WORKING-STORAGE.
% * Z/OS RECORDS NOT REDEFINED;ARE PLACED DIRECTLY UNDER FD.
% IF &APS-MDC = "CICS-TP"
&VSSUF = " REDEFINES ORDER-RECORD"
% ELSE
&VSSUF = ""
01 ORDER-RECORD.
05 ORDER-KEY PIC X(05).
05 ORDER-RECORD-TYPE PIC X(01).
05 ORDER-CUST-NUMBER PIC X(07).
05 ORDER-PART-NUMBER PIC X(07).
05 ORDER-QUANTITY-ORDERED PIC 9(05).
05 ORDER-QUANTITY-TYPE PIC X(10).
05 ORDER-ORDER-AMOUNT PIC 9(05)V99.
05 ORDER-ORDER-STATUS PIC X(04).
01 ORDER-PART-RECORD &VSSUF.
05 FILLER PIC X(06).
05 PART-NAME PIC X(05).
05 PART-DESCRIPTION PIC X(25).
05 PART-SUPPLIER-NBR PIC X(07).
05 PART-SUPPLIER-NAME PIC X(25).
01 ORDER-DELV-RECORD &VSSUF.
05 FILLER PIC X(06).
05 DELV-CONTACT-NAME PIC X(30).
05 DELV-CONTACT-PHONE PIC X(12).
05 DELV-ADDRESS PIC X(35).
05 DELV-SPECIAL-INSTRUCTIONS PIC X(50).
- Example: DDI for Variable-Length KSDS Files
-
*DDI VSM DDN=ORDER
*DDI REC NAME=ORDER-RECORD,SHORT=ORDER,COPY=ORDER,SOURCE=P,
*DDI MAXLEN=133,AVGLEN=46
*DDI IDX NAME=ORDER-KEY,TYPE=P,KEYLEN=5,OFFSET=0,DDN=ORDER
*DDI REC NAME=ORDER-PART-RECORD,SHORT=PART,MAXLEN=68
*DDI REC NAME=ORDER-DELV-RECORD,SHORT=DELV,MAXLEN=133
*DDI SUB NAME=ORDERSS,
*DDI RECORD=ORDER-RECORD,PROCOPT=A,
*DDI LABEL=STANDARD,BLOCK=0,ASSIGN=ORDER
- Example: DDI Statements for Generating DDISYMB
-
*DDI VSM DDN=PERSON
*DDI TYPE=K,VSPREFIX=VAPS6550,
*DDI CISZ(4096),VOL(PDVL02),TRK(5 5)
*DDI REC NAME=PERSONNEL-RECORD,SHORT=PERSONEL,
*DDI COPY=PERSONEL,SOURCE=P,MAXLEN=80,PREFIX=PER
*DDI IDX NAME=SSA,ALIAS=SSA-X,TYPE=P,KEYLEN=9,
*DDI OFFSET=0,DDN=PERSON,
*DDI TRK(5,5),VOL(PDVL02)
*DDI IDX NAME=LAST-NAME,TYPE=D,KEYLEN=15,
*DDI OFFSET=9,DDN=PERSON1,
*DDI TRK(5,5),REUSE,VOL(PDVL02)
*DDI IDX NAME=TITLE,TYPE=D,KEYLEN=15,
*DDI OFFSET=24,DDN=PERSON2,
*DDI TRK(5,5),REUSE,VOL(PDVL02)
*DDI SUB NAME=SAMPLE,RECORD=PERSONNEL-RECORD,
*DDI PROCOPT=A
- Example: DDI for Data Views Containing Multiple VSAM Files
-
*DDI VSM DDN=DMOPART
*DDI TYPE=K,VSPREFIX=CTSAPS.DEMO,TRK(10 10),VOL(WIN004),
*DDI CISZ(4096)
*DDI REC NAME=PART-MASTER-REC,SHORT=DMOPART,COPY=DMOPART
*DDI SOURCE=P,MAXLEN=80
*DDI IDX NAME=PM-PART-NO,TYPE=P,KEYLEN=8,OFFSET=0,
DDN=DMOPART,TRK(1,1)
*DDI VSM DDN=DMOSTCK
*DDI TYPE=K,VSPREFIX=CTSAPS.DEMO,TRK(10 10),VOL(WIN004),
*DDI CISZ(4096)
*DDI REC NAME=PART-STOCK-REC,SHORT=DMOSTCK,COPY=DMOSTCK
*DDI SOURCE=P,MAXLEN=80
*DDI IDX NAME=PS-STOCK-KEY,TYPE=P,KEYLEN=20,OFFSET=0,
*DDI DDN=DMOSTCK,TRK(1,1)
*DDI IDX NAME=PS-PART-NO,TYPE=D,KEYLEN=8,OFFSET=0,
*DDI DDN=DMOSTCKX,TRK(1,1)
*DDI SUB NAME=DMVMNU,RECORD=PART-MASTER-REC,PROCOPT=G,
*DDI ACC=DYNAMIC,AS=DMOPART
*DDI SUB NAME=DMVINQ,RECORD=PART-MASTER-REC,PROCOPT=A,
*DDI ACC=DYNAMIC,AS=DMOPART
*DDI SUB NAME=DMVUPD,RECORD=PART-MASTER-REC,PROCOPT=A,
*DDI ACC=DYNAMIC,AS=DMOPART
*DDI SUB NAME=DMVLST,RECORD=PART-STOCK-REC,PROCOPT=A,
*DDI ACC=DYNAMIC,AS=DMOSTCK
*DDI RECORD=PART-MASTER-REC,PROCOPT=A,ACC=DYNAMIC,
*DDI AS=DMOPART