COBOL TIPS #19
by
Shawn M. Gordon
President S.M.Gordon & Associates

Guess what? there is a new ANSI draft for COBOL that is available for review and comment. Unfortunately by the time you read this, it will be to late for you to get involved, I just found out about it in late May, and the deadline
is late June. This column is probably going to hit in September. However, here is some of the stuff that they is supposed to be in it;

* Object Orientation
* Standard Arithmetic
* Common exception processing
* Dynamic tables which expand as needed
* Bit and Boolean data types
* Compiler directives
* Free format source
* In-Line Comments
* INITIALIZE TO VALUE
* Support for multi-octet character sets
* Dynamic file assignment
* VALUE REPEATED for initialization of tables
* Partial word replacement
* Next COPY (without REPLACING)
* SET TO FALSE
* Table SORT

I know the one thing that I would really like to see put in, is a macro facility like HP implemented. That is really the one great thing that HP gave us in their COBOL. Speaking of HP and COBOL, I hear that SIGCOBOL gave HP a good talking to over the future of COBOL. I don’t know why, but we as COBOL programmers tend to get ignored, even though about 80% of the code out there is probably written in COBOL. Since SPL is dead, and Pascal seems to be dying, and C is a crummy business language, why doesn’t HP seem interested in giving us as robust an environment as possible? There is a ton of stuff on the 9000’s, even for COBOL, but that’s because the official HP COBOL on the 9000 is from MicroFocus.

I don’t think it is a viable answer for HP to tell us to go and use Acucobol or Microfocus, when we have so much time and code invested in them. Especially for us commercial developers that aren’t interested in paying run time royalties to another company for a 3GL. So make your voices heard, and let the ANSI committee and HP know how you feel and what you think. Let’s get the latest COBOL on the HP.

Ok, off the soapbox and on to the utility of the month. As I mentioned last month, I am going to give you a copy of a nifty little program I wrote that makes heavy use of the DBINFO intrinsic.

  1     $CONTROL USLINIT
  1.1    IDENTIFICATION DIVISION.
  1.2    PROGRAM-ID.   DBTINFO.
  1.3    AUTHOR.       SHAWN M.GORDON.
  1.4    DATE-WRITTEN. 11-13-92.
  1.5    DATE-COMPILED.
  1.6   *
  1.7    ENVIRONMENT DIVISION.
  1.8    CONFIGURATION SECTION.
  1.9    SOURCE-COMPUTER. HP-3000.
  2      OBJECT-COMPUTER. HP-3000.
  2.1   *
  2.2   *******************************************************
  2.3   *
  2.4   *    THIS PROGRAM WILL ACCEPT A BASE NAME AND DATA SET
  2.5   *   AND ITEM.  THE HELP FEATURES SHOW ALL SETS WITH OPTIONAL
  2.6   *   SORTS, AND ALL ITEMS WITH OPTIONAL SORTS.  IT WILL ALSO
  2.7   *   IDENTIFY WHAT SET'S CONTAIN AN ITEM.
  2.8   *
  2.9   * SHAWN M. GORDON
  3     *******************************************************
  3.1    INPUT-OUTPUT SECTION.
  3.2    FILE-CONTROL.
  3.3        SELECT TFILE  ASSIGN TO "DLFKS".
  3.4        SELECT SFILE  ASSIGN TO "SFILE".
  3.5    DATA DIVISION.
  3.6   *
  3.7    FILE SECTION.
  3.8
  3.9    FD TFILE
  4         RECORD CONTAINS 80 CHARACTERS.
  4.1    01 TFILE-RECORD            PIC X(80).
  4.2   *
  4.3    SD SFILE
  4.4       RECORD CONTAINS 80 CHARACTERS.
  4.5    01 SORT-LINE.
  4.6       03 SKEY1                PIC X(16).
  4.7       03                      PIC X(64).
  4.8   *
  4.9    WORKING-STORAGE SECTION.
  5     ******************************************************
  5.1    01 ERR                     PIC S9(04)   COMP  VALUE 0.
  5.2    01 S1                      PIC S9(04)   COMP  VALUE 0.
  5.3    01 EDIT-NUM                PIC ZZ,ZZ9.
  5.4   *
  5.5    01 H1.
  5.6       03                      PIC X     VALUE %33.
  5.7       03                      PIC X(03) VALUE '&dD'.
  5.8       03                      PIC X(17) VALUE "Data Set Name".
  5.9       03                      PIC X(05) VALUE 'Type'.
  6         03                      PIC X(11) VALUE "   Entries".
  6.1       03                      PIC X(11) VALUE "  Capacity".
  6.2       03                      PIC X     VALUE %33.
  6.3       03                      PIC X(03) VALUE '&d@'.
  6.4   *
  6.5    01 H2.
  6.6       03                      PIC X     VALUE %33.
  6.7       03                      PIC X(03) VALUE '&dD'.
  6.8       03                      PIC X(17) VALUE "Data Item Name".
  6.9       03                      PIC X(05) VALUE 'Type'.
  7         03                      PIC X(07) VALUE "Length".
  7.1       03                      PIC X(11) VALUE "Occurs".
  7.2       03                      PIC X     VALUE %33.
  7.3       03                      PIC X(03) VALUE '&d@'.
  7.4   *
  7.5    01 D1.
  7.6       03 D1-SET               PIC X(16) VALUE SPACES.
  7.7       03                      PIC X(03) VALUE SPACES.
  7.8       03 D1-TYPE              PIC X     VALUE SPACES.
  7.9       03                      PIC XX    VALUE SPACES.
  8         03 D1-ENTRIES           PIC ZZ,ZZZ,ZZ9.
  8.1       03                      PIC X     VALUE SPACES.
  8.2       03 D1-CAPACITY          PIC ZZ,ZZZ,ZZ9.
  8.3   *
  8.4    01 D2.
  8.5       03 D2-ITEM              PIC X(16) VALUE SPACES.
  8.6       03                      PIC X(03) VALUE SPACES.
  8.7       03 D2-TYPE              PIC X     VALUE SPACES.
  8.8       03                      PIC X(03) VALUE SPACES.
  8.9       03 D2-LEN               PIC Z,ZZ9.
  9         03                      PIC XX    VALUE SPACES.
  9.1       03 D2-OCCURS            PIC Z,ZZ9.
  9.2   *
  9.3    01 DATA-ITEM-TABLE.
  9.4       03 DT-ITEM              PIC S9(4) COMP OCCURS 1024.
  9.5   *
  9.6    01 DS-INFO.
  9.7       03 DS-SET               PIC  X(16)         VALUE SPACES.
  9.8       03 DS-TYPE              PIC  X(02)         VALUE SPACES.
  9.9       03 DS-WORD-LENGTH       PIC S9(04)   COMP  VALUE 0.
 10         03 DS-BLOCKING-FACTOR   PIC S9(04)   COMP  VALUE 0.
 10.1       03                      PIC S9(04)   COMP  VALUE 0.
 10.2       03                      PIC S9(04)   COMP  VALUE 0.
 10.3       03 DS-ENTRIES           PIC S9(09)   COMP  VALUE 0.
 10.4       03 DS-CAPACITY          PIC S9(09)   COMP  VALUE 0.
 10.5   *
 10.6    01 DI-INFO.
 10.7       03 DI-ITEM              PIC  X(16)         VALUE SPACES.
 10.8       03 DI-TYPE              PIC  X(02)         VALUE SPACES.
 10.9       03 DI-LEN               PIC S9(04)   COMP  VALUE 0.
 11         03 DI-OCCURS            PIC S9(04)   COMP  VALUE 0.
 11.1       03                      PIC S9(04)   COMP  VALUE 0.
 11.2       03                      PIC S9(04)   COMP  VALUE 0.
 11.3   *
 11.4    01 WS-DB-DATA-ITEM         PIC X(16)          VALUE SPACES.
 11.5    01 DS-NUMBER               PIC S9(04)   COMP.
 11.6    01 DS-ITEM                 PIC S9(4)    COMP  VALUE 0.
 11.7    01 DB-BASE-NAME.
 11.8       03                      PIC XX             VALUE SPACES.
 11.9       03 BASE-NAME            PIC X(24)          VALUE SPACES.
 12      01 DB-PASS-WORD            PIC X(16)          VALUE SPACES.
 12.1   *
 12.2     COPY  DBSTAT.
 12.3   *
 12.4   ********************************************
 12.5    PROCEDURE DIVISION.
 12.6    A1000-INIT.
 12.7        DISPLAY 'Begin run of DBTINFO at ' TIME-OF-DAY.
 12.8        DISPLAY 'Copyright 1992 S.M.Gordon & Associates'.
 12.9        DISPLAY 'Enter ?? for help at any prompt (almost)'.
 13          DISPLAY 'Enter ? for lists on sets and items'.
 13.1
 13.2    A1100-BASE.
 13.3        MOVE SPACES          TO DB-BASE-NAME.
 13.4        DISPLAY SPACES.
 13.5        DISPLAY 'Base name: ' NO ADVANCING.
 13.6        ACCEPT BASE-NAME FREE.
 13.7        IF BASE-NAME = SPACES
 13.8           DISPLAY SPACES
 13.9           DISPLAY 'End of DBTINFO at ' TIME-OF-DAY
 14             STOP RUN.
 14.1        IF BASE-NAME = '??'
 14.2           DISPLAY 'Enter TurboImage Base name or  to exit'
 14.3           GO TO A1100-BASE.
 14.4        INSPECT BASE-NAME TALLYING ERR FOR CHARACTERS BEFORE " ".
 14.5        MOVE ';'             TO BASE-NAME(ERR + 1:1).
 14.6
 14.7        DISPLAY 'Password: ' NO ADVANCING.
 14.8        ACCEPT DB-PASS-WORD FREE.
 14.9        IF DB-PASS-WORD = SPACES
 15             MOVE ';'          TO DB-PASS-WORD.
 15.1        INSPECT DB-PASS-WORD TALLYING ERR FOR CHARACTERS BEFORE " ".
 15.2        MOVE ';'             TO DB-PASS-WORD(ERR + 1:1).
 15.3
 15.4        DISPLAY 'Mode: ' NO ADVANCING.
 15.5        ACCEPT WS-DB-MODE FREE.
 15.6        IF WS-DB-MODE = 0
 15.7           MOVE 5            TO WS-DB-MODE.
 15.8
 15.9        CALL "DBOPEN" USING DB-BASE-NAME, DB-PASS-WORD,
 16                              WS-DB-MODE, DB-STATUS-AREA.
 16.1        IF NOT DB-CALL-OK
 16.2           CALL "DBEXPLAIN" USING DB-STATUS-AREA
 16.3           GO TO A1100-BASE.
 16.4    A1100-EXIT.  EXIT.
 16.5   *
 16.6    A1200-SET.
 16.7        DISPLAY 'Dataset: ' NO ADVANCING.
 16.8        ACCEPT WS-DB-DATA-SET FREE.
 16.9        IF WS-DB-DATA-SET = SPACES
 17             DISPLAY SPACES
 17.1           GO TO A1100-BASE.
 17.2        IF WS-DB-DATA-SET = "??"
 17.3           DISPLAY 'Enter a valid Dataset name, ? for a list of '
 17.4                   'available sets.'
 17.5           DISPLAY 'Enter ?S for sorted list or ?D for descending '
 17.6                   'sorted list'
 17.7           DISPLAY SPACES
 17.8           GO TO A1200-SET.
 17.9
 18          IF WS-DB-DATA-SET = "?"
 18.1           MOVE 1                TO DS-NUMBER
 18.2           DISPLAY SPACES
 18.3           DISPLAY H1
 18.4           MOVE 202              TO WS-DB-MODE
 18.5           CALL "DBINFO" USING DB-BASE-NAME, DS-NUMBER,
 18.6                               WS-DB-MODE, DB-STATUS-AREA, DS-INFO
 18.7           PERFORM UNTIL DB-CONDITION-WORD = -21
 18.8              MOVE DS-SET        TO D1-SET
 18.9              MOVE DS-TYPE       TO D1-TYPE
 19                MOVE DS-ENTRIES    TO D1-ENTRIES
 19.1              MOVE DS-CAPACITY   TO D1-CAPACITY
 19.2              DISPLAY D1
 19.3              ADD 1              TO DS-NUMBER
 19.4              CALL "DBINFO" USING DB-BASE-NAME, DS-NUMBER,
 19.5                               WS-DB-MODE, DB-STATUS-AREA, DS-INFO
 19.6           END-PERFORM
 19.7           DISPLAY SPACES
 19.8           GO TO A1200-SET.
 19.9
 20          IF WS-DB-DATA-SET = '?S' OR '?D'
 20.1           OPEN  OUTPUT  TFILE
 20.2           MOVE 1                TO DS-NUMBER
 20.3           DISPLAY SPACES
 20.4           DISPLAY H1
 20.5           MOVE 202              TO WS-DB-MODE
 20.6           CALL "DBINFO" USING DB-BASE-NAME, DS-NUMBER,
 20.7                               WS-DB-MODE, DB-STATUS-AREA, DS-INFO
 20.8           PERFORM UNTIL DB-CONDITION-WORD = -21
 20.9              MOVE DS-SET        TO D1-SET
 21                MOVE DS-TYPE       TO D1-TYPE
 21.1              MOVE DS-ENTRIES    TO D1-ENTRIES
 21.2              MOVE DS-CAPACITY   TO D1-CAPACITY
 21.3              WRITE TFILE-RECORD FROM D1
 21.4              ADD 1              TO DS-NUMBER
 21.5              CALL "DBINFO" USING DB-BASE-NAME, DS-NUMBER,
 21.6                               WS-DB-MODE, DB-STATUS-AREA, DS-INFO
 21.7           END-PERFORM
 21.8
 21.9           CLOSE  TFILE
 22             IF WS-DB-DATA-SET = "?S"
 22.1              SORT SFILE ON ASCENDING KEY SKEY1
 22.2                   USING TFILE GIVING TFILE
 22.3           ELSE
 22.4              SORT SFILE ON DESCENDING KEY SKEY1
 22.5                   USING TFILE GIVING TFILE
 22.6           END-IF
 22.7
 22.8           OPEN  INPUT  TFILE
 22.9           MOVE 0              TO ERR
 23             READ TFILE AT END MOVE 1 TO ERR END-READ
 23.1           PERFORM UNTIL ERR = 1
 23.2              DISPLAY TFILE-RECORD(1:50)
 23.3              READ TFILE AT END MOVE 1 TO ERR END-READ
 23.4           END-PERFORM
 23.5           CLOSE  TFILE
 23.6
 23.7           DISPLAY SPACES
 23.8           GO TO A1200-SET.
 23.9
 24          INSPECT WS-DB-DATA-SET TALLYING ERR FOR CHARACTERS BEFORE " ".
 24.1        MOVE ';'             TO WS-DB-DATA-SET(ERR + 1:1).
 24.2    A1200-EXIT.  EXIT.
 24.3   *
 24.4    A1300-ITEM.
 24.5        DISPLAY SPACES.
 24.6        DISPLAY 'Data Item: ' NO ADVANCING.
 24.7        ACCEPT WS-DB-DATA-ITEM FREE.
 24.8
 24.9        IF WS-DB-DATA-ITEM = SPACES
 25             GO TO A1200-SET.
 25.1
 25.2        IF WS-DB-DATA-ITEM = "??"
 25.3           DISPLAY "Enter data item name to get information on, or"
 25.4           DISPLAY "enter ? to get list of item, ?S to get sorted "
 25.5           DISPLAY "list or ?D for descending"
 25.6           GO TO A1300-ITEM.
 25.7
 25.8        IF WS-DB-DATA-ITEM(1:1) = "?"
 25.9           DISPLAY SPACES
 26             MOVE 104          TO WS-DB-MODE
 26.1           MOVE 1            TO S1
 26.2           INITIALIZE DATA-ITEM-TABLE
 26.3           CALL "DBINFO" USING DB-BASE-NAME, WS-DB-DATA-SET,
 26.4                         WS-DB-MODE, DB-STATUS-AREA, DATA-ITEM-TABLE
 26.5           IF NOT DB-CALL-OK
 26.6              CALL "DBEXPLAIN" USING DB-STATUS-AREA
 26.7              GO TO A1300-ITEM
 26.8           END-IF
 26.9           MOVE DT-ITEM(S1)  TO EDIT-NUM
 27             DISPLAY 'There are ' EDIT-NUM ' items in this dataset'
 27.1           DISPLAY H2
 27.2           ADD 1 TO S1
 27.3           MOVE 102          TO WS-DB-MODE.
 27.4
 27.5        IF WS-DB-DATA-ITEM = "?"
 27.6           PERFORM UNTIL DT-ITEM(S1) = 0
 27.7              CALL "DBINFO" USING DB-BASE-NAME, DT-ITEM(S1),
 27.8                            WS-DB-MODE, DB-STATUS-AREA, DI-INFO
 27.9              IF NOT DB-CALL-OK
 28                   CALL "DBEXPLAIN" USING DB-STATUS-AREA
 28.1              END-IF
 28.2              MOVE DI-ITEM   TO D2-ITEM
 28.3              MOVE DI-TYPE   TO D2-TYPE
 28.4              MOVE DI-LEN    TO D2-LEN
 28.5              MOVE DI-OCCURS TO D2-OCCURS
 28.6              DISPLAY D2
 28.7              ADD 1 TO S1
 28.8           END-PERFORM
 28.9           GO TO A1300-ITEM.
 29
 29.1        IF WS-DB-DATA-ITEM = '?S' OR '?D'
 29.2           OPEN  OUTPUT  TFILE
 29.3           PERFORM UNTIL DT-ITEM(S1) = 0
 29.4              CALL "DBINFO" USING DB-BASE-NAME, DT-ITEM(S1),
 29.5                            WS-DB-MODE, DB-STATUS-AREA, DI-INFO
 29.6              MOVE DI-ITEM       TO D2-ITEM
 29.7              MOVE DI-TYPE       TO D2-TYPE
 29.8              MOVE DI-LEN        TO D2-LEN
 29.9              MOVE DI-OCCURS     TO D2-OCCURS
 30                WRITE TFILE-RECORD FROM D2
 30.1              ADD 1              TO S1
 30.2           END-PERFORM
 30.3
 30.4           CLOSE  TFILE
 30.5           IF WS-DB-DATA-ITEM = "?S"
 30.6              SORT SFILE ON ASCENDING KEY SKEY1
 30.7                   USING TFILE GIVING TFILE
 30.8           ELSE
 30.9              SORT SFILE ON DESCENDING KEY SKEY1
 31                     USING TFILE GIVING TFILE
 31.1           END-IF
 31.2
 31.3           OPEN  INPUT  TFILE
 31.4           MOVE 0              TO ERR
 31.5           READ TFILE AT END MOVE 1 TO ERR END-READ
 31.6           PERFORM UNTIL ERR = 1
 31.7              DISPLAY TFILE-RECORD(1:50)
 31.8              READ TFILE AT END MOVE 1 TO ERR END-READ
 31.9           END-PERFORM
 32             CLOSE  TFILE
 32.1
 32.2           DISPLAY SPACES
 32.3           GO TO A1300-ITEM.
 32.4
 32.5      INSPECT WS-DB-DATA-ITEM TALLYING ERR FOR CHARACTERS BEFORE " ".
 32.6        MOVE ';'               TO WS-DB-DATA-SET(ERR + 1:1).
 32.7
 32.8        MOVE 204               TO WS-DB-MODE.
 32.9        INITIALIZE DATA-ITEM-TABLE.
 33          CALL "DBINFO" USING DB-BASE-NAME, WS-DB-DATA-ITEM,
 33.1                         WS-DB-MODE, DB-STATUS-AREA, DATA-ITEM-TABLE.
 33.2        IF NOT DB-CALL-OK
 33.3           CALL "DBEXPLAIN" USING DB-STATUS-AREA
 33.4           GO TO A1300-ITEM.
 33.5        MOVE 1                 TO S1.
 33.6        MOVE DT-ITEM(S1)       TO EDIT-NUM.
 33.7        DISPLAY SPACES.
 33.8        DISPLAY 'There are ' EDIT-NUM ' datasets that contain '
 33.9                'this data item.'.
 34          DISPLAY H1.
 34.1
 34.2        ADD 1 TO S1.
 34.3        MOVE 202               TO WS-DB-MODE.
 34.4        PERFORM UNTIL DT-ITEM(S1) = 0
 34.5           CALL 'DBINFO' USING DB-BASE-NAME, DT-ITEM(S1),
 34.6                               WS-DB-MODE, DB-STATUS-AREA, DS-INFO
 34.7           MOVE DS-SET         TO D1-SET
 34.8           MOVE DS-TYPE        TO D1-TYPE
 34.9           MOVE DS-ENTRIES     TO D1-ENTRIES
 35             MOVE DS-CAPACITY    TO D1-CAPACITY
 35.1           DISPLAY D1
 35.2           ADD 1 TO S1
 35.3        END-PERFORM.
 35.4
 35.5        GO TO A1300-ITEM.
 35.6    A1300-EXIT.  EXIT.
 35.7   *

RUN DBTINFO.SHAWN
Begin run of DBTINFO at 15:12:46
Copyright 1992 S.M.Gordon & Associates
Enter ?? for help at any prompt (almost)
Enter ? for lists on sets and items
 
Base name: PTNDB.DATABASE
Password: 
Mode: 
Dataset: ??
Enter a valid Dataset name, ? for a list of available sets.
Enter ?S for sorted list or ?D for descending sorted list
 
Dataset: ? 
 
Data Set Name    Type    Entries   Capacity 
PTNR-CNTL-M        M       1,200      3,001       
COMM-MST-M         M           1        101       
INH-APPL-M         M           0         50       
PTN-APPL-M         M           0         50       
PTNR-COMM-A        A           4        501       
PTNR-MSTR-M        M         168        301       
PTNR-MSTR2-M       M         168        301       
PTN-TO-PTN-M       M           0        101       
SECURITY-M         M           2        101       
SYS-CONTROL-M      M           1      3,001       
ERR-MSG-M          M         599      1,001       
VERIFY-M           M           0        101       
PTNR-ERR-DSEP-A    A          24        301       
GROUP-MSTR-A       A         525        653       
TRANS-MSTR-A       A         528      1,001       
PTNR-USER-A        A           0        301       
PTNR-USER-TYPE-A   A           0        301       
HELP-MSG-A         A         142      3,001       
PARM-A             A           9      3,001       
EXTERNAL-A         A           0      1,001       
INTERNAL-A         A           0      1,001       
VEND-EDI-PTNR-A    A           0      1,001       
VEND-MAN-PTNR-A    A           0      1,001       
PTNR-ERR-DSEP-D    D          24      3,003       
PARM-D             D         162      3,010       
DATACALL-D         D           4      3,002       
DATASCHED-D        D           0      3,003       
GROUP-D            D         525      1,002       
TRANSACTION-D      D         528     10,002       
TRAN-ACTN-D        D           0        301       
HELP-MSG-D         D       2,949      3,500       
PTNR-USER-D        D           0        302       
GENERIC-D          D           0      5,004       
VEND-PTNR-D        D           0      1,005       
 
Dataset: ?S
 
Data Set Name    Type    Entries   Capacity 
COMM-MST-M         M           1        101       
DATACALL-D         D           4      3,002       
DATASCHED-D        D           0      3,003       
ERR-MSG-M          M         599      1,001       
EXTERNAL-A         A           0      1,001       
GENERIC-D          D           0      5,004       
GROUP-D            D         525      1,002       
GROUP-MSTR-A       A         525        653       
HELP-MSG-A         A         142      3,001       
HELP-MSG-D         D       2,949      3,500       
INH-APPL-M         M           0         50       
INTERNAL-A         A           0      1,001       
PARM-A             A           9      3,001       
PARM-D             D         162      3,010       
PTN-APPL-M         M           0         50       
PTN-TO-PTN-M       M           0        101       
PTNR-CNTL-M        M       1,200      3,001       
PTNR-COMM-A        A           4        501       
PTNR-ERR-DSEP-A    A          24        301       
PTNR-ERR-DSEP-D    D          24      3,003       
PTNR-MSTR-M        M         168        301       
PTNR-MSTR2-M       M         168        301       
PTNR-USER-A        A           0        301       
PTNR-USER-D        D           0        302       
PTNR-USER-TYPE-A   A           0        301       
SECURITY-M         M           2        101       
SYS-CONTROL-M      M           1      3,001       
TRAN-ACTN-D        D           0        301       
TRANS-MSTR-A       A         528      1,001       
TRANSACTION-D      D         528     10,002       
VEND-EDI-PTNR-A    A           0      1,001       
VEND-MAN-PTNR-A    A           0      1,001       
VEND-PTNR-D        D           0      1,005       
VERIFY-M           M           0        101       
 
Dataset: TRANSACTION-D
 
Data Item: ?
 
There are     29 items in this dataset
Data Item Name   Type Length Occurs     
PTNR-QUAL-RTG      X      54      1
PTNR-Q-RTG-TRANS   X      60      1
PTR-TRNS-CTL-SEG   X       4      1
PTR-EXPT-TRN-ACK   X       2      1
PTR-TRN-ACK-TRNS   X       6      1
PTR-TEST-TRANS     X       2      1
PTR-TRN-ACPT-FL    X       2      1
PTR-IN-UNH-VER-U   X       2      1
PTR-IN-UNH-VERS    X      12      1
PTR-TRANS-SND-FL   X       2      1
PTR-OT-UNH-VER-U   X       2      1
PTR-OUT-UNH-VERS   X      12      1
PTR-TRN-SND-VERS   X      12      1
PTR-UNH-VERS-NBR   X       4      1
PTR-UNH-VERS-REL   X       4      1
PTR-UNH-VERS-ASS   X       6      1
PTR-UNH-CTL-AGCY   X       2      1
PTR-UNH-CMN-AC-R   X      36      1
PTR-UNH-SEQ-TRFR   X       2      1
PTR-UNH-1-LT-TFR   X       2      1
PTR-TRANSL-SCH-F   Z       2      1
PTR-TRANSL-SCH-T   Z       2      1
PTR-IN-MAP-PGM     X       8      1
PTR-OT-MAP-PGM     X       8      1
PTR-GROUP-ID       X       6      1
PTR-PRIORITY-CLS   X       2      1
PTR-HPDESK-INFO    X      40      1
PTR-APPL-RECLEN    X       4      1
AVAILABLE-68       X      68      1
 
Data Item: PTNR-QUAL-RTG
 
There are     10 datasets that contain this data item.
Data Set Name    Type    Entries   Capacity 
PTN-APPL-M         M           0         50
PTNR-MSTR-M        M         168        301
PTNR-MSTR2-M       M         168        301
PTNR-USER-A        A           0        301
PTNR-ERR-DSEP-D    D          24      3,003
DATACALL-D         D           4      3,002
DATASCHED-D        D           0      3,003
GROUP-D            D         525      1,002
TRANSACTION-D      D         528     10,002
PTNR-USER-D        D           0        302
 
Data Item: 
Dataset: 
 
 
Base name: 
 
End of DBTINFO at 15:13:36

The purpose to the program was to be able to find fields in data bases I wasn’t familiar with, especially on large data sets. What it does is prompt for a base, password, and mode, when you get to the data set prompt you can enter a question mark to get a list, a ?S to get a sorted list, or ?D to get a sorted list in descending order, of the data sets. You can use these same responses when being prompted for the data item. If you enter an actual data item, you will get a list of the data sets that contain the item, and some information about the sets.

The source code should be pretty self explanatory, to get a description of what each mode does in the call to DBINFO, just check your IMAGE manual. The modes are really the most confusing part. Next month I am going to revisit function keys. I showed an example of a program that save and restored function keys earlier this year, but I never really talked about the programmatic loading and reading of them. I got a note on compuserve asking me about it, so it seemed like a good topic to cover. Tally Ho