All documentation
I-QU PLUS-1/Reference

I-QU PLUS-1 Programmer Reference

Programmer reference for the Q-Language: structure, modes of operation, RDA, variables, reserved words, and control directives.

Last updated August 10, 2011

How an I-QU PLUS-1 program is structured

An I-QU PLUS-1 program is a sequence of directives and procedural commands written in the Q-Language. Directives configure the environment (definitions, file assignments, compilation), and commands run inside procedures to fetch, modify, and write records. Programs run in conversational mode for ad-hoc work and in program mode for batch or demand execution.

Internal storage areas

  • Record Delivery Area (RDA) — where the current record is materialized for command access
  • Variable Data Storage Area (DSA) — user-defined variables (DEFINE A/N/FP/K)
  • Object Program Area — compiled commands ready for execution

RDA fields can be referenced directly by position (e.g. (3,2) for three words starting at position 2), by item name resolved from the schema, or via subscripted references. Variable RDA referencing supports run-time field selection.

Defining variables

  • DEFINE A — alphanumeric strings
  • DEFINE N — decimal numerics
  • DEFINE FP — floating-point numerics
  • DEFINE K — Kanji
  • DEFINE RA — alternate record area
  • DEFINE RDA — RDA field overlay
  • DEFINE SUB — subscript variable

Control directives

  • ADD, CLEAR, COMPILE, CONV, EXIT, INDEX, INIT
  • INPUT, LISTON / LISTOFF, LOAD, OBJECT
  • @ASG, @CKPT, @MODE, @START, @BRKPT, @FREE, @QUAL, @SYM

Procedural commands

Procedural commands include record-set DML (FETCH, MODIFY, STORE, ERASE), conditional flow (IF/ELSE/ENDIF, DO/WHILE/ENDDO), display (DISPLAY, CLEARSCREEN), and ECL passthrough commands. The Q-Language is intentionally COBOL-like so DBAs and COBOL developers can read and modify it without retraining.

DO TOTAL-ROUTINE WHILE CNT < LIST-RESULT
  ADD AMOUNT TO RUNNING-TOTAL
  ADD 1 TO CNT
ENDDO
IF BIT-SET
  DISPLAY 'BIT IS SET'
ELSE
  DISPLAY 'BIT NOT SET'
ENDIF
Note: Refer to the Database Reorganization Utility Reference for the pointer-manipulation subset of these commands.