Presentation is loading. Please wait.

Presentation is loading. Please wait.

Datacom An Introduction. What is Datacom?  Datacom is a Database Manager developed by Computer Associates for MVS  Data is stored in the form of databases,

Similar presentations


Presentation on theme: "Datacom An Introduction. What is Datacom?  Datacom is a Database Manager developed by Computer Associates for MVS  Data is stored in the form of databases,"— Presentation transcript:

1 Datacom An Introduction

2 What is Datacom?  Datacom is a Database Manager developed by Computer Associates for MVS  Data is stored in the form of databases, which can have one or more keys  Access is through ‘embedded” datacom calls in high level languages, or through dataquery

3 Datacom  This is NOT a Relational Database Manager or even a sophisticated database manager  This is a filing system, for better organization of data  It has the basic features of a filing system - keys, indexes etc.  It has locking features, to prevent “lost updates”  It does not have features such as referential integrity

4 Databases  Databases are known by a user name E.g. FED-PROFILE  Internally, in the system, they are referred to by a 3 character id E.g. F11  It is important to remember the 3-character ID - that is how datacom knows this database

5 Database structure  Each database consists of records (Rows)  Each Record has Fields (Columns)  One or more fields can combine in several ways to form several keys  There is no concept of a primary key or alternate keys - all keys are “on par”

6 Datacom with COBOL  The structure (definition) of the databases used must be declared in the program  This is done by a “COPYDD” statement, which “embeds” a COBOL declaration of the database structure  The embedded item may be a view, defined with a particular structure, and a key, for a specific purpose

7 COPYDD  The COPYDD statement looks like 01 A01A0 COPYDD COMPANY.A01A0(PROD),2,N.  The first item is the required level of the structure  The next item is the group name u If this is left blank, the default name is taken  Then next is the dataview to be used  A pattern can be given here, to prefix all elements 01 *R2- COPYDD FED-PROFILE.A13A0(PROD),2,N.  In this case, all elements will have a R2- prefix

8 Passing values  The next step is to fill up the desired values to the call interface  The interface consists of u User ID u Request area u The “embedded” structure u The element list

9 Calling interface  The user id is either the ID of the User, or that of the program ID u These Ids need to be authorized by the database Admin, for accessing this database  The request area contains u The command name (Commands are in a later slide) u The name of the file - 3 characters u The name of the KEY used u The value(s) of the LOW key (mandatory), and High key (if applicable)

10 The DB Call  The database access call is in the form of the following command CALL ‘DBNTRY’USING USER-ID F11-REQ-AREA F11F0 F11-ELEMENT-LIST

11 An example

12 Declaration 01 USER-ID. 05 PROGRAM-NAMEPIC X(08) VALUE 'ICS3000 '. 05 FILLERPIC X(24) VALUE SPACES. 01 A20-REQ-AREA. 05 A20-REQ-COMMANDPIC X(05) VALUE SPACES. 05 A20-REQ-FILENAMEPIC X(03) VALUE 'A20'. 05 A20-REQ-KEYNAMEPIC X(05) VALUE SPACES. 05 A20-REQ-RETURNCDPIC X(02) VALUE SPACES. 05 A20-REQ-DBIDPIC X(02) VALUE SPACES. 05 A20-REQ-REC-IDPIC X(07). 05 A20-REQ-KEY-VALUEPIC X(180).

13 Declaration 01 A20-WORK-AREA. 05 A20-WORK-AREA-0PIC X(274). 05 A20-WORK-AREA-6PIC X(300). 01 A20-ELEMENT-LIST. 05 A20-ELM-1PIC X(05) VALUE 'A20A0'. 05 FILLERPIC X(01). 05 A20-ELM-2PIC X(05) VALUE 'A20A6'. 05 FILLERPIC X(01). 05 FILLERPIC X(05) VALUE SPACES.

14 Declaration 01 A20A0-A20A6. 03 A20A0 COPYDD BRANCH.A20A0(PROD),2,N. 03 A20A6 COPYDD BRANCH.A20A6(PROD),2,N. 01 *BILL- COPYDD BRANCH.A20A0(PROD),2,N.

15 Assigning values MOVE WS-NEXT-KBRANCHCDTO A20-REQ-KEY-VALUE. MOVE 'BRNCH’TO A20-REQ-KEYNAME. MOVE 'REDKY’TO A20-REQ-COMMAND. MOVE A20-REQ-AREATO LKBO099-DB-REQ-AREA. Here, the command name is “REDKY” - read key exact The keyname used is BRNCH, and the value of the key comes from the WORKING-STORAGE variable

16 The DB Call CALL 'DBNTRY’ USING USER-ID A20-REQ-AREA A20-WORK-AREA A20-ELEMENT-LIST. Thus the data required for the DB call is filled up, and the database access is completed.

17 Datacom Commands CommandDescription ABENDAbnormal Termination Command ADDITAdd Record CLOSEClose User Requirements Table CNTKRCount For Key Value Range CNTKYCount For Equal Key Value CNTTBCount For Table COMITCommit Transaction

18 Datacom Commands CommandDescription DELETDelete Record GETITRetrieve Next Sequential Record GETPSGet Next Physical Sequential Record GSETLSet To Starting Key GSETPSet Physical Sequential Record INQINInquire CA

19 Datacom Commands CommandDescription LOCBRLocate Backwards LOCKGLocate Key Equal Or Higher LOCKITest For Logical Intersections Of Two Keys LOCKLLocate Key Equal Or Lower LOCKRLocate a Record in a Specified Range LOCKXLocate Key Exact LOCKYLocate Key Equal Or Higher

20 Datacom Commands CommandDescription LOCNELocate Next Equal Key Value LOCNKLocate Next Key LOCNRLocate Next Record in Specified Range LOCNXLocate Next LOGCPCheckpoint the Task LOGCRLog Checkpoint With Release LOGDRLog Directed Read LOGDWLog Directed Write

21 Datacom Commands CommandDescription LOGITAdd Data To Log Area LOGLBRead Back a LOGIT Record LOGTBBack Out Transactions NOOPSNo Operation OPENOpen User Requirements Table

22 Datacom Commands CommandDescription REDBR/RDUBRRead Backwards REDID/RDUIDRead Record By Id REDKG/RDUKGRead Record Greater Than / EqualTo Key REDKL/RDUKLRead Record Less Than / Equal To Key REDKR/RDUKRRead Record in a Specified Range

23 Datacom Commands CommandDescription REDKX/RDUKXRead Key Exact REDKY/RDUKYRead Key Exact REDLE/RDULERead Located Entry REDNE/RDUNERead Next Equal Key Value REDNK/RDUNKRead Record With the Next Sequential Key Value REDNR/RDUNRRead the Next Record in a Specified Range

24 Datacom Commands CommandDescription REDNX/RDUNXRead Next RELESRelease Record RELFLRelease Table ROLBKRollback Transaction SELCNContinue Set Record Selection SELFRSelect Set And Return First Record SELNRSelect Next Record

25 Datacom Commands CommandDescription SELPRRelease Set SELSMSelect Same Record SELSTStop Set Record Selection TESTTest Option Command UPDATUpdate Record

26 Dataquery

27 What is Dataquery?  Dataquery is a query tool to access the contents of the databases directly  It uses a language called dataquery language (DQL)  Structured Query Language (SQL) is also supported.

28 Dataquery  Dataquery runs as an application under CICS  It has a menu-driven interface  It allows creating / modifying queries, viewing public queries etc.  It also allows query execution in batch, by setting up a JCL header and an environment

29 Components  The components of a query are u The VERB (FIND, ERASE etc.) u The Database / dataview name u The condition(s) (WHERE clause) u The columns to be included in the output, with column titles if required u The title for the overall query

30 Query creation / execution  You can create a new query / edit an existing query  The query editor will show up  You can enter the qurery data and press PF4 to save it  It you are editing an existing query, press PF9 to save it  PF3 is for execution, PF2 is EXIT

31 An Example FIND AGY-DISB-MTHD-2 WHERE N-A-CODE-SFX = '3102' PRINT YEAR N-A-CODE-SFX 'N&A' PROFILE-DISB 'PD' TITLE “Agency Disbursement Methods” This query has a database name, condition, fields to be printed, and headings for those fields. There is also an overall title for the query results


Download ppt "Datacom An Introduction. What is Datacom?  Datacom is a Database Manager developed by Computer Associates for MVS  Data is stored in the form of databases,"

Similar presentations


Ads by Google