Previous Topic: Field DescriptionsNext Topic: Debugging Facility (DBUG)


DBTS Example - Simulating Program Logic

The logic of any program can be simulated through the DBTS Transaction. The following is a simple example using CA Datacom/DB Compound Boolean Selection commands. Since this example does not update the database, it can be performed with either DBTS or DBTX.

Problem

Design an application which displays the address of the employees living in a specified state, ordered by their city.

Solution

Our application uses the Select First Record (SELFR) command to build a set from the Personnel Master File (PMF). The records in this CA Datacom/DB table contain the Employee Data (EMDTA) element that contains the data we need to display. We specify set selection criteria to limit the set to those records with the state field equal to the specified state (for example, TX). We also identify the Order-By field as the city field.

We can use DBTS (or DBTX) to verify that our program logic works and that we have calculated the correct offset and length to identify the fields used in our set selection and order criteria.

Step 1

Enter the DBTS (or DBTX) transaction ID.

Step 2

CA Datacom CICS Services responds with the Main DBTS Panel. Fill in the appropriate fields as highlighted in the following:

                      CA Datacom CICS Services REQUEST UTILITY (C) 2011 CA, Inc. 

DB CMD: selfr  TABLE : pmf DBID: 00001      KEYNM:  ENTRY : DBNTRY AREA  :   CONVRS: N  REQUEST    ?????????????  ?????????????????????????????????????????  AREA       66666000666664400000000000000000000000000000000000000000  POS 000000 FFFFF000FFFFF0000000000000000000000000000000000000000000             0....+....1....+....2....+....3....+....4....+....5....+  KEY        ??????????????????????????????????????????????????      PF1=LEFT  VALUE      00000000000000000000000000000000000000000000000000      PF2=RIGHT  POS 000000 00000000000000000000000000000000000000000000000000      PF3=POS             0....+....1....+....2....+....3....+....4....+....      PF4=REQ AREA  WORK       ??????????????????????????????????????????????????      PF5=KEY AREA  AREA       00000000000000000000000000000000000000000000000000      PF6=RQA SEL  POS 000000 00000000000000000000000000000000000000000000000000      PF9=RQA O/P             0....+....1....+....2....+....3....+....4....+....  ELEMENT    emdta  LIST       444444444444444444444444444444444444444444444444444444444444444444  POS 000000 000000000000000000000000000000000000000000000000000000000000000000             0....+....1....+....2....+....3....+....4....+....5....+....6....+  RQA        ????????????????????????????????????????????????????????  AREA       00000000000000000000000000000000000000000000000000000000  POS 000000 00000000000000000000000000000000000000000000000000000000             0....+....1....+....2....+....3....+....4....+....5....+

Step 3

Press PF6 to display the Selection Section Panel and fill in the appropriate fields as highlighted in the following. Use the ERASE EOF key to eliminate extraneous question marks.

                                        ** NO RQA ESTABLISHED, READY TO INSERT**  S E L E C T I O N   S E C T I O N    TYPE    CNT      LTH   ----------------------------------------------------------------------------  RQA POS         OPERATOR    SUBJECT                   OBJECT     (ELEMENT TYPE)  ACT  SEQ  LOG RELS TYP SGN  SCOPE ELMNT SC OFFST LTH   TYP   ELMNT SC OFFST LTH   i             eq   c   n     e   emdta    0068 0002    v    ????? ?? ???? ????  I,D,C          (LITERAL) LTH 0002 TX

Step 4

Press Enter to record your entries on the Selection Section Panel, then press PF9 to display the Order-By and Parameter Section Panel. Fill in the appropriate fields on this panel, as highlighted in the following:

                                        ** NO ORDERBY SECTION FOUND IN RQA    **  O R D E R   B Y   S E C T I O N      TYPE    CNT      LTH    ACTION SEQ   RQA     ORDER      ELMNT SEC               DATA  SIGN/               POS     CODE TYPE  NAME  CDE  OFFSET LTH  TYPE  CODE    i                    a    e   emdta       0053 0015    c     n

Step 5

Press Enter to record your entries on the Order-By and Parameter Section Panel, then press PF3 to return to the Main DBTS panel. CA Datacom CICS Services transfers the Request Qualification Area information which you entered in the Selection Section and Order-By Section Panels into the Request Qualification Area of the Main Panel. (The Request Qualification Area is highlighted in the following.)

                      CA Datacom CICS Services REQUEST UTILITY   (c) 2011 CA, Inc  DB CMD: SELFR  TABLE : PMF DBID: 00001      KEYNM: ?????  ENTRY : DBNTRY AREA  :   CONVRS: N  REQUEST    SELFRPMF?????  ?????????????????????????????????????????  AREA       ECDCDDDC000004400000000000000000000000000000000000000000  POS 000000 25369746000000000100000000000000000000000000000000000000             0....+....1....+....2....+....3....+....4....+....5....+  KEY        ??????????????????????????????????????????????????      PF1=LEFT  VALUE      00000000000000000000000000000000000000000000000000      PF2=RIGHT  POS 000000 00000000000000000000000000000000000000000000000000      PF3=POS             0....+....1....+....2....+....3....+....4....+....      PF4=REQ AREA  WORK       ??????????????????????????????????????????????????      PF5=KEY AREA  AREA       00000000000000000000000000000000000000000000000000      PF6=RQA SEL  POS 000000 00000000000000000000000000000000000000000000000000      PF9=RQA O/P             0....+....1....+....2....+....3....+....4....+....  ELEMENT    EMDTA  LIST       CDCEC4444444444444444444444444444444444444444444444444444444444444  POS 000000 544310000000000000000000000000000000000000000000000000000000000000             0....+....1....+....2....+....3....+....4....+....5....+....6....+  RQA        00770002S001    V   ?EQCNEEMDTA?00680002V0002TXK00100018  AREA       FFFFFFFFEFFF4444E4440CDCDCCDCEC0FFFFFFFFEFFFFEEDFFFFFFFF  POS 000000 00770002200100005000058355544310006800025000237200100018             0....+....1....+....2....+....3....+....4....+....5....+

Step 6

Press Enter and CA Datacom CICS Services executes the SELFR command and displays the data returned by CA Datacom/DB. (The returned data is highlighted in the following.)

                      CA Datacom CICS Services REQUEST UTILITY   (c) 2011 CA, Inc  DB CMD: SELFR  TABLE : PMF DBID: 00001      KEYNM:       URT: 0001 RTN CDE:  ENTRY : DBNTRY AREA  :   CONVRS: N  MUF: 01 RECLN: 00080 SIO: 020  INT CDE:  REQUEST    SELFRPMF       ??????????S???????H???.?????H???????????&  AREA       ECDCDDDC44444440000000000E0000000C020400000C000000010105  POS 000000 25369746000000000102000A0200030008020B100008000108010400             0....+....1....+....2....+....3....+....4....+....5....+  KEY        ??????????PMF?DCU???ATLANTA        ???????????????      PF1=LEFT  VALUE      00A2000000DDC0CCE000CEDCDEC44444444000000000000000      PF2=RIGHT  POS 000000 00A90001017460434000133153100000000000000000000000      PF3=POS             0....+....1....+....2....+....3....+....4....+....      PF4=REQ AREA  WORK       00010BRATTON GEORGE          3600 GASTON AVE            PF5=KEY AREA  AREA       FFFFFCDCEEDD4CCDDCC4444444444FFFF4CCEEDD4CEC444444      PF6=RQA SEL  POS 000000 00010291336507569750000000000360007123650155000000      PF9=RQA O/P             0....+....1....+....2....+....3....+....4....+....  ELEMENT    EMDTA  LIST       CDCEC4444444444444444444444444444444444444444444444444444444444444  POS 000000 544310000000000000000000000000000000000000000000000000000000000000             0....+....1....+....2....+....3....+....4....+....5....+....6....+  RQA        00380001K00100018   AEEMDTA 00530015CN??????????????????  AREA       FFFFFFFFDFFFFFFFF444CCCDCEC4FFFFFFFFCD000000000000000000  POS 000000 00380001200100018000155443100053001535000000000000000000             0....+....1....+....2....+....3....+....4....+....5....+

Step 7

Press Enter and CA Datacom CICS Services executes the SELFR command and displays the data returned by CA Datacom/DB. (The returned data is highlighted in the following.)

                      CA Datacom CICS Services REQUEST UTILITY   (c) 2011 CA, Inc  DB CMD: SELFR  TABLE : PMF DBID: 00001      KEYNM:       URT: 0001 RTN CDE:  ENTRY : DBNTRY AREA  :   CONVRS: N  MUF: 01 RECLN: 00080 SIO: 000  INT CDE:  REQUEST    SELFRPMF       ??????????S???????????.?????H???????????&  AREA       ECDCDDDC44444440000000000E00000005020400000C000000010005  POS 000000 25369746000000000102000A0200030028020B100008000208010000             0....+....1....+....2....+....3....+....4....+....5....+  KEY        ??????????PMF?DCU???ATLANTA        ???????????????      PF1=LEFT  VALUE      00A2000000DDC0CCE000CEDCDEC44444444000000000000000      PF2=RIGHT  POS 000000 00A90002017460434000133153100000000000000000000000      PF3=POS             0....+....1....+....2....+....3....+....4....+....      PF4=REQ AREA  WORK       00010BRATTON GEORGE          3600 GASTON AVE            PF5=KEY AREA  AREA       FFFFFCDCEEDD4CCDDCC4444444444FFFF4CCEEDD4CEC444444      PF6=RQA SEL  POS 000000 00010291336507569750000000000360007123650155000000      PF9=RQA O/P             0....+....1....+....2....+....3....+....4....+....  ELEMENT    EMDTA  LIST       CDCEC4444444444444444444444444444444444444444444444444444444444444  POS 000000 544310000000000000000000000000000000000000000000000000000000000000             0....+....1....+....2....+....3....+....4....+....5....+....6....+  RQA        00380001K00100018   AEEMDTA 00530015CN??????????????????  AREA       FFFFFFFFDFFFFFFFF444CCCDCEC4FFFFFFFFCD000000000000000000  POS 000000 00380001200100018000155443100053001535000000000000000000             0....+....1....+....2....+....3....+....4....+....5....+

Step 8

Use PF1 and PF2 to scroll through the Work Area and examine the returned data.

Step 9

Change the command in the DB CMD field to SELNR to display the next record in the set, as highlighted in the following:

                      CA Datacom CICS Services REQUEST UTILITY   (c) 2011 CA, Inc  DB CMD: SELNR  TABLE : PMF DBID: 00001      KEYNM:       URT: 0001 RTN CDE:  14  ENTRY : DBNTRY AREA  :   CONVRS: N  MUF: 01 RECLN: 00000 SIO: 000  INT CDE: 117  REQUEST    SELNRPMF     14????????A?N?????????????????H????????????  AREA       ECDDDDDC44444FF70000000C0D00000007050100000C000000000000  POS 000000 25359746000001450102000105000300586176100008000408000000

Step 10

Press Enter and CA Datacom CICS Services executes the SELNR command and displays the data returned by CA Datacom/DB. The returned data is highlighted in the following.

                      CA Datacom CICS Services REQUEST UTILITY   (c) 2011 CA, Inc  DB CMD: SELNR  TABLE : PMF DBID: 00001      KEYNM:       URT: 0001 RTN CDE:  ENTRY : DBNTRY AREA  :   CONVRS: N  MUF: 01 RECLN: 00080 SIO: 000  INT CDE:  REQUEST    SELNRPMF       ??????????N?????????????????????????????&  AREA       ECDDDDDC44444440000000000D000000070205000000000000000005  POS 000000 25359746000000000102000D05000300580203100002000408000000             0....+....1....+....2....+....3....+....4....+....5....+  KEY        ??????????PMF?DCU???ATLANTA        ???????????????      PF1=LEFT  VALUE      00A2000000DDC0CCE000CEDCDEC44444444000000000000000      PF2=RIGHT  POS 000000 00A90004017460434000133153100000000000000000000000      PF3=POS             0....+....1....+....2....+....3....+....4....+....      PF4=REQ AREA  WORK       00013COURTNEY ELIZABETH      4225 STANFORD RD           PF5=KEY AREA  AREA       FFFFFCDEDEDCE4CDCECCCEC444444FFFF4EECDCDDC4DC44444      PF6=RQA SEL  POS 000000 00013364935580539912538000000422502315669409400000      PF9=RQA O/P             0....+....1....+....2....+....3....+....4....+....  ELEMENT    EMDTA  LIST       CDCEC4444444444444444444444444444444444444444444444444444444444444  POS 000000 544310000000000000000000000000000000000000000000000000000000000000             0....+....1....+....2....+....3....+....4....+....5....+....6....+  RQA        00380001K00100018   AEEMDTA 00530015CN??????????????????  AREA       FFFFFFFFDFFFFFFFF444CCCDCEC4FFFFFFFFCD000000000000000000  POS 000000 00380001200100018000155443100053001535000000000000000000             0....+....1....+....2....+....3....+....4....+....5....+

Step 11

Use PF1 and PF2 to scroll through the Work Area and examine the returned data.

Step 12

Repeat the procedure from Step 10 to view additional records in the set. After reaching the last record, CA Datacom/DB places a return code of 14 and an internal code of hexadecimal 75 in the Request Area as highlighted in the following:

                      CA Datacom CICS Services REQUEST UTILITY   (c) 2011 CA, Inc  DB CMD: SELNR  TABLE : PMF DBID: 00001      KEYNM:       URT: 0001 RTN CDE:  ENTRY : DBNTRY AREA  :   CONVRS: N  MUF: 01 RECLN: 00080 SIO: 000  INT CDE:  REQUEST    SELNRPMF     14??????????N?????????????????????????????&  AREA       ECDDDDDC4444FF00000000000D000000070205000000000000000005  POS 000000 25359746000000000102000D05000300580203100002000408000000             0....+....1....+....2....+....3....+....4....+....5....+

Step 13

When you are done, press Clear to exit DBTS (or DBTX).