Previous Topic: Suspending an CA OLQ sessionNext Topic: Global Syntax


Coding Considerations

When you enter commands in CA OLQ command mode, keep in mind the following considerations as described in this chapter.

Commands

Defining session characters

Entering data

Commands

Using abbreviations:

Three-letter abbreviations are valid for most commands and keywords.

Ending command strings:

You can end a command string with a comment character or a separator character.

Comment characters signal to CA OLQ that everything following is to be ignored. You can use comment characters to document qfiles. Use separator characters for separating commands in the input field. Even when commands are one to a line in the input field, they must be separated by a separator character.

Issuing multiple commands:

You can specify multiple commands in a single pseudo-converse by using a separator character. The separator character is defined at system generation as the exclamation point (!).

Example:

signon ss empss01! select * from employee

Use with SELECT (IDMS mode)

Anytime you use separators with SELECT (IDMS mode) they must precede the SELECT statement.

For instance, the following is valid syntax:

delete table employee.job!select all from emp_id

However, CA IDMS/DB does not accept the syntax below because the separator (!) comes after the SELECT statement:

select all from emp_id!delete table employee.job

Invoking function keys from the command line:

To invoke a predefined function from a terminal that does not have function keys, the user can enter the following commands on the command line:

PF pf-key-number or
PA pa-key-number
Pf-key-number

Specifies any number in the range 1 through 99; pa-key-number must be either 1 or 2.

Continuation character:

You can continue commands across pseudo-converses with a continuation character. You can also use the continuation character to continue batch or qfile commands on a following line.

For more information:

Commands and Syntax

Defining session characters

Defining the comment character:

The default comment character is the semi-colon (;), as defined at system generation. You can change the definition at any time in command mode CA OLQ by issuing a SET COMMENT CHARACTER command.

Access mode: You cannot use comment characters with SELECT (IDMS mode) statements.

Defining the separator character:

You can change the definition of the separator character with the SET SEPARATOR CHARACTER command.

Defining the continuation character:

You can change the definition of the continuation character with the SET CONTINUATION CHARACTER command.

For more information:

Commands and Syntax

Entering Data

The following input considerations should be noted:

Specifying data values:

CA OLQ commands sometimes require user-supplied data values, such as a CALC key, sort key, database key, or user-defined item. The following types of data values are recognized by CA OLQ:

Example:

G'<DBCS characters>'

A mix of EBCDIC and DBCS characters is allowed as long as the correct shiftin/shiftout sequences identifies the code set.

Example:

'ABC<DBCS characters>UVW'

Numeric and alphanumeric character strings for database fields are interpreted according to their formats in the subschema view. The user need not supply leading zeros or trailing blanks; CA OLQ automatically pads values, as follows:

Specifying subscripts

Subscripts are used to identify specific field entries in an array.

Example:

If a record contains sales figures for two divisions of a company for each quarter in the last five years, the array of values is as follows:

Year 1   Quarter 1           Div-sales 1
                                  Div-sales 2
         Quarter 2           Div-sales 1
                                  Div-sales 2
         Quarter 3           Div-sales 1
                                  Div-sales 2
         Quarter 4           Div-sales 1
                                  Div-sales 2
Year 2   Quarter 1           Div-sales 1
                                  Div-sales 2
         Quarter 2           Div-sales 1
                                  Div-sales 2
         Quarter 3           Div-sales 1
                                  Div-sales 2
         Quarter 4           Div-sales 1
                                  Div-sales 2
 .
 .
 .

In the above example, two subscripts must be specified to reference a specific quarter.

Example:

QUARTER(1,4) selects the fourth quarter of the first year.

Three subscripts must be specified to reference a specific division in a specific quarter.

Example:

DIV-SALES(2,3,1) selects the third quarter sales for the first division in year 2 of the array.