PURPOSE: The Data Base Library (DBL) Access form of the GET statement is used to access the information stored in a DBL object. All significant information about each DBL entry is made available, as is the text of the object for that entry. This form of the GET statement makes it easy to construct information utilities such as data dictionaries, cross references, enhanced listers, etc.
After the DBL entry is retrieved, the information is placed into a standard ACCENT R record whose SD is described below. The SD consists of multiple record types; each kind of object (entry type), such as DBL, SD, DS, etc., has a different record layout. A record type TXT is also available for the text of objects that have text.
GET FROM designator retrieval method [HUSH] [IF; UNLESS clause]
FROM designator |
gives the designator assigned to the DBL in a previous RELATE statement. FROM designator may appear immediately after the GET or before the HUSH. |
Retrieval method |
specifies the retrieval method ACCENT R should use in retrieving the specified DBL entry or text line (see Forms 1-3 on the following pages). The methods are: Sequential DBL Entry Retrieval - The first or subsequent DBL entries can be retrieved. Entries can also be retrieved by entry type. (See form 1.) Match DBL Entry Retrieval - A DBL entry is retrieved by its entry type and entry name. (See form 2.) Sequential Text Retrieval - The first or subsequent text line(s) of the current DBL object can be retrieved. (See form 3.) |
The following PM creates an expanded Directory Listing of a DBL. This allows quick determination of whether all objects are compatible with the current version of ACCENT R.
CONTROL SECTION RELATE DBL FROM COMMAND AS AUX1 DETAIL SECTION START GET FROM AUX1 NEXT DBL ENTRY LEAVE IF @AUX NE “YES” TYPE @CR, “ENTRY_TYPE = “, ENTRY_TYPE:AUX1 TYPE “ENTRY_NAME = “, ENTRY_NAME:AUX1 TYPE “CREATE_DATE = “, @UDTSTR CREATE_TIME:AUX1 TYPE “CHANGE_DATE = “, @UDTSTR CHANGE_TIME:AUX1 TYPE “SAVE_STATUS = “, SAVE_STATUS:AUX1 REPEAT
*USE PM STATUS_CHECK EQUATE TEST.DBL TO AUX1
ENTRY_TYPE = DBL ENTRY_NAME = TEST CREATE_DATE = 29-APR-1986 13:27:36 CHANGE_DATE = 29-APR-1986 13:27:36 SAVE_STATUS = YES
ENTRY_TYPE = SD ENTRY_NAME = ORDERS_DESC CREATE_DATE = 29-APR-1986 13:27:40 CHANGE_DATE = 29-APR-1986 13:27:40 SAVE_STATUS = YES
ENTRY_TYPE = DS ENTRY_NAME = ORDERS CREATE_DATE = 29-APR-1986 13:27:41 CHANGE_DATE = 29-APR-1986 13:27:45 SAVE_STATUS = YES
ENTRY_TYPE = PM ENTRY_NAME = KEEPUP CREATE_DATE = 29-APR-1986 13:27:46 CHANGE_DATE = 29-APR-1986 13:27:46 SAVE_STATUS = YES
NOTES: If the GET statement succeeds, the specified DBL entry or text line is retrieved and the system field @AUX is set to “YES”. If the GET statement fails @AUX is set to “MISSI” or “EMPTY”. If ACCENT R could not retrieve the specified object, @AUX is set to “MISSI”. If a text line is requested and text is not associated with the current DBL entry, @AUX is set to “EMPTY.”
The text line in LINE_TEXT may contain line continuation carriage returns. Since this field is 4095 characters long, it should be displayed in free form to suppress trailing spaces. For example:
00800 PRINT LINE_TEXT@””
When a Data Base Library (DBL) is accessed by the GET statement, ACCENT R views the entries as records in a Data Set (DS). The following Schema Definition (SD) shows the record formats used, and the information available, for each entry type.
FORM IS BINARY DISALLOW IN PLACE DELETES RECORD ID IS ENTRY TYPE
STRUCTURE FOR TXT RECORD ID = ‘TXT’ ENTRY_TYPE, CHAR, 3 LINE_NUMBER, INT, 5 LINE_TEXT, CHAR, 4095
STRUCTURE FOR DBL RECORD ID = ‘DBL’ ENTRY_TYPE ENTRY_NAME, CHAR, 40 CREATE_TIME, INT, MAX CHANGE_TIME, INT, MAX SAVE_STATUS, CHAR, 10
STRUCTURE FOR SD RECORD ID = ‘SD’ ENTRY_TYPE ENTRY_NAME CREATE_TIME CHANGE_TIME SAVE_STATUS SD_CHECKSUM, SB, MAX SD_FORM, CHAR, 40 SD_FORM_INDEX, INT, 2
STRUCTURE FOR DS RECORD ID = ‘DS’ ENTRY_TYPE ENTRY_NAME CREATE_TIME CHANGE_TIME SAVE_STATUS SD_CHECKSUM SD_FORM SD_FORM_INDEX SD_NAME, CHAR, 40 TOTAL_REC, INT, MAX DELETED_REC, INT, MAX TOTAL_CHARS, INT, MAX CF_NAME, CHAR, 40
STRUCTURE FOR ID RECORD ID = ‘ID’ ENTRY_TYPE ENTRY_NAME CREATE_TIME CHANGE_TIME SAVE_STATUS SD_CHECKSUM DI_CHECKSUM, SIGNEDBIT, MAX NO_DOMAINS, INT, 3 INDEX_TYPE, CHAR, 3 STATIC, CHAR, 3 SD_NAME
STRUCTURE FOR DI RECORD ID = ‘DI’ ENTRY_TYPE ENTRY_NAME CREATE_TIME CHANGE_TIME SAVE_STATUS SD_CHECKSUM DI_CHECKSUM NO_DOMAINS INDEX_TYPE STATIC SD_NAME ID_NAME, CHAR, 40 DS_NAME, CHAR, 40
STRUCTURE FOR SF RECORD ID = ‘SF’ ENTRY_TYPE ENTRY_NAME CREATE_TIME CHANGE_TIME SAVE_STATUS
STRUCTURE FOR GS RECORD ID = ‘GS’ ENTRY_TYPE ENTRY_NAME CREATE_TIME CHANGE_TIME SAVE_STATUS GS_CHECKSUM, SIGNEDBIT, MAX TOTAL_SIZE, INT, MAX
STRUCTURE FOR PM RECORD ID = ‘PM’ ENTRY_TYPE ENTRY_NAME CREATE_TIME CHANGE_TIME SAVE_STATUS
STRUCTURE FOR CM RECORD ID = ‘CM’ ENTRY_TYPE ENTRY_NAME CREATE_TIME CHANGE_TIME SAVE_STATUS
STRUCTURE FOR SI RECORD ID = ‘SI’ ENTRY_TYPE ENTRY_NAME CREATE_TIME CHANGE_TIME SAVE_STATUS
STRUCTURE FOR FS RECORD ID = ‘FS’ ENTRY_TYPE ENTRY_NAME CREATE_TIME CHANGE_TIME SAVE_STATUS DS_NAME
STRUCTURE FOR CF RECORD ID = ‘CF’ ENTRY_TYPE ENTRY_NAME CREATE_TIME CHANGE_TIME SAVE_STATUS SD_CHECKSUM DS_NAME
STRUCTURE FOR CS RECORD ID = ‘CS’ ENTRY_TYPE ENTRY_NAME CREATE_TIME CHANGE_TIME SAVE_STATUS
The fields within each record type in the standard DBL Schema are described below.
CF_NAME |
The name of the CF associated with the DS. Blank if a CF has not been defined. |
CHANGE_TIME |
Date and time the object was last changed (UDT format). |
CREATE_TIME |
Date and time the object was created (UDT format). |
DELETED_REC |
The number of records deleted in place, as recorded in the DBL. |
DI_CHECKSUM |
Checksum of the Data Index (DI). The DI_CHECKSUM field in the ‘ID’ record must match DI_CHECKSUM in the DI record. |
DS_NAME |
Name of the associated DS. |
ENTRY_NAME |
Name of an object that uniquely identifies it. |
ENTRY_TYPE |
Identifies the type of object. Used as the Record ID. |
GS_CHECKSUM |
Checksum for a GS. |
ID_NAME |
Name of the associated ID. |
INDEX_TYPE |
The type of DI. The usual value is RAM. |
LINE_NUMBER |
Line number in a text object. |
LINE_TEXT |
Text in a text object. |
NO_DOMAINS |
Number of domains in the DI or ID. |
SAVE_STATUS |
Indicates if the object can be run under the current version of ACCENT R |
SD_CHECKSUM |
The checksum for a SD. The SD_CHECKSUM field in the DS record should be identical to the SD_CHECKSUM for the associated SD record and DI record. |
SD_FORM and SD_FORM_INDEX Table |
Identifies the type of FORM statement used in a SD. Valid values for SD_FORM and SD_FORM_INDEX are shown below: |
|||
SD_FORM_INDEX |
SD_FORM |
|||
1 |
ASCII |
|||
SD_NAME |
Identifies the SD that is associated with the DS, DI, or ID. |
|||
STATIC |
Tells whether the DI has been defined as STATIC. Possible values are "YES" or "NO". |
|||
SAVE_STATUS |
Returns TOO NEW if the object was saved under a later version that is not compatible with the current version. Returns TOO OLD if the object was saved under an earlier version that is not compatible with the current version. Returns YES if the object is compatible with the current version. |
|||
TOTAL_CHARS |
The size of the DS in 8-bit ASCII characters, as recorded in the DBL. |
|||
TOTAL_REC |
The number of records in the DS not including those deleted in place. |
|||
TOTAL_SIZE |
Size of a GS in 8-bit bytes. |
Any available information about the entry can be accessed by specifying the appropriate field name in a PM statement. Values can only be read; they cannot be manipulated or changed.
GET FROM designator {FIRST /DBL/ ENTRY [entry_type]; NEXT /DBL/ ENTRY [entry_type]} [HUSH] [IF; UNLESS clause]
FIRST /DBL/ ENTRY |
causes ACCENT R to retrieve the first DBL entry. If entry_type is specified, ACCENT R retrieves the first entry with the specified type. |
NEXT /DBL/ ENTRY |
causes ACCENT R to sequentially retrieve the next DBL entry. If entry_type is specified, ACCENT R retrieves the next entry with the specified type. If a previous GET has not been executed, GET FIRST /DBL/ ENTRY [entry_type] is performed. |
[entry_type] |
can be CF, CM, CS, DBL, DI, DS, FS, GS, PM, SD, SF, or SI. |
GET FROM designator /DBL/ ENTRY entry_type entry_name [HUSH]
[IF; UNLESS clause]
The form of the DBL GET statement is used to retrieve a specifically name entry by entry type.
/DBL/ENTRY entry_name |
the entry_name may contain literals, constants, fields, expressions, or functions, as long as they evaluate to a character value. If the object name has the default extension (.DBL, .DS, .DI, or .CF), the extension must not be expressed. Extensions other than the default must be expressed. |
entry_type |
can be CM, DBL, DI, DS, FS, GS, PM, SD, SF, or SI. |
GET FROM DB DBL ENTRY CM INVOICE_PROCESSING HUSH
GET FROM designator {FIRST /DBL/ TEXT; NEXT /DBL/ TEXT} [HUSH]
[IF; UNLESS clause]
FIRST /DBL/ TEXT |
causes ACCENT R to retrieve the first line of text in the current Data Base Library (DBL) entry. This option is only valid if a DBL entry has been retrieved using the GET statement with a DBL entry retrieval option (see forms 1 and 2). FIRST TEXT fails if text is not associated with the current DBL entry. |
NEXT /DBL/ TEXT |
causes ACCENT R to sequentially retrieve the next line of text. If no previous reference has been made to text for the current DBL entry, a GET FIRST TEXT is performed. |