Previous Topic: Retrieving Data with SQLNext Topic: JCL Considerations


Coding Considerations

Very few syntax changes are needed to use the SQL retrieval feature. Each CA Culprit parameter affected is discussed below.

DATABASE

The DATABASE parameter is optional. If it is present, it must always be the first parameter in your CA Culprit syntax.

PROFILE

The PROFILE parameter is also optional. The USER= and PW= clauses should be specified if CA Culprit security is on.

INPUT

The INPUT parameter identifies the input data as a CA IDMS/DB SQL table. New syntax for the INPUT parameter is given later in this chapter.

SQL

The new SQL parameter immediately follows the INPUT parameter. Here, the user codes an SQL SELECT clause that is passed along to the database engine. The SELECT clause may span multiple lines, providing the CA Culprit continuation character (*) appears in column 1. Comments are not allowed in the SQL statement.

REC

REC parameters are automatically generated to describe both the SQL columns and the null value indicators that is returned to the CA Culprit input buffer. As always, the user can code additional REC parameters to either re-define columns or to define a "dummy buffer". Further discussion of generated REC cards appears later in this chapter.

SELECT/BYPASS

The SELECT/BYPASS parameter is completely functional with SQL retrieval. SELECT/BYPASS gives you a Selection Statistics Report that tells you the number of rows selected, the number of rows rejected, and the total number of rows on the input table. However, you can select rows far more efficiently by coding a WHERE clause on your SQL SELECT statement. This latter technique is strongly recommended whenever you don't need the selection statistics information.

OUTPUT

Data retrieved from SQL tables can be written to any supported output media. Thus CA Culprit can be used as a migration tool, to quickly convert SQL tables into another data format.

EDIT

There are no changes for coding type 4, 5, and 6 parameters. Use the field names from the generated REC cards to reference SQL columns and their null value indicators.

PROCESS

There are no changes for coding type 7 and 8 parameters. Use the field names from the generated REC cards to reference SQL columns and their null value indicators.

Your detail time logic should check null indicators whenever appropriate. When an SQL column is null, the null indicator has a value of minus one, and the value in the SQL column is unpredictable.