All documentation
I-QU PLUS-1/User Guide

Application Development User Guide

Build I-QU PLUS-1 applications: program structure, the RDA, processor usage, database and PCIOS file handling, the sort interface, and advanced features.

Last updated March 12, 2012

Basic structure

An I-QU PLUS-1 application is a Q-Language program made of definitions, declarations, and procedural commands. Programs run conversationally for ad-hoc work or as compiled object programs in batch and demand. Three internal storage areas are central: the Record Delivery Area (RDA), the Variable Data Storage Area (DSA), and the Object Program Area.

  • RDA — current record materialized for command access; addressable by position, name, or subscript
  • DSA — user-defined variables (DEFINE A/N/FP/K, DEFINE RA, DEFINE RDA, DEFINE SUB)
  • Sort control area — sort key parameters and sort-status tracking

Using the I-QU PLUS-1 processor

  • Conversational mode — type commands at the prompt, results display immediately
  • Program mode — assemble commands into a procedure (PROC … ENDPROC), then RUN
  • Display & view data, define variables, build expressions with arithmetic and string operators
  • Use in-line DO blocks, IF/ELSE/ENDIF, and DO/WHILE/ENDDO for flow of control
DISPLAY '*** STARTING ***'
DO
  ACCEPT CUSTNO AT END FINAL
  CUSTOMER-NUMBER = CUSTNO
  FETCH5 CUST-MASTER-REC
  IF ERROR-NUM NOT = 0
    DISPLAY 'No customer ' + CUSTNO
  ELSE
    DISPLAY RDA CUST-NAME
  ENDIF
ENDDO

Database and PCIOS file handling

I-QU PLUS-1 reads and writes DMS, RDMS, PCIOS, SFS 2200, TIP, BIS (MAPPER) DTM, and BIS (MAPPER) RIDs through a single DML-like vocabulary. FETCH/MODIFY/STORE/ERASE map to the DMS and RDMS verbs; PCIOS files use OPEN/READ/WRITE/CLOSE with INVALID-KEY handling.

FETCH5 SALESMAN-REC          . Fetch the record
DISPLAY RDA SLSM-LAST-NAME   . Display a field
RDA SLSM-FIRST-NAME = 'SAM'
RDA SLSM-QUOTA = 9000
MODIFY SALESMAN-REC
FREE                          . Release currency lock

Sort interface

Use the extended-mode Sort interface for large datasets. Build the sort key parameters in the sort control area, route records into the sort, and consume the sorted output as the input to your next pass.

Compiling I-QU PLUS-1 programs

COMPILE turns the source procedure into the Object Program Area. INVOKE pulls a previously compiled subroutine. Use @IQU,I to enter the I-QU PLUS-1 processor and run a saved program element.

Advanced features

  • Subscripted RDA references for repeating fields (DEFINE SUB)
  • Variable RDA referencing — set start position and length at run time (S$, L$)
  • EDIT and TRIMEDIT for formatted output and trailing/leading blank suppression
  • External symbol/file handling via @ASG, @FREE, @QUAL passthrough
  • Application Group and Step Control for multi-thread environments
Note: When a TRIMEDIT result feeds another EDIT, only the leading spaces from the TRIMEDIT result are suppressed in the final output.