Chapter Contents |
Previous |
Next |
SAS/ACCESS Interface to IMS-DL/I Software |
The following descriptions of the elements of a DL/I call do not need to be understood in detail by most users. They are included here for readers who want this additional information.
DL/I Call Functions |
The basic DL/I database call functions are listed here. Some of the descriptions refer to SSAs, qualified calls, and unqualified calls. These are described in Segment Search Arguments.
GU | get-unique. If unqualified, this call retrieves (reads) the first segment in the PCB view (program view) of the database. If SSAs are specified, the call retrieves the first segment that satisfies qualifications specified by the SSAs. |
GN | get-next. If unqualified, this call retrieves the next segment in the hierarchical sequence of the database. If SSAs are specified, the call retrieves the next segment that satisfies qualifications specified by the SSAs. |
GNP | get-next-within-parent. This call is like the GN call but is restricted to the subtree of the current parent. (The parent is described in the PCB.) |
GHU | get-hold-unique. This call is like the GU call but also holds the segment for the next update call that uses the same PCB. |
GHN | get-hold-next. This call is like the GN call but also holds the retrieved segment for the next update call that uses the same PCB. |
GHNP | get-hold-next-within-parent. This call is like the GNP call but also holds the segment for the next update call that uses the same PCB. |
DLET | delete. This call deletes the segment retrieved by the last get-hold call using the same PCB. |
REPL | replace. This call replaces the segment held from the last get-hold call using the same PCB with an updated segment that you provide. The get-hold call must be the last DL/I call that used the same PCB. |
ISRT | insert. This call adds new segments using the PCB specified. |
Program Communication Block |
The SAS/ACCESS interface to IMS-DL/I is comprised of two distinct interfaces: the IMS-DL/I engine interface and the DATA step interface. The IMS-DL/I DATA step interface can use any PCB. You can use DL/I INFILE statement extensions to specify the PCB. The DATA step interface offers limited support for TP PCBs and message queue processing.
Using a program view of the database (that is, using the appropriate PCB), a call can selectively access only the segments that are required by the SAS/ACCESS interface. For example, you may need the interface to retrieve savings account data from the ACCTDBD database without retrieving savings debit segments. The PCB defines as sensitive segments only those segments needed by the SAS/ACCESS interface.
A PCB to be used by the SAS/ACCESS interface that accumulates savings account credit information might use the program view shown in Program View of Savings Account Segments.
Program View of Savings Account Segments
G | for Get |
D | for Delete, includes G |
I | for Insert |
R | for Replace, includes G |
A | for All of the above |
E | for Exclusive use, in conjunction with G,D,I,R,A |
L | for Loading database, excludes HISAM |
LS | for Loading sequentially, required for HISAM |
O | for inhibiting program isolation, must be used with G |
P | for Path calls |
GS | for getting segments in ascending sequence |
The PCB mask data also contain other information not described here. (footnote 1)
Database Position |
Suppose your DATA step program uses a PCB that defines the CUSTOMER, CHCKACCT, and SAVEACCT segments as sensitive segments. The program is a read-only program and unqualified GN (get-next) calls are issued. Therefore, the program uses sequential processing. The program view is shown in Program View of Account Segments.
Program View of Account Segments
When the first GN call is issued, DL/I is positioned at the front of the database and the call retrieves the first occurrence of a CUSTOMER segment. When the next call is issued, DL/I uses the current position to determine which segment is retrieved next. In this case, CHCKACCT is retrieved before SAVEACCT because the default search sequence for sequential access is top to bottom, left to right.
Note: The database position is influenced by considerations
that are not described here, such as the type of call issued and certain command
codes.
Segment Search Arguments |
If an SSA describes only the segment type to be accessed, it is an unqualified SSA. (The call is still a qualified call, but the SSA itself is unqualified.) In an unqualified SSA, you can also specify an optional command code, which may affect how the call function is performed or it may affect the qualification of a segment. See Command Codes for more information.
An unqualified SSA has the form
segment-name <command code> |
If an SSA provides a field name and specific value for that field, it is a qualified SSA. A qualified SSA has the form
segment-name <command code> (field-name operator value . . .) |
The first segment occurrence that satisfies the qualification or qualifications is retrieved.
For example, to retrieve a CUSTOMER segment for Hooper J. Walls, the Get (retrieve) call would be qualified with this qualified SSA:
CUSTOMER(CUSTNAME =WALLS, HOOPER J. )
The comparison operators IMS-DL/I uses in a qualified SSA, along with their alternate forms, are listed in the following table.
Operator | Alternate Form |
---|---|
= | = or EQ |
> | > or GT |
< | < or LT |
>= | => or GE |
<= | =< or LE |
¬= | =¬ or NE |
& | * or AND (dependent AND) |
| | + or OR (logical OR) |
*Pad the =, >, and < operators with blanks on the right or left. |
IMSWHST=Y makes sure that any specified WHERE criteria have been incorporated into the SSAs that are generated by the IMS-DL/I engine. Doing so limits the amount of data that the database returns.
If qualified SSAs are not generated by the view descriptor's or application's WHERE statement (or there is no WHERE data set option), the software issues an error message, no IMS-DL/I records are retrieved, and processing stops.
The default, IMSWHST=N, specifies that IMS-DL/I records are retrieved for processing regardless of whether or not qualified SSAs are passed to IMS-DL/I by a view descriptor's or application's WHERE statement.
Multiple SSAs in the DATA Step Interface |
For example, if you want to issue a GN (get-next) call to retrieve a CHCKDEBT segment with a DEBTDATE of 28 March 1995 for banking customer Mary T. Summers, you would qualify the GN call with these SSAs:
CUSTOMER*U-(CUSTNAME =SUMMERS, MARY T. ) CHCKDEBT(DEBTDATE =032895)
The target segment for the call is CHCKDEBT. It is the only segment returned.
To access more than one segment in one call, you must set up a path call, as explained in "Command Codes."
Command Codes |
One commonly used command code is *D, which signifies a path call. For a DL/I GET call, this means that the segment named in the SSA with the *D code is returned, even if it is not the target segment (the segment named in the last SSA). The segments retrieved with SSAs that specify *D are returned to the I/O area in hierarchical sequence. The target segment is placed in the I/O area behind the segments whose SSAs specified *D. (This has no effect on what is returned in the key feedback area; it affects only the I/O area.)
For example, one PCB defines CUSTOMER, CHCKACCT, and CHCKDEBT as sensitive segments. (A Database Path shows this program view.) In the IMS-DL/I DATA step interface, you specify these SSAs and a GU (get-unique) call function. Two segments are returned to the I/O area: CUSTOMER and CHCKDEBT.
CUSTOMER*D-(CUSTNAME =WALLS, HOOPER J. ) CHCKACCT CHCKDEBT(DEBTDATE =030594)
The PCB mask data will contain CHCKDEBT as the name of the last segment successfully retrieved, and the key feedback data contain the concatenated key fields of the CUSTOMER and CHCKACCT segments. The CHCKDEBT segment has only a search field and no sequence field, and therefore no data for CHCKDEBT are in the key feedback area.
Chapter Contents |
Previous |
Next |
Top of Page |
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.