HP OpenVMS Systems Documentation

Content starts here

HP COBOL
DBMS Database Programming Manual


Previous Contents Index


$ DBO/REPORT

Additional information is available with the HELP DBO/REPORT command.
  • You can use the DBO utility command to create a sub-schema-name output file from Oracle CDD/Repository:


    $ DBO/EXTRACT-
    $_ schema-name/SUB-SCHEMAS=sub-schema-name/OUTPUT=filename -
    $_ /OPTION=FULL
    $ PRINT filename
    

    Additional information is available with the HELP DBO/EXTRACT command.
  • You can use the DBO utility command to create a sub-schema-name output file from the root file:


    $ DBO/DUMP database-name/SUB-SCHEMAS=sub-schema-name/OUTPUT=filename
    $ PRINT filename
    

    Additional information is available with the HELP DBO/DUMP command.

    Additional Reference

    Refer to the Oracle CODASYL DBMS documentation set for more information.

    Examples

    1. This example references the default subschema in the PARTS database:


      DB DEFAULT_SUB-SCHEMA WITHIN PARTS.
      
    2. This example references the NEW database that contains the PARTS schema and the PARTSS1 subschema:


      DB PARTSS1 WITHIN PARTS FOR "DB1:[COBOL88]NEW.ROO".
      
    3. This example references the default subschema in the PARTS database through the stream STREAM1.


      DB DEFAULT_SUB-SCHEMA WITHIN PARTS THRU "STREAM1".
      

    LD (Keeplist Description)

    Function

    The Keeplist Description entry names a keeplist.


    keeplist-name

    is a user-defined name.

    integer

    is a positive integer.

    Syntax Rules

    1. The LD entry can appear only in the Subschema Section following the DB entry or another LD entry.
    2. The LIMIT clause is for documentation only. The compiler ignores this clause.

    General Rules

    1. Keeplist-name implicitly has the global attribute. Any program defining the name, and any program contained within that defining program, can reference keeplist-name.
    2. A keeplist is a table containing an ordered list of database key values.
    3. At program initiation, each existing keeplist is empty.
    4. A KEEP or a FIND ALL statement adds a database key value to the end of keeplist-name. FIND ALL can add multiple database keys to a keeplist.
    5. A FREE statement selectively removes a database key value from keeplist-name.
    6. A keeplist with zero entries is called an empty keeplist. The order of the entries in the keeplist reflects their sequence of insertion. As entries are added, the cardinality increases. As entries are removed, the cardinality decreases.
    7. A COBOL program can reference a keeplist entry by using a database key identifier.
    8. The Database Control System (DBCS) creates and maintains all keeplists.
    9. Each value in keeplist-name represents a database record in the database.
    10. A keeplist can contain the same database key value more than once.
    11. More than one keeplist can contain the same database key value at the same time.
    12. No other run unit can update a record whose database key value is in a keeplist. Every entry in the keeplist causes the DBCS to perform a retrieval lock on the record it identifies. The record remains locked until the entry is freed, or until the program executes a COMMIT (without the RETAINING option) or ROLLBACK statement, or until the program terminates. If another run unit references a locked record, the DBCS forces the run unit to wait until the record is unlocked.

    Additional Reference

    Example

    The following example defines three keeplists to navigate through the PARTSS1 subschema: KEEP-COMPONENT, K-EMPLOYEE, and KL-ID:


    DB PARTSS1 WITHIN PARTS.
    LD KEEP-COMPONENT.
    LD K-EMPLOYEE.
    LD KL-ID.
    


    Chapter 4
    Procedure Division

    The Procedure Division of your COBOL database programs may contain declarative and nondeclarative procedures. These may include:

    • Directive and imperative statements
    • Conditional statements
    • Database key identifiers
    • Explicit and implicit scope terminators
    • Section 4.6, on record selection expressions

    4.1 COBOL Statements for the Database Programmer

    There are four types of COBOL statements:

    • Compiler-directing statements specify an action taken by the compiler during compilation.
    • Imperative statements specify an unconditional action taken by the object program at run time.
    • Conditional statements specify a conditional action taken by the object program at run time; the action depends upon a truth value that is generated by the program. (A truth value is either a yes or no answer to the question, "Is the condition true?")
    • Delimited-scope statements specify their explicit scope terminator.

    Table 4-1 shows the three types of COBOL statements (conditional, imperative, delimited-scope) that are considered particularly relevant to database programming.

    Table 4-1 Types of COBOL Statements
    Type Verb
    Conditional COMMIT ([NOT] ON ERROR)
    CONNECT ([NOT] ON ERROR)
    DISCONNECT ([NOT] ON ERROR)
    ERASE ([NOT] ON ERROR)
    FETCH ([NOT] AT END or
    [NOT] ON ERROR)
    FIND ([NOT] AT END or
    [NOT] ON ERROR)
    FREE ([NOT] ON ERROR)
    GET ([NOT] ON ERROR)
    KEEP ([NOT] ON ERROR)
    MODIFY ([NOT] ON ERROR)
    READY ([NOT] ON ERROR)
    RECONNECT ([NOT] ON ERROR)
    ROLLBACK ([NOT] ON ERROR)
    STORE ([NOT] ON ERROR)
     
    Imperative COMMIT (1)
    CONNECT (1)
    DISCONNECT (1)
    ERASE (1)
    FETCH (2)
    FIND (2)
    FREE (1)
    GET (1)
    KEEP (1)
    MODIFY (1)
    READY (1)
    RECONNECT (1)
    ROLLBACK (1)
    STORE (1)
     
    Delimited-Scope COMMIT (END-COMMIT)
    CONNECT (END-CONNECT)
    DISCONNECT (END-DISCONNECT)
    ERASE (END-ERASE)
    FETCH (END-FETCH)
    FIND (END-FIND)
    FREE (END-FREE)
    GET (END-GET)
    KEEP (END-KEEP)
    MODIFY (END-MODIFY)
    READY (END-READY)
    RECONNECT (END-RECONNECT)
    ROLLBACK (END-ROLLBACK)
    STORE (END-STORE)

    Legend:
    ( 1 ) Without the optional [NOT ] ON ERROR phrase
    ( 2 ) Without the optional [NOT ] AT END or [NOT ] ON ERROR phrase

    Like statements, COBOL sentences also can be compiler-directing, imperative, or conditional. Sentence type depends upon the types of clauses the statement contains. Table 4-2 summarizes the contents of the three types of COBOL sentences. The remaining text in this section discusses each type of statement and sentence in greater detail.

    Table 4-2 Contents of COBOL Sentences
    Type Contents of Sentence
    Imperative One or more consecutive imperative statements ending with a period
    Conditional One or more conditional statements, optionally preceded by an imperative statement, terminated by the separator period
    Compiler-Directing Only one compiler-directing statement ending with a period


    Previous Next Contents Index