Database Calls

AMB Database (DB) calls are predefined, easy-to-use statements with common syntax that allows transparent access to a variety of databases. The AMB DB calls let you focus on what needs to be accomplished, rather than the mechanics of the target environment. To address environment-specific requirements, you can extend these calls with arguments; no native coding is required. These calls facilitate both generic processing and specialized requests.
Restriction: This topic applies only when the AppMaster Builder AddPack has been installed, and applies only to Windows platforms.

AMB supports the following database calls and targets.

Database Call

Description

Targets

DB-CLOSE

Close a file or cursor set.

  • SQL
  • VSAM Batch

DB-COMMIT

Perform the COMMIT function.

  • IMS
  • SQL

DB-DECLARE

Declare a cursor set.

SQL

DB-ERASE

Delete a row or record.

  • IMS
  • SQL
  • VSAM Batch
  • VSAM Online

DB-FETCH

Obtain a row from a cursor set.

SQL

DB-FREE

Release file resources.

VSAM Online

DB-MODIFY

Update a row or record.

  • IMS
  • SQL
  • VSAM Batch
  • VSAM Online

DB-OBTAIN

Read a table or record.

  • IMS
  • SQL
  • VSAM Batch
  • VSAM Online

DB-OPEN

Open a cursor set or file.

  • SQL
  • VSAM Batch

DB-PROCESS

Read a table or file and loop on it.

  • IMS
  • SQL
  • VSAM Batch
  • VSAM Online

DB-ROLLBACK

Perform the ROLLBACK function.

  • IMS
  • SQL

DB-STORE

Add a record to the database or file.

  • IMS
  • SQL
  • VSAM Batch
  • VSAM Online

DB-SUBSCHEMA

Include a data view in your program.

  • IMS
  • SQL
Note: AMB Logical View DB calls can consist of a call name, keywords, and arguments. Observe the General Rules when you code a DB call.

General Rules:

  1. Code the call using COBOL indentation. Improperly indented calls may cause errors.
  2. Argument values can be:
    • Variables
    • 1- to 7-digit numbers
    • Literal strings delimited by single or double quotation marks
  3. An alternate value can be a literal, column name, or host-variable.
  4. A host-variable is any COBOL data item referenced in your AMB SQL code; can a be data item generated automatically by AMB to match a DB2 column name.
  5. An alternate host-variable is one you instruct AMB to use instead of the automatically generated one for a column.
  6. Precede host-variables and alternate host-variables with a colon. AMB generates a # symbol for the colon.
  7. Separate each call component with a space, unless indicated otherwise in the syntax.
  8. Never code comments within database calls.
  9. Continue a call on as many as 101 subsequent lines by coding an ellipsis followed by a space (... ). Break a call for continuation at any blank space, but do not break a parameter.