Chapter Contents |
Previous |
Next |
SAS/ACCESS Interface to IMS-DL/I Software |
A physical database is defined to IMS-DL/I in one DBD, which is described later in this section. A physical database is limited to 15 hierarchical levels and 255 segment types (up to 254 dependent segments organized over 14 levels, plus the root segment). There is no limit to the number of segment occurrences, however. Hierarchical File Structure, earlier in this chapter, illustrates the physical database ACCTDBD.
Sample Program View illustrates a program view that consists of some segments from the ACCTDBD database. This program view might be used by a program that prints monthly checking account statements. However, a SAS/ACCESS view descriptor can access data in only one path in the database. Therefore, in one invocation, the view descriptor can retrieve data in either the CHCKDEBT segment or the CHCKCRDT segment.(footnote 1)
In order for the SAS/ACCESS interface to access an IMS-DL/I database, certain information about the database must be defined. These definitions are contained in DBDs and PSBs.
What You Need to Know to Create Descriptors |
You can get all of this information from your installation's database administrator (DBA).
The descriptions of DBDs and PSBs that follow do not need to be understood in detail. They are included here for readers who want this additional information.
Database Description |
the name of the DBD, which is also used as a shorthand name for the IMS-DL/I database (1-8 characters). | |
the type and access method for the database (DEDB, MSDB, HDAM, HIDAM, HSAM, HISAM, GSAM, SHISAM, or SHSAM). These database types are defined in the next section. | |
the randomizing method to assign an address to each record's key (HDAM only). | |
the DDname for the database. | |
the device type. | |
the block size. | |
the name, parent, and length of each segment type in the database. The parent information enables IMS-DL/I to determine the segment's position in the hierarchy. | |
the name, length, starting position, and type of data for each sequence and search field in each segment. (In the following example, the code that specifies these characteristics is underlined.) |
Note: It is not necessary to specify every
field in a segment in the DBD. Only those fields to be used as sequence and
search fields are specified in the DBD.
The following is the DBD for the ACCTDBD database.
DBD [1] NAME=ACCTDBD, [2] ACCESS=(HDAM,OSAM), X [3] RMNAME=(DFSHDC40,3,71) DATASET [4] DD1=ACCTDD, [5] DEVICE=3380, X [6] BLOCK=2400 [7] SEGM NAME=CUSTOMER,PARENT=0,BYTES=225 [8] FIELD NAME=(SSNUMBER,SEQ,U),BYTES=11,START=1, X TYPE=C FIELD NAME=CUSTNAME,BYTES=40,START=12,TYPE=C FIELD NAME=CUSTADD1,BYTES=30,START=52,TYPE=C FIELD NAME=CUSTADD2,BYTES=30,START=82,TYPE=C FIELD NAME=CUSTCITY,BYTES=28,START=112,TYPE=C FIELD NAME=CUSTSTAT,BYTES=2,START=140,TYPE=C FIELD NAME=CUSTLAND,BYTES=20,START=142,TYPE=C FIELD NAME=CUSTZIP,BYTES=10,START=162,TYPE=C FIELD NAME=CUSTHPHN,BYTES=12,START=172,TYPE=C FIELD NAME=CUSTOPHN,BYTES=12,START=184,TYPE=C [7] SEGM NAME=CHCKACCT,BYTES=40,PARENT=CUSTOMER [8] FIELD NAME=(ACNUMBER,SEQ,U),BYTES=12,START=1, X TYPE=X FIELD NAME=STMTAMT,BYTES=5,START=13,TYPE=P FIELD NAME=STMTDATE,BYTES=6,START=18,TYPE=X FIELD NAME=STMTBAL,BYTES=5,START=26,TYPE=P [7] SEGM NAME=CHCKDEBT,BYTES=80, X PARENT=((CHCKACCT,DBLE)),RULES=(,LAST) [8] FIELD NAME=DEBTAMT,BYTES=5,START=1,TYPE=P FIELD NAME=DEBTDATE,BYTES=6,START=6,TYPE=X FIELD NAME=DEBTBLNK,BYTES=2,START=12,TYPE=X FIELD NAME=DEBTTIME,BYTES=8,START=14,TYPE=C FIELD NAME=DEBTDESC,BYTES=59,START=22,TYPE=C [7] SEGM NAME=CHCKCRDT,BYTES=80, X PARENT=((CHCKACCT,DBLE)),RULES=(,LAST) [8] FIELD NAME=CRDTAMT,BYTES=5,START=1,TYPE=P FIELD NAME=CRDTDATE,BYTES=6,START=6,TYPE=X FIELD NAME=CRDTBLNK,BYTES=2,START=12,TYPE=X FIELD NAME=CRDTTIME,BYTES=8,START=14,TYPE=C FIELD NAME=CRDTDESC,BYTES=59,START=22,TYPE=C [7] SEGM NAME=SAVEACCT,BYTES=40,PARENT=CUSTOMER [8] FIELD NAME=(ACNUMBER,SEQ,U),BYTES=12,START=1, X TYPE=X FIELD NAME=STMTAMT,BYTES=5,START=13,TYPE=P FIELD NAME=STMTDATE,BYTES=6,START=18,TYPE=X FIELD NAME=STMTBAL,BYTES=5,START=26,TYPE=P [7] SEGM NAME=SAVEDEBT,BYTES=80, X PARENT=((SAVEACCT,DBLE)),RULES=(,LAST) [8] FIELD NAME=DEBTAMT,BYTES=5,START=1,TYPE=P FIELD NAME=DEBTDATE,BYTES=6,START=6,TYPE=X FIELD NAME=DEBTBLNK,BYTES=2,START=12,TYPE=X FIELD NAME=DEBTTIME,BYTES=8,START=14,TYPE=C FIELD NAME=DEBTDESC,BYTES=59,START=22,TYPE=C [7] SEGM NAME=SAVECRDT,BYTES=80, X PARENT=((SAVEACCT,DBLE)),RULES=(,LAST) [8] FIELD NAME=CRDTAMT,BYTES=5,START=1,TYPE=P FIELD NAME=CRDTDATE,BYTES=6,START=6,TYPE=X FIELD NAME=CRDTBLNK,BYTES=2,START=12,TYPE=X FIELD NAME=CRDTTIME,BYTES=8,START=14,TYPE=C FIELD NAME=CRDTDESC,BYTES=59,START=22,TYPE=C DBDGEN
The following is the DBD for the WIRETRAN segment of the WIRETRN database.
DBD NAME=WIRETRN,ACCESS=(HDAM,OSAM), X RMNAME=(DFSHDC40,3,71) DATASET DD1=WIREDD,DEVICE=3380, BLOCK=2400 SEGM NAME=WIRETRAN,PARENT=0,BYTES=100 FIELD NAME=(SSNACCT,SEQ,M),BYTES=23,START=1, X TYPE=C FIELD NAME=ACCTTYPE,BYTES=1,START=24,TYPE=C FIELD NAME=WIREDATE,BYTES=8,START=25,TYPE=C FIELD NAME=WIRETIME,BYTES=8,START=33,TYPE=C FIELD NAME=WIREAMMT,BYTES=5,START=41,TYPE=X FIELD NAME=WIREDESC,BYTES=40,START=46,TYPE=C DBDGEN
Data Type Code | Data Type |
---|---|
X | hexadecimal |
P | packed decimal |
C | alphanumeric character |
F | binary fullword |
H | binary halfword |
Z | zoned decimal |
E | short floating point |
D | long floating point |
L | extended floating point |
Note: All COBOL
and PL/I data types are
supported as hexadecimal data types.
Recommended DBFORMAT= Values to Use for Common COBOL and PL/I Data Types shows the DBFORMAT= value that you specify in an access descriptor for some common COBOL and PL/I data types. This table also shows the SAS variable formats that the SAS/ACCESS interface generates from the IMS-DL/I DBFORMAT= value.
IMS-DL/I Type | COBOL | PL/I | Description | Standard Length in Bytes | RecommendedDBFORMAT= | SAS Format Generated |
---|---|---|---|---|---|---|
C | PIC A | Pic 'A' | Alphabetic | <=200 >200 |
$w. $200. |
$w. $200. |
C | PIC X | Char or Pic 'X' | Alphanumeric | <=200 >200 |
$w. $200. |
$w. $200. |
Z | PIC 9 | Pic '9' | Numeric Edited | w.d | ||
Z | PIC S9 | Pic '99T' | Zoned-Decimal | ZDw.d | w.d | |
H | PIC 9(4) COMP | Fixed Bin (15) | Fixed-Point Binary | 2 | IB2. | 7.0 |
F | PIC 9(8) COMP | Fixed Bin (31) | Fixed-Point Binary | 4 | IB4. | 10.0 |
E | COMP-1 |
Float Bin (21) | Floating-Point | 4 | Rb4. | E13.0 |
D | COMP-2 | Float Bin(53) | Floating-Point | 8 | RB8. | E22.0 |
P | COMP-3 | Fixed Decimal | Packed-Decimal | <=16 | PDw.d | w.d |
When you create an access descriptor, you use the ITEM= statement to describe the IMS-DL/I DBD. When you need to specify a SAS informat that corresponds to a COBOL data description, refer to PICTURE and USAGE. If the USAGE is COMP-1 or COMP-2, there is no PICTURE. If no USAGE is specified, it defaults to DISPLAY.
Use the following information to make the conversions:
A
or
X
represent character values.
9
to represent digits. They might use an
S
to mean signed and a
V
to show the location of an implied decimal point.
The number of characters or digits is specified either
by the number of
A
s,
X
s, or
9
s in the picture or by
the number in parentheses immediately after the
A
,
X
,
or
9
. For example,
AAAA
is the same as
A(4)
.
TITLE-MISSING shows other conversions.
USAGE | PICTURE | SAS Informat | Width | Decimal |
---|---|---|---|---|
COMP-1 | None | RB4. | ||
COMP-2 | None | RB8. | ||
DISPLAY | 9(int)V9(fract) | ZDw.d | (int + fract) | (fract) |
COMP-3 | 9(int)V9(fract) | PDw.d | CEIL((int+fract+1)/2) | (fract) |
COMP | 9(int)V9(fract) | IBw.d | * | |
* If the (int + fract) is 1-4, the width is 2 and decimal is a fraction. If the (int + fract) is 5-9, the width is 4 and decimal is a fraction. If the (int + fract) is 10-18, the width is 8 and decimal is a fraction. |
Use SAS formats to print the fractional part read with the IBw.d and RBw.d SAS informats.
Program Specification Block |
PCB TYPE=DB,DBDNAME=ACCTDBD,PROCOPT=G, X KEYLEN=11 SENSEG NAME=CUSTOMER,PARENT=0,PROCOPT=G PCB TYPE=DB,DBDNAME=ACCTDBD,PROCOPT=G, X KEYLEN=23 SENSEG NAME=CUSTOMER,PARENT=0,PROCOPT=GP SENSEG NAME=CHCKACCT,PARENT=CUSTOMER,PROCOPT=G SENSEG NAME=SAVEACCT,PARENT=CUSTOMER,PROCOPT=G PCB TYPE=DB,DBDNAME=ACCTDBD,PROCOPT=A, X KEYLEN=23 SENSEG NAME=CUSTOMER,PARENT=0,PROCOPT=AP SENSEG NAME=CHCKACCT,PARENT=CUSTOMER,PROCOPT=AP SENSEG NAME=CHCKDEBT,PARENT=CHCKACCT,PROCOPT=A SENSEG NAME=CHCKCRDT,PARENT=CHCKACCT,PROCOPT=A SENSEG NAME=SAVEACCT,PARENT=CUSTOMER,PROCOPT=AP SENSEG NAME=SAVEDEBT,PARENT=SAVEACCT,PROCOPT=A SENSEG NAME=SAVECRDT,PARENT=SAVEACCT,PROCOPT=A PCB TYPE=DB,DBDNAME=WIRETRN,PROCOPT=A, X KEYLEN=23 SENSEG NAME=WIRETRAN,PARENT=0,PROCOPT=A PSBGEN LANG=ASSEM,IOASIZE=500,PSBNAME=ACCTSAM, X CMPAT=YES END
The DBA can specify data sensitivity for an IMS-DL/I database in each database PCB in the PSB.
Chapter Contents |
Previous |
Next |
Top of Page |
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.