49
1 December, 2003 DATACOM DATACOM VIJAYKUMAR.R

Datacom Presentation

  • Upload
    suzeet

  • View
    346

  • Download
    24

Embed Size (px)

Citation preview

Page 1: Datacom Presentation

1December, 2003 DATACOM

DATACOM

VIJAYKUMAR.R

Page 2: Datacom Presentation

2December, 2003 DATACOM

DATACOMDatabases: A CA-Datacom/DB information base can include up

To 5,000 databases. Each database consists of an Index Area

and 1 to 240 data areas.

Data Areas:

A data area provides the physical storage for data tables. A database can

have multiple data areas. Each data area can support 1 to 240 tables, but

a database is limited to 240 tables as well. Every data area is a data set

or file. You can assign several tables to the same area or each table to a

separate area.Placing multiple tables in the same area can increase

Processing speed when Applications normally access the tables together

with the same key.

Page 3: Datacom Presentation

3December, 2003 DATACOM

Datacom Contd.,

Index Area (IXX): The Index Area provides fast access to the data. Eachdatabase contains one Index Area which provides accessibility to all data areas within that database. The index allows any table in the database to be retrieved based on the contents of the table. CA-Datacom/DB places an entry in the index for each key within each table in the database.

Tables: All data is stored in tables. Tables are two-dimensional, logically made up of rows (records) and columns (fields). Tables are easily extendable with the addition of both rows and columns.

Columns: Columns are the smallest data structures in the Information base. For SQL access, columns are the unit of transfer between the database and the application program. Through Data dictionary, columns Are defined using the FIELD entity-type.

Page 4: Datacom Presentation

4December, 2003 DATACOM

Elements: For access with CA-Datacom/DB commands, columns make up elements and elements are the unit of transfer. You can define 255 elements per table.

Keys: Keys are structures used to optimize data access or order data Retrieval. A key is composed of columns. The columns can be in anysequence. Each key can be up to 180 characters long.

You can define up to 99 keys per table or 999 per database. Any key can be defined as unique, that is, requiring that each row in the table have aunique value for the key.

All tables must have a Master Key and a Native Key defined. The Master Key functions as any other key but it can be defined as updateable or non-updateable. The Native Key dictates the physical sequence in which the

data is stored. The Native Key can be the same as the Master Key.

Page 5: Datacom Presentation

5December, 2003 DATACOM

Master Key : Every table must have a Master Key. A table's Master Key

may be The same as its Native Key.

There is method of preventing duplicate values in Master key. This

method involves the TABLE attribute DUPE-MASTER-KEY which

specifies whether duplicate values are permitted in the Master Key.

This option differs from the KEY attribute UNIQUE in the following ways:

DUPE-MASTER-KEY can only be defined through Datadictionary.

UNIQUE can be defined through Datadictionary or SQL.

It may only be specified for one key (the Master Key) per table. UNIQUE

may be specified for any number of keys.

Attempted violations to DUPE-MASTER-KEY receive CA-Datacom/DB

return code 10. Attempted violations to a UNIQUE KEY receive CA-

Datacom/DB return code 94 (internal return code 193).

Page 6: Datacom Presentation

6December, 2003 DATACOM

Native Key :

Every table must have one, and only one, Native Key. This

key designates the sequence in which the data is loaded and

maintained. Often used in sequential processing.

Dataviews:

Dataviews are special structures used by CA-Ideal and CA-Meta

COBOL+. Dataviews provide a logical view of the data. They can

be composed of elements or keys.

Page 7: Datacom Presentation

7December, 2003 DATACOM

Primary Keys:

Each table may have one primary key. A primary key provides a

guaranteed method of addressing each row in a table. The primary key

value for each row is unique within the table. Defining a primary key

through SQL results in a key with the UNIQUE attribute. The resulting key

is also that table's Master and Native Key, unless the primary key is being

added to an existing table which already has a (different) Master and

Native Key.

Foreign Keys:

Foreign keys define relationships between tables. The column(s) of a

foreign key in one table are related to the primary or unique key of some

table. Every foreign key is related to a primary or unique key. A primary

or unique key can be related to zero, one, or many foreign keys.

Page 8: Datacom Presentation

8December, 2003 DATACOM

• CA-Datacom/DB Modes of Operation :

CA-Datacom/DB has two modes of operation: Multi-User and

Single User. The recommended mode is Multi-User.

• Multi-User: The Multi-User mode enables CA-Datacom/DB to access a database concurrently from multiple regions. The Multi-User Facility is the manager of the system. It receives a request from the application and determines how it should be processed. It coordinates the activities that must take place to service the request.

• Single User: The Single User mode allows only one region to access a database.

Page 9: Datacom Presentation

9December, 2003 DATACOM

DBUTLTY: CA-Datacom/DB provides a single utility, the CA-Datacom/DB Utility (DBUTLTY), that performs all operations for creating and maintaining your information base. You invoke the functions by entering commands to the utility program. Eg

//UTLTY30 EXEC PGM=DBUTLTY,COND=(0,NE) //* ***********************************************************//* * UTLTY30 - DISABLE DATA BASE 168 - AGENT * //* *********************************************************** //CXX DD DSN=D1A.MUFI1.CXX, // DISP=SHR //SYSPRINT DD SYSOUT=* //SYSUDUMP DD SYSOUT=U, // HOLD=YES //ABNLTERM DD SYSOUT=* //SNAPER DD SYSOUT=* //LOCKDD DD DSN=K1C.KFS.DB168.DSLOCK, // DISP=OLD //SYSIN DD DSN=ASA.PPRD.ZKL.SYSIN(MTN168), // DISP=SHR //* //*

Page 10: Datacom Presentation

10December, 2003 DATACOM

To create a complete backup of a database using DBUTLTY, execute

the BACKUP DBID=n function with the control statement coded

SEQ=PHYSICAL, RECID=YES,UPDATE=YES. This safe backup can

only be done with the area not open for update by any application.

When you are backing up a table or area, suspend all update activity to it.

Page 11: Datacom Presentation

11December, 2003 DATACOM

Accessing CA-Datacom/DB Databases from Applications

Applications can access CA-Datacom/DB databases by including CA-datacom/DB commands or SQL statements in their code.

CA-Datacom/DB commands are included within a call to a CA-Datacom/DB entry point. These calls can be included in applications written in Assembler, C language, COBOL, FORTRAN, and PL/I. CA-Datacom/DB commands provide two access techniques: record-at-a-time (RAAT) and set-at-a-time (SAAT).

RAAT:

The record-at-a-time commands access data rows (records) and Index entries.The rows are selected by specifying a previously defined key name and a key value.

Page 12: Datacom Presentation

12December, 2003 DATACOM

RAAT:

The rows are retrieved in the sequence of the key, in either ascending or

descending order. A record with the exact, greater-than-or-equal, or less-than-or-

equal key value specified may be selected.

SAAT:

With the set-at-a-time access technique, a set of records is defined based on the

data values contained in a table. A set can be just one record, or an entire table.

Once a set has been defined, individual records within the set can be accessed.

Records contained in a set are selected by specifying a search condition. A

search condition is a compound Boolean expression composed of predicates

joined by the logical operators AND and OR.

Relational operators used in the search are : EQ, LT, GT, LE, GE, NE

Eg : VENDR-NAME EQ HCLT AND BR-PIN-CODE GE 600034

Page 13: Datacom Presentation

13December, 2003 DATACOM

Accessing CA-Datacom/DB Databases Using Other Computer Associates Products

CA-Ideal: CA-Ideal enables you to develop and maintain applications that can access CA-Datacom/DB databases. CA-Ideal passes CA-Datacom/DB commands to the CA-Datacom/DB entry point. It uses both record-at-a-time and set-at-a-time access techniques. CA-Ideal also offers you the option of using SQL statements within your CA-Ideal programs. CA-Dataquery: CA-Dataquery is an information retrieval and data manipulation facility. It allows end users to create queries that retrieve information from a CA-Datacom/DB database. CA-Dataquery can access CA-Datacom/DB using CA-Datacom/DB commands or SQL statements. CA-Dataquery also provides a Personal Database Facility which allows users to create and maintain personal tables.

Page 14: Datacom Presentation

14December, 2003 DATACOM

Creating Databases

Each CA-Datacom/DB database can contain from 1 to 240 tables.

Information stored in one database is independent of that in other databases.

Information in the same database is indexed in the same Index Area

(IXX).Therefore, a disk error on the Index Area affects all tables in the

database.

It is best to use a separate database for data that is relatively unrelated.

For example, use separate databases for:

• Independent application systems, such as accounts payable, general ledger, or inventory.

• Information about independent subjects, such as customer information, inventory information or accounting information.

Page 15: Datacom Presentation

15December, 2003 DATACOM

The steps required for creating CA-Datacom/DB databases are:

• Design the logical structure for the databases.

• Design the physical attributes for the databases.

• Use Datadictionary to define the databases, areas, tables, columns, keys and

elements.

• Catalog the definitions to the CA-Datacom/DB Directory (CXX).

• Allocate and initialize the required data areas and Index Areas.

• Use programs or utilities to actually load data in the tables.

Page 16: Datacom Presentation

17December, 2003 DATACOM

Designing Columns

A column (FIELD occurrence) is the smallest data

structure in CA-Datacom/DB. You must define at least

one column to a table.You can define up to 500

columns to a single table.

Page 17: Datacom Presentation

18December, 2003 DATACOM

Data Types DATE, TIME, and TIMESTAMP

• DATE, TIME, and TIMESTAMP are special SQL data types that are stored and manipulated in CA-Datacom/DB as binary data with lengths 4, 3, and 10 respectively.

• In COBOL, the data type of the host variable to receive or send a DATE, TIME or TIMESTAMP must be CHARACTER.

• The internal formats for the three types are:

DATE CCYYMMDD

TIME HHMMSS

TIMESTAMP CCYYMMDDHHMMSSNNNNNN

Page 18: Datacom Presentation

19December, 2003 DATACOM

Where Represents CC Century YY Year MM Month DD Day HH Hour MM Minute SS Second NNNNNN Microseconds

Example :

05 WS-DATE PIC X(08) VALUE SPACES. 05 WS-TIME. 10 WS-HOUR PIC XX VALUE SPACES. 10 WS-MINUTE PIC XX VALUE SPACES. 10 WS-SECOND PIC XX VALUE SPACES.

Page 19: Datacom Presentation

Columns Accepting Null Values

When a column is defined to accept null values, CA-Datacom/DB places a value in the null indicator for the column when an application adds a row to the table without supplying a value for the column.

Nil Values: A null is not a nil value. A nil value is a character blank (X'40') or a binary zero (X'00'), which CA-Datacom/DB treats as non-null values. The KEY attribute INCLUDE-NIL-KEY determines whether CA-Datacom/DB indexes rows with nil values for the key. A key has a nil value when all of the columns in it have the same nil value.

Page 20: Datacom Presentation

21December, 2003 DATACOM

How to Define Columns to Be Unique? • Specifying that a column (or group of columns) be unique ensures

that each value in the column exists only once in the table.

• To be defined as unique, a column or group of columns must not exceed 180 bytes in length.

To define a column as unique, define a single-column key, specifying:

• Yes for the KEY attribute UNIQUE

• Yes for the KEY attribute INCLUDE-NIL-KEY

• No for the FIELD attribute NULL-INDICATOR

Page 21: Datacom Presentation

22December, 2003 DATACOM

When an application attempts to add a row containing a

duplicate value for a column or columns defined as

unique, CA-Datacom/DB does not immediately reject

the add if the existing row is not committed. If the value

is committed as present, CA-Datacom/DB aborts the

row add and issues the CA-Datacom/DB return code 94

(internal return code 193). If the value is committed as

absent, the add continues.

Page 22: Datacom Presentation

23December, 2003 DATACOM

Inserting and Accessing RecordsThe value of the key column MUST be provided during an insert for CA-Datacom/DB to correctly place the new record.CA-Datacom/DB takes the value and manipulates it to obtain the block number where the record should go. This block is read and CA-Datacom/DB indexes into the block to the correct physical location. If the space has no RCE(Record Control Element which is 4bytes long), the record is added. If an RCE exists, the add fails with a duplicate unique

key. The first two bytes of the RCE must be the length of the data record. The third byte of the RCE must be the binary table ID. The last byte in the RCE must be a binary zero.

The key value presented is converted into a block number and record within block. This block is read and CA-Datacom/DB positions to the record. If no RCE is found, the return code is 14.

Page 23: Datacom Presentation

24December, 2003 DATACOM

CA-Datacom/DB Return Codes

CA-Datacom/DB passes a return code to the Request Area of a program in response to the program issuing a CA-Datacom/DB command. CA-Datacom/DB also issues return codes within CA-Datacom/DB messages.

A return code of blanks indicates successful processing of the command. A non-blank return code indicates an error . All non-blank return codes have one or more associated internal return codes.

Page 24: Datacom Presentation

25December, 2003 DATACOM

Example :

10 AFB-REQ-RETURN-CODE PIC X(002) VALUE SPACE.

88 AFB-GOOD-RETURN VALUE SPACE.

88 AFB-TABLE-NOT-OPEN VALUE '05'.

88 AFB-TABLE-NOT-OPEN-4-UPDATE VALUE '06'.

88 AFB-DATA-AREA-FULL VALUE '07'.

88 AFB-INDEX-FULL VALUE '08'.

88 AFB-PREREQUISTE-NOT-FOUND VALUE '09'.

88 AFB-DUP-MASTER-KEY-NOT-ALLWD VALUE '10'.

88 AFB-MASTER-KEY-MOD-UPT-REJ VALUE '11'.

88 AFB-RECORD-NOT-FOUND VALUE '14'.

88 AFB-EXCLUSIVE-CNTL-DUPLICATE VALUE '18'.

88 AFB-END-OF-FILE VALUE '19'.

88 AFB-ELEMENT-NAME-NOT-FOUND VALUE '22'.

88 AFB-ELEMENT-SECURITY-CD-VIOL VALUE '23'.

Page 25: Datacom Presentation

26December, 2003 DATACOM

Steps used to retrieve data from CA-Datacom/DB in an Appln program:

• Establishes communications with CA-Datacom/DB using a User Requirements Table.

• Issues CA-Datacom/DB requests using the Call Stmt and checks the result.

• Terminates communications with CA-Datacom/DB.

User Requirements Tables : • A User Requirements Table controls the features at the program level.

• Defines which CA-Datacom/DB tables can be accessed/updated by CA-

Datacom/DB commands .

• It specifies what resources are necessary for the successful execution

of a program, including additional resources the program can need,

such as extra buffer allocations.

Page 26: Datacom Presentation

27December, 2003 DATACOM

Access Using a User Requirements Table

The User Requirements Table is generated by a macro assembly and is either link-edited with your program or dynamically loaded at execution time. It contains an entry for each CA-Datacom/DB table your program Accesses. The User Requirements Table must be opened before your program requests access to CA-Datacom/DB tables, and closed after all requests have been made.

You can specify in the User Requirements Table that CA-Datacom/DB open the User Requirements Table before control is passed to your program, and close the User Requirements Table when your program returns control to CA-Datacom/DB. Alternately, your program can open and close the User Requirements Table itself by issuing OPEN and CLOSE commands.

Page 27: Datacom Presentation

28December, 2003 DATACOM

Eg..

//CSTMTL76 EXEC PGM=K1CSTMTL,PARM='DBURT=K1CSTMU1‘, COND=(0,NE)

//*

//TOC DD DSN=K1C.KFS.K1CSTMTS.K1CTOC2N,

// DISP=SHR

//SPX DD DSN=K1C.KFS.K1CSTMTS.K1CPRT2N,

// DISP=SHR

//*

//LASER DD DSN=K1C.KFS.PRINTW.K1CSTMTL.K1CSTM02,

// DISP=(NEW,CATLG,DELETE),

// UNIT=PRDPK,SPACE=(TRK,(2250,150),RLSE),

// DCB=(RECFM=FBA,LRECL=255,BLKSIZE=0)

//*

Page 28: Datacom Presentation

Entry Macro (DBURTBL)A DBURTBL macro is required for each CA-Datacom/DB table to be accessed by CA-Datacom/DB commands.

Example: DBURTBL X

ACCESS=RAN, X

AUTODXC=YES, X

BYPOPEN=NO, X

DBID=&POLICY, X

ELMCHG=NO, X

GBMAXR=255, X

GETBLK=15000, X

SEQBUFS=00, X

SYNONYM=NO, X

TBLNAM=AGT, X

UPDATE=NO

EJECT

Page 29: Datacom Presentation

30December, 2003 DATACOM

BYPOPEN=value

Indicates the processing of the table specified in the TBLNAM=parameter during

User Requirements Table open and close processing,as follows:

BYOPEN=NO means the table specified in the TBLNAM parameter Is not

bypassed.

BYOPEN=YES means the table specified in the TBLNAM parameter Is bypassed

during open and close processing.

Valid Entries: NO or YES

Default Value: NO

Page 30: Datacom Presentation

31December, 2003 DATACOM

AUTODXC=value

Valid Entries: NO or YES

Default Value: YES

AUTODXC=No means ,Do not automatically drop exclusive control.

If NO is specified and the record is not updated or deleted, the program

must release exclusive control.

AUTODXC=Yes means, Automatically drop exclusive control established

by the previous command from the same Request Area.

-------------------------------------------------------------------------------------------------

ACCESS= RANStarting with Version 8.1, this parameter was no longer required.

Page 31: Datacom Presentation

32December, 2003 DATACOM

UPDATE= value

Valid Entries: NO or YES

Default Value: NO

UPDATE=No means, The program cannot update this table and cannot

hold the rows under exclusive control.

UPDATE=No means, The program can update this table and can hold

the rows under exclusive control.

Page 32: Datacom Presentation

33December, 2003 DATACOM

Start Macro (DBURSTR)

Eg

DBURSTR ABEND=YES, YES, NO X CSECT=KFBATCH, DBURTRR X MSTNAM=DBSULST, NO DEFAULT) X MULTUSE=YES, YES, NO X PRTY=7, 7 X PXXAREA=NO, YES, NO X

TXNUNDO=NO, YES, NO X

WRITE=NO YES, NO EJECT**************************************************************

PRTY= 7 (default)This parameter establishes the priority for all CA-Datacom/DB requests issued by the program after the User Requirements Table is opened.

Valid Entries: Integer value from 1 through 15

Page 33: Datacom Presentation

34December, 2003 DATACOM

TXNUNDO=value

Valid Entries: NO or YES

Default Value: NO

If the value is Yes means the transaction backout option is in effect

for all update transactions against all the tables declared in this

User Requirements Table.

If TXNUNDO=No, it Specifies transaction backout is not

operational.

Page 34: Datacom Presentation

35December, 2003 DATACOM

End Macro (DBUREND)

Code one DBUREND macro per User Requirements Generation

Macro set.

Example :

DBUREND X

SYSTEM=OS, X

USRINFO=KFBATCH

CSECT

DC CL50'L1ABATU193/03/0111:04:0698/06/16NONE 0000100001'

END

Page 35: Datacom Presentation

Issuing Requests

CA-Datacom/DB services are requested through the call facility of the particular language you are using. The entry point DBNTRY should be called with the following parameters:

• User Information Block (required)

• Request Area (required)

• Work Area (optional)

• Element List (optional)

• Request Qualification Area (optional)

SYNTAXCALL 'DBNTRY' USING USER-INFO

REQUEST-AREA

I/O WORK AREA

ELEMENT-LIST.

Page 36: Datacom Presentation

37December, 2003 DATACOM

In a COBOL-Datacom program, ENTRY statement is the first one

Following procedure division.

Example:

PROCEDURE DIVISION.

ENTRY 'DBMSCBL'.

EJECT

0000-MAINLINE.

The default entry point called by CA-Datacom/DB is DBMSCBL.

CA-Datacom/DB transfers control to DBMSCBL after opening the

User Requirements Table. An alternate name can be specified

with the USRNTRY=name parameter.

Page 37: Datacom Presentation

38December, 2003 DATACOM

CALL STATEMENT

Example :

CALL 'DBNTRY' USING AFB-USER-INFO

AFB-REQUEST-AREA

I-AFB-TABLE

AFB-ELEMENT-LIST.

User Information Block is a 32-byte required area, which can be used to

identify the requestor of CA-Datacom/DB services. CA-Datacom/DB

does not require that any particular information be placed in this area, but

it is suggested that the program name be placed in the first eight

characters to aid in problem determination.

05 AFB-USER-INFO PIC X(032) VALUE 'K1CFINUP'.

Page 38: Datacom Presentation

39December, 2003 DATACOM

CALL Syntax for Languages Other Than COBOL

Assembler uses a CALL macro, while PL/I and FORTRAN use a CALL statement.

Using the DBNTRY entry point, provide the appropriate User Information Block, the

Request Area address, the work area address, the element list address, and the

Request Qualification Area address in the call.

• Assembler Format

CALL DBNTRY,(userinfo,reqarea,wrkarea,elmlst,qualarea)

• PL/I Format

CALL DBNTRY(userinfo,reqarea,wrkarea,elmlst,qualarea)

DECLARE DBNTRY ENTRY OPTIONS(ASSEMBLER)

• FORTRAN Format

CALL DBNTRY(userinfo,reqarea,wrkarea,elmlst,qualarea)

Page 39: Datacom Presentation

40December, 2003 DATACOM

Request Area

Required area is used to specify requests made to CA-Datacom/DB, and

then test the results.

You may even use more than one Request Area for the same table. For

example, one Request Area might be used to sequentially read an

employee table, and another to read the employee record for each

employee's manager.

The Request Area minimum length is 76-characters. Depending on the

command used, it is followed by one or two key value areas, which can be

from 1 to 180 characters long each.

Page 40: Datacom Presentation

41December, 2003 DATACOM

05 AFB-REQUEST-AREA.

10 AFB-REQ-COMMAND PIC X(005).

10 AFB-REQ-TABLE-NAME PIC X(003) VALUE 'AFB'.

10 AFB-REQ-KEY-NAME PIC X(005) VALUE 'AFBK0'.

10 AFB-REQ-RETURN-CODE PIC X(002) VALUE SPACE.

88 AFB-GOOD-RETURN VALUE SPACE.

88 AFB-RECORD-NOT-FOUND VALUE '14'.

88 AFB-END-OF-FILE VALUE '19'.

10 AFB-REQ-INTRNL-RTNCD PIC X(001).

10 AFB-REQ-DATABASE-ID PIC S9(004) COMP.

10 AFB-REQ-TABLE-ID PIC S9(004) COMP.

10 AFB-REQ-RECORD-ID PIC X(005).

10 FILLER PIC X(025).

10 AFB-REQ-COUNT-MAX PIC S9(004) COMP.

10 AFB-REQ-IO-COUNT PIC S9(004) COMP.

10 FILLER PIC X(022).

10 AFB-REQ-KEY-VALUE.

COPY AFBRK0. .

Page 41: Datacom Presentation

42December, 2003 DATACOM

Work Area

The work area is used with record update and add commands to pass the elements listed in the element list, in the order listed, to CA-Datacom/DB. The work area is also used, in conjunction with record retrieval commands, to receive those elements back from CA-Datacom/DB.This area must be large enough to accommodate the combined lengthof all the elements specified in the element list. If this area is too small, record retrieval commands overlay whatever follows this area.

Eg:01 I-AFB-TABLE.

COPY AFBTBL REPLACING ==:TAG:== BY ==I-AFB-==.

EJECT

Page 42: Datacom Presentation

Element List

The element list specifies which data elements are to be retrieved, updated or added.

Eg:

05 AFB-ELEMENT-LIST.

10 FILLER PIC X(005) VALUE 'AFBE0‘.

10 FILLER PIC X(006) VALUE SPACES.

Page 43: Datacom Presentation

44December, 2003 DATACOM

Command Code The 5-character command name specifying the operation to be

Performed.

ADDIT Adding records to a database .

CLOSE Closing User Requirements Table .

DELET Deleting records from a database.

GSETL Set to Starting Key(prerequisite command to GETIT).

GETIT Sequentially retrieving elements from a database.

OPEN Opening User Requirements Table.

RELES Releasing exclusive control of records.

UPDAT Modifying elements in a database.

COMIT Committing a transaction.

Page 44: Datacom Presentation

45December, 2003 DATACOM

Command Code UPDAT Modifying elements in a database.

REDKX/RDUKX Retrieving data elements from the database using the exact key value.

REDnn commands retrieve elements without exclusive control for

update. RDUnn commands retrieve elements with exclusive

control for update.

Page 45: Datacom Presentation

46December, 2003 DATACOM

ADDIT (Add Record)ADDIT inserts a record into a specified table

RETURN CODES:

Blanks THE COMMAND WAS SUCCESSFUL

05 TABLE NOT OPEN

07 DATA AREA FULL

10 DUPLICATE MASTER KEY NOT ALLOWED

08 INDEX FULL

DELET (Delete Record)

The DELET command deletes a record from a table and deletes all keys

associated with the record. DELET also releases exclusive control of the

record.

Page 46: Datacom Presentation

47December, 2003 DATACOM

Before a record can be deleted, two conditions must be met. The record must be read with exclusive control, and the table specified in this command must have been defined in the User Requirements Table as a table which may be updated.

GETIT (Retrieve Next Sequential Record)

In a batch environment, GETIT retrieves records sequentially from any table in a database, sequenced by any valid key name, starting with a key value greater than or equal to a specified key value. GETIT optionally obtains exclusive control of a record.The first GETIT for a table must be preceded by a GSETL command. GSETL retrieves no data. It specifies the table name, key name, and key value, obtaining positioning for subsequent sequential processing.

Return code 22 ELEMENT NAME NOT FOUND

Page 47: Datacom Presentation

48December, 2003 DATACOM

REDBR/RDUBR (Read Backwards)

REDBR and RDUBR return actual data elements from a database by reading the next record with the previous sequential entry in the index. RDUBR acquires exclusive control for update purposes. REDBR does not obtain exclusive control.

You identify the starting point at which to read backwards by issuing any LOCKX command or any REDKX/RDUKX command.

REDKG/RDUKG (Read Record Greater Than/Equal to Key)

The REDKG/RDUKG command enables you to obtain the first record in a table that has a key value in the index greater than or equal to the key value requested. RDUKG acquires exclusive control of the record for update purposes. REDKG does not obtain exclusive control.

Page 48: Datacom Presentation

49December, 2003 DATACOM

REDKL/RDUKL (Read Key Less Than or Equal to Key)

Use the REDKL/RDUKL command to obtain the first record in a table that has a

key value in the index less than or equal to the key value specified in the request.

RDUKL acquires exclusive control of the record for update purposes. REDKL

does not obtain exclusive control.

REDKR/RDUKR (Read Record in a Specified Range)

The REDKR/RDUKR command enables you to locate a record within a specified

key value range.RDUKR acquires exclusive control of the record for update

purposes. REDKR does not obtain exclusive control.

The beginning and ending key values of the range in a 360-byte key

Area has to be specified. REDKR/RDUKR uses these two values as boundaries

and locates the first record within the range.

Page 49: Datacom Presentation

50December, 2003 DATACOM

Random Retrieval with Exact Key Value

Command Used: REDKX/RDUKX The REDKX command can be used to retrieve elements of a single record if the exact key value is known. If the record is not found, the return code is set to 14. RDUKX acquires exclusive control of the record for update purposes. The exact full key value must be known to use this command.REDKY/RDUKY is equivalent to REDKX/RDUKX and function in the same way.

Read Next Equal Key Value

Commands Used: REDNE, RDUNE REDNE reads the next record with a key value equal to the key value specified.RDUNE reads for update the next record with an equal key value.