Google
 

Trailing-Edge - PDP-10 Archives - BB-H548C-BM - iql-subsys/iql.hlp
There are 2 other files named iql.hlp in the archive. Click here to see a list.
**GENERAL
Interactive Query Language, "IQL" is a proprietary data  management
system.   It provides both laymen and computer professionals with a
comprehensive ability to define files, input or update those files,
retrieve information from the files, generate sophisticated reports
and to obtain derivative files.  IQL is interfaced to the DBMS data
base  manager.   The IQL/DBMS interface currently handles retrieval
only.
Before IQL can work  with  your  file  or  database,  the  file  or
database  must  have been described to IQL.  These descriptions are
called  'Dictionaries'  and  are  permanently  stored  by  IQL  for
reference each time you work with the file or database through IQL.
When you are retrieving data, IQL works in either of two modes:
    (a) For file browsing or updating  you  can  use  UPDATE  mode,
    where  IQL  carries  out  your command as soon as you enter it.
    This could be called "immediate" mode.   In  UPDATE  mode  your
    file  is  positioned  as  you  interact  with  it.  BROWSE is a
    special "read only" form of UPDATE mode.  Data  structures  you
    can process in UPDATE mode are sequential or ISAM disk files in
    either ASCII or Sixbit form.
    (b) For preparing reports, IQL lets you operate in REPORT mode.
    In  this  mode,  your  commands  are  gathered  together into a
    "query" which IQL processes as a unit.  This  could  be  called
    "deferred"  mode.   Data  structures  you can process in REPORT
    mode are sequential or ISAM files in ASCII or sixbit form, tape
    files, or DBMS data bases.
An IQL level is either a 'command' level or a 'data  input'  level.
Command  levels require your input to be a command telling IQL what
to do next.  Data input levels require your input to be  data  that
IQL  will use according to the last command you gave.  However even
at data input level, there are a few special commands you may  give
to signal the end of input or correct a mistake.
    (a) You always start in IQL  at  ASSISTANCE  command  level  by
    coming in from the operating system via R IQL, RUN IQL, or just
    IQL depending on how your site sets itself up.
    b) At ASSISTANCE command level you can go down to  any  of  the
    following subcommand levels:
        REPORT level via RUN or EXECUTE - to run a query.
        EDIT level via EDIT - to edit a query.
        UPDATE level via UPDATE,  BROWSE  or  INPUT  -  to  change,
        inspect or input a data file.
    c) At ASSISTANCE command level, you can go down directly to the
    following data input levels:
        Via INPUT - to input new records to a data file.
        Via DEFINE - to define dictionary definitions or changes.
        Via WRITE - to write a new query.
    d) From any of the subcommand levels you can go down  to  their
    respective data input modes:
        From EDIT via INSERT or I.  - to  insert  new  lines  in  a
        query.
        From UPDATE via INSERT or APPEND:  to input new records  to
        a data file.
        From REPORT mode (running a query) via ACCEPT -  to  accept
        data during preparation of reports.
    e) Regardless of mode or level, END or EXIT always takes you up
    to  the  next  level.   IQL  always  tells you when you leave a
    level.
IQL runs under control of a front-end module which:
(a) provides helping text on various features of IQL.
(b) lets you write, store, retrieve, change or run queries.
(c) lets you define, display or change dictionaries.
(d) controls the rest of the IQL system.
Commands used to control  the  front-end  are  called  'assistance'
commands.  Each assistance command is carried out by IQL as soon as
you enter it.  IQL prompts for assistance  commands  by  displaying
<QA>.  By function, the assistance commands are:
    (a) to define a dictionary:             DEFINE
    (b) to get a list of dictionaries:      DICTIONARIES
    (c) to see a specific dictionary:       ITEMS
    (d) to write a new query:               WRITE
    (e) to store a query in English form:   STORE
    (f) to get a list of stored queries:    QUERIES
    (g) to retrieve a stored query:         GET,EDIT,LIST
    (H) to delete a stored query:           DELETE
    (i) to replace a stored query:          REPLACE
    (j) to change a query:                  EDIT
    (k) to run an English query:            RUN
    (l) to save an analyzed query:          SAVE
    (m) to execute a saved query:           EXECUTE
    (n) to input a new file:                INPUT
    (o) to update or browse in a file:      UPDATE, BROWSE
    (p) to find out your job number:        JOB
    (q) to exit to the operating system:    EXIT,END
The individual Report Commands are:
    ACCEPT                      LMARGIN
    ACROSS                      MAXIMUM
    AUTHORITY                   MINIMUM
    AVERAGE                     NEWPAGE
    CALL                        OPEN
    COMPUTE                     PAGE
    COPY                        PAGE-LINES
    CREATE                      PAGING
    DATE                        PICTURE
    DISPLAY                     PRINT
    EXIT                        REPORT
    FIND     (sequential)       RESET
    FIND     (random)           REWRITE
    FIND     (data base)        RMARGIN
    FORM-LINES                  SET
    GO TO                       SORT
    HEADING                     SUMPRINT
    HOLD                        TALLY
    HSPACE                      TITLES
    IF                          TOTAL
                                VSPACE
By function, the update commands may be grouped:
    (a)  To position your file:  UP, DOWN, TOP, BOTTOM, FIND
    (b)  To add records:         INSERT, APPEND
    (c)  To delete records:      DELETE
    (d)  To change records:      CHANGE
    (e)  To display records:     LIST
    (f)  To control the session: VERIFY, COLUMNS
    (G)  To extract a new file:  EXTRACT
    (H)  To save your file:      SAVE
    (i)  To end the session:     END,EXIT
**BROWSE
FUNCTION:     Puts you in UPDATE mode so that you may 'browse' in a
              data file (subject to any password requirement).  See
FORMAT:       BROWSE     dictionary-name     [file-name]
DISCUSSION:   1) BROWSE is the same as UPDATE except that BROWSE
              only lets you read the file.
              2) If the file is protected at the  READ  level,  IQL
              asks  you  for  the  password  and  checks  it before
              unlocking the file for browsing.
              4)  If  you  furnish  a  file-name,  IQL  uses   this
              file-name  name  rather  than  the  file-name  in the
              dictionary.   The   file-name   must   be   formatted
              ffffff.ext where ffffff is one to six characters.
EXAMPLES:
              <QA> browse   accounts      (not protected)
              <QU> list account buyer city for account 23098
               23098 H R RAWLINGS   CLEVELAND
               ...(BROWSE session continues)...
               ...(you end BROWSE session via END or EXIT)
              <QA>
              <QA> browse   personnel    (protected at read level)
               *PASSWORD: pulsar
               (FILE UNLOCKED FOR READ ONLY)
              <QU> list name, dept for all region 23
               BROADHURST      421
               CALAHAN         421
               GROGAN          423
               ...(BROWSE session continues)...
               ...(you end BROWSE session via END or EXIT)
              <QA> browse   charges   'charge.seq'
              <QU> list date, charge for all account 562330
               06/03/78    234.56
               06/06/78     12.07
               ...(BROWSE session continues)...
**DEFINE
FUNCTION:     Allows you  to  define  dictionary  transactions  for
              creating  or  updating  an  IQL dictionary.  When you
              terminate   a   DEFINE    session    normally,    IQL
              automatically  calls the dictionary generation module
              to actually create or update the dictionary based  on
              the transactions you just entered.
FORMAT:       DEFINE
EXAMPLES:     <QA> define
              *FD,DD,PD,CD,RD,AD,SD,END,SCRUB:    fd
              *ACTION CODE (A,C,D OR P):          c
              *DICT NAME - UP TO 30 CHARS:        personnel
              *DICT UNLOCKING PASSWORD, IF ANY:   sesame
              *FILE IN NAME AS XXXXXX.EEE:        next
              *FD,DD,PD,CD,RD,AD,SD,END,SCRUB:    dd
              *ACTION CODE (A,C,D):               c
              *ITEM NAME (UP TO 30 CHARS):        name
              *TOP COLUMN TITLE (UP TO 10 CHARS): full name
              *BOTTOM TITLE (UP TO 10 CHARS):     next
              *FD,DD,PD,CD,RD,AD,SD,END,SCRUB:    end
              (END DICTIONARY TRANSACTION INPUT)
              (END DICTIONARY UPDATE)
               <QA>
**DELETE
FUNCTION:     Deletes one or more queries from the file  of  stored
              English language queries in your Directory.
FORMAT:       DELETE    query-name
                       ------<-----
DISCUSSION:   The  query  is  deleted  from  the  file  of   stored
              English-language queries.
EXAMPLE:      <QA> delete bonus-analysis
               (BONUS-ANALYSIS DELETED)
              <QA>
              <QA> delete  charlie  beth  claire
               (CHARLIE DELETED)
               %BETH NOT FOUND TO BE DELETED
               (CLAIRE DELETED)
              <QA>
**DICTIONARIES
FUNCTION:     Gives a terminal display of the file information  for
              each dictionary in your Directory.
FORMAT:       DICTIONARIES [master-password]
DEFAULTS:     If  you  do  not  furnish  the  master-password,  IQL
              proceeds  with  the  display of the file information,
              but if  it  encounters  a  protected  dictionary,  it
              displays  only the dictionary name, the Directory and
              the file type.
DISCUSSION:   The display produced by DICTIONARIES is formatted  72
              characters  wide.  The dictionary display produced by
              printing is wider and  contains  more
              information.
EXAMPLE:      <QA> dictionaries sesame
  DICTIONARIES IN YOUR DIRECTORY:
  DICT      FILE    FILE-IN             REC BLK KEY KY KY RD CP RW
  NAME      TYPE    NAME        DIRECT  LEN FAC LOC LN TP PW PW PW
  ----      ----    ----        ------  --- --- --- -- -- -- -- --
  INVENTORY SQ DSK7 INVENT.SEQ    JANE  180   0
  PERSONNEL SQ DSK7 PERSON.IDX          600   5   1  5 AU 10 20 30
              <QA>
**EDIT
FUNCTION:     Allows you to edit (change) either the current  query
              or  a  stored  query.   Uses the DECsystem20 built-in
              text editor.
FORMAT:       EDIT [query-name] [LIST]
DEFAULTS:     If you do not furnish a query  name,  IQL  edits  the
              current query.  If you do not use 'LIST' IQL does not
              list the query before going into edit mode.
DISCUSSION:   1) If you furnish a query name, IQL moves that  query
              from  the  file  of  stored  queries into the current
              query area before entering edit mode.
              2) The DECsystem20 text editor is  described  in  its
              own  manual.   However, the following summary of some
              of its commands may be useful (the symbol  $  denotes
              the escape key on your terminal):
          D.                 Delete the current line of the query.
          linefeed key       Move down one line.
          escape key         If in 'insert' mode terminate it.
                             If in 'edit' mode, go up one line.
          Fstring$           Move to and list the next line which
                             contains the designated string.
          I.                 Insert a line of text after this line.
          I.,2               Insert lines of text after this line;
                             keep inserting lines until you enter
                             the escape key first in a line.
          P.                 List (print) the current line.
          P                  List the current and next 15 lines.
          Sstring1$string2$. Substitute string2 for string1 in
                            the current line.
          P100              Go to the beginning of the query.
          Pnn               Go to line nn and print it.
          P nn:mm            Print lines nn through  mm.
EXAMPLE:
          <QA> edit      newhires     list
           **NEWHIRES
             OPEN PERSONNEL.
             HEADING 'LIST OF NEW HIRES'.
             IF HIRE-YR LEQ 77 PRINT NAME, DEPT, HIRE.

           [EDITING QC014S.CRD]
           *linefeed
           00100  open personnel.
           *i.
           00150  display on.
           *fheading$
           00200  HEADING 'LIST OF NEW HIRES'.
           *SHIRES$HIRES//SINCE JANUARY 1$.
           00200  HEADING 'LIST OF NEW HIRES//SINCE JANUARY 1'.
           *linefeed
           00300  IF HIRE-YR LEQ 77 PRINT NAME, DEPT, HIRE-YR.
           *sleq$geq$.
           00300  IF HIRE-YR GEQ 77 PRINT NAME, DEPT, HIRE-YR.
           *p100
           00100  OPEN PERSONNEL.
           *p
           00100  OPEN PERSONNEL.
           00150  DISPLAY ON.
           00200  HEADING 'LIST OF NEW HIRES//SINCE JANUARY 1'.
           00300  IF HIRE-YR GEQ 77 PRINT NAME, DEPT, HIRE-YR.
           *e
           [qc014s.crd]
           <QA>
**EXECUTE
FUNCTION:     Begins executing a  saved  query  without  having  to
              analyze it again.
FORMAT:       EXECUTE query-name
DISCUSSION:   1) For a query to be available to  EXECUTE,  it  must
              have  been  saved  sometime  previously by use of the
              SAVE assistance  command.   Each  saved  query  is  a
              separate  file  which has the extension .QRY.  Please
              see the SAVE command for  a  complete  discussion  of
              saved queries.
              2) Saved queries  have  already  been  through  IQL's
              analysis step and are ready for immediate execution.
              3) Note that if you have  forced  a  specific  report
              date (via DATE) in a saved query, that date stays the
              same each time the query is executed.
EXAMPLE:      <QA> execute newhires (looks for NEWHIR.QRY)
               ...(your report goes here if routed to terminal)...
              <QA>
**EXIT
FUNCTION:     MOVES FROM ONE LEVEL OF IQL TO THE NEXT HIGHER LEVEL.
FORMAT:       EXIT
SYNONYMS:     END
DISCUSSION:   Throughout IQL the words END or EXIT always terminate
              the  level  or  mode  you are in and go up one level.
              The operating system  is  one  level  above  IQL.   A
              message is displayed whenever IQL leaves a level.
EXAMPLE:      <QA> exit      (exits IQL to operating system)
**GET
FUNCTION:     Moves a query from the stored  query  file  into  the
              current query area.
FORMAT:       GET [query-name] [LIST]
DEFAULTS:     (1) If you do not use a  query  name,  GET  uses  the
              current query;  ie, it does not move in a new query.
              (2) If you do not use LIST, IQL does any query moving
              indicated but lists only the name of the query.
DISCUSSION:   If you use a query name, the  new  query  obliterates
              the previous contents of the current query area.
EXAMPLES:     (the current query is named BLUE-EYES)
              <QA>get
               **BLUE-EYES      (lists only the current query name)
              <QA>
              <QA> get    list
               **BLUE-EYES
               OPEN APPLICANTS.
               IF COLOR-EYES = 'BLUE' SORT BY STATE, CITY.
               PRINT NAME, STATE, CITY, AGE.
              <QA>
              <QA> get    newhires
               **NEWHIRES         (only the query name is listed)
              <QA>
              <QA> get    newhires     list
               **NEWHIRES
               OPEN PERSONNEL
               HEADING 'NEW HIRES SINCE//JANUARY 1, 1977'
               IF HIRE-DATE GEQ 770101 PRINT NAME, DEPT, HIRE-DATE
              <QA>
**INPUT
FUNCTION:     Sets IQL into 'input' level of update mode so you may
              input records to create a new data file.
FORMAT:       INPUT     dictionary-name     [file-name]
DEFAULTS:     Each record is initially set  to  all  spaces  before
              INPUT begins asking you for field values.
DISCUSSION:   1) If you do not furnish a dictionary name, IQL  asks
              you for it.
              2)  If  you  furnish  a  file-name,  IQL  uses   this
              file-name  instead of the one in the dictionary.  The
              file-name must be formatted ffffff.ext  where  ffffff
              is one to six characters.
              3) If IQL finds that the file is already  present  in
              your  Directory  it  tells  you  and goes into UPDATE
              mode.  ie, INPUT does  not  let  you  write  over  an
              existing file.
              4) If IQL finds that the dictionary contains password
              protection at the READ or WRITE level it asks you for
              the password and checks it before letting  you  input
              data.
              5) INPUT begins by issuing a  prompt  for  the  first
              field  in  the  first  record  and  waiting  for your
              response.  It then issues the  prompt  for  the  next
              field in that record, and continues in that way until
              either it encounters the end of the dictionary or you
              tell  it  to  do  something  else.   Prompts for item
              values are issued in the order in which the items are
              found in the dictionary.
              6) You may use the following special words to control
              INPUT:
              END             end INPUT mode; go up to UPDATE mode
              EXIT            same as END
              DOWN [integer]  move down integer prompts; if no
                              integer move down 1 prompt
              KILL            kill the record; start it over
              NEXT            complete the record: fill remaining
                              fields with spaces or zeroes as
                              appropriate, then go to next record
              UP [INTEGER]    move up integer prompts;
                              if no integer move up 1 prompt
              7) Fields are checked as follows as soon as you enter
              them:   alphanumeric  values  are checked only to see
              that they are not longer  than  the  field.   Numeric
              quantities  are  checked  to  see  that  they  do not
              contain characters other than $ ,  +  -  or  numbers;
              and that they do not have too many integer or decimal
              places.  INPUT fills in leading and trailing zeros in
              numeric  quantities  as  necessary;  the characters $
              and , are ignored;  and the  decimal  point  is  used
              only to line up the item.  See the example below.
EXAMPLE:      <QA> input     customers
              (YOUR DIARY FILE IS QL023U.LPT)
              (NEXT RECORD)
               *NUMB (CUSTOMER NUMBER) 5 N:  34
               *NAME (CUSTOMER NAME) 30 A:   portable devixes
               *SLSMAN (SALESMAN NAME) 25 A: carleton scott
               *CITY (CUSTOMER CITY) 15A:    up 2
               *NAME (CUSTOMER NAME) 30 A:   portable devices
               *SLSMAN (SALESMAN NAME) 25 A: down
               *CITY (CUSTOMER CITY) 15 A:   st. louis
               *CYSLS (CURR YR SALES) 8.2 N: $1,500.
               *LYSLS (LAST YR SALES) 8.2 N: 3012.46
               *CLIMIT (CREDIT LIMIT) 8.2 N: next
              (NEXT RECORD)
               *NUMB (CUSTOMER NUMBER) 5 N:  37
              ...(input continues; ended by END or  EXIT)...
              ...(you end UPDATE mode via END or EXIT)...
              <QA>
**ITEMS
FUNCTION:     Displays a formatted display of  the  file  and  item
              information in a specific IQL dictionary.
FORMAT:       ITEMS dictionary [master-password] [ALL]
DEFAULTS:     (1) If you do not furnish a password  and  IQL  finds
              that  the  dictionary  or  an  item  is protected, it
              obscures any information for the protected item which
              would allow you to locate it.
              (2) If you do not use 'ALL', IQL  displays  only  the
              first 25 items in the dictionary and then asks you to
              respond with 'YES' or 'NO' as to whether you want  to
              see  more  items.   If  you  kill  the  display  with
              control-O remember that IQL waits for this response.
EXAMPLE:      <QA> items personnel sesame all
  DICT      FILE    FILE-IN             REC BLK KEY KY KY RD CP RW
  NAME      TYPE    NAME        DIRECT  LEN FAC LOC LN TP PW PW PW
  ----      ----    ----        ------  --- --- --- -- -- -- -- --
  PERSONNEL IS DSK7 PERSON.IDX    JANE  600   5   1  5 AU 10 20 30
     ITEM     TOP        BOTTOM     1ST  NO.  T S PRINTING SCAN
  ID  NAME    TITLE      TITLE      CHAR CHAR Y C PICTURE  GNNS PT
  --  ----    -----      -----      ---- ---- - - -------  ---- --

  PD TIGER
  DD EMPNO    EMPLOY     NUMBER        1    5 N 0 ZZZZ9
  DD EMPNAME  EMPLOY     NAME          6   30 A
  ....
              <QA>
**JOB
FUNCTION:     Displays the job number which  the  Operating  System
              has assigned to your IQL session.
FORMAT:       JOB
DISCUSSION:   IQL uses your job number as an ingredient for  naming
              its temporary and print files.  The job number may be
              useful if you wish to work with these  files  outside
              of IQL.
EXAMPLE:      <QA> job
               JOB NUMBER: 32
              <QA>
**LIST
FUNCTION:     Displays your current query or moves a  stored  query
              into the current query area and displays it.
FORMAT:       LIST [query-name]
DEFAULTS:     If you do not furnish a  query-name,  IQL  lists  the
              current query.
DISCUSSION:   When used with a query name, LIST functions as if  it
              were 'GET' used with the 'LIST' option.
EXAMPLES:     (the current query is named MARKET-PROJECT)
              <QA> list                   (lists the current query)
               **MARKET-PROJECT
               OPEN PROSPECTS
               COMPUTE EXPECTED = EXPECTED  * 1.1
               TOTAL EXPECTED BY REGION, DISTRICT
               MAXIMUM EXPECTED BY REGION, DISTRICT
              <QA>
              <QA> list   prospect-detail     (retrieves and lists)
               **PROSPECT-DETAIL
               OPEN PROSPECTS
               HEADING 'PROSPECT//DETAIL'
               PRINT PROSPECT, DATE-IN, EXPECTED, PROBABILITY
              <QA>
**QUERIES
FUNCTION:     Displays a list of all the queries stored by  IQL  in
              your Directory.
FORMAT:       QUERIES
DISCUSSION:   Stored queries are kept in their  English-like  query
              language   format.   They  must  pass  through  IQL's
              analysis step to be executed.   Note  the  difference
              between  'stored'  (stored  in their English language
              format) and 'saved' (stored in their  analyzed  table
              format) queries.
EXAMPLE:      <QA> queries
               QUERIES STORED IN YOUR DIRECTORY ARE:
               NEWHIRES           SALARY-ANALYSIS         PROJECTS
               SALES-ANALYSIS     CUSTOMERS-OVER-CREDIT   LEADS
               LOANS              RISK-ANALYSIS
               (END LIST OF STORED QUERIES)
              <QA>
**REPLACE
FUNCTION:     Replaces an existing query in IQL's stored query file
              with the current query.
FORMAT:       REPLACE [query-name]
DEFAULTS:     If you do not furnish a query name, IQL looks to  see
              if  you  have given the current query a name.  If so,
              it replaces the stored query under that name with the
              current one.  If not, it asks you for a query name.
DISCUSSION:   The contents  of  the  current  query  area  are  not
              affected by REPLACE.
EXAMPLE:      <QA> replace
               (PO-AUDIT REPLACED)
              <QA>
              <QA> replace  open-po
               (OPEN-PO REPLACED)
              <QA>
**RUN
FUNCTION:     Runs a query by routing it to the query analysis step
              before executing it.
FORMAT:       RUN [query-name] [NOLIST] [SAVE]
DEFAULTS:     If you do not furnish a  query  name,  IQL  runs  the
              current query.  If you do not use any of the optional
              words, IQL runs and lists the query.
DISCUSSION:   1) If you furnish a query name, IQL moves that  query
              from  the  stored  query  file into the current query
              area before running it.
              2) IQL analyzes the query before executing  it.   The
              query  in  the  current query area is not affected by
              running it.
              3)  If  IQL  finds  an  error  in  the  query  during
              analysis,  it  issues  appropriate error messages and
              returns to assistance mode so that  you  may  correct
              the errors (by using 'EDIT').
              4) If you use NOLIST, IQL does not list the query  as
              it analyzes it.
              5) If you use SAVE, IQL creates a saved .QRY file  of
              the analyzed query.  See the SAVE command.
EXAMPLES:     <QA> run
               ...(listing of current query goes here)...
               ...(report produced by current query goes here)...
              <QA>
              <QA> run   dept-mgrs   nolist
               **DEPT-MGRS
               ...(report produced by query DEPT-MGRS goes here)...
              <QA>
**SAVE
FUNCTION:     Saves the current or  named  query  in  its  analyzed
              form.   This  is  so you may subsequently execute the
              query without having to re-analyze it.
FORMAT:       SAVE [query-name] [NOLIST] [RUN]
DEFAULTS:     If you do not furnish a query name, IQL uses the name
              of  the  current  query.   If  you have not given the
              current query a name, IQL requests a query name.   If
              you  do  not  furnish  any of the optional words, IQL
              saves and lists the query.
DISCUSSION:   1) IQL analyzes the query before saving it.
              2) The saved query is written as an independent  disk
              file.   It  is  given  a  file name consisting of the
              first six characters of the query name combined  with
              the  extension  '.QRY'.   Since  some versions of the
              system utilities do not fully process file names with
              dashes (-) in them, you should avoid having dashes in
              the first six characters  of  your  query  name  when
              saving it.
              3) If a .QRY file already  exists  under  the  target
              name, IQL notifies you of the conflict and refuses to
              SAVE the new query;  neither the existing  .QRY  file
              nor the current query are affected. USE REPLACE.
              4) Please remember that if you have used DATE to  set
              a  specific  value  for the report date in the query,
              when the saved query  is  run,  it  produces  reports
              using that specific date value.
              5) To run a saved query, use the EXECUTE command.
              6) Please be careful to note the  difference  between
              STORED  queries  (which  are  kept  in  their English
              language form) and SAVED queries (which are stored in
              their internal table form.
              7) If you use the RUN option, IQL runs (analyzes  and
              executes) your query as well as saving it.
EXAMPLES:     (current query is named NEWHIRES)
              <QA> save
               ...(the current query is listed here)...
               (NEWHIRES SAVED AS NEWHIR.QRY)
              <QA>
              <QA> save  quarterly  nolist  run
               **QUARTERLY
               ...(report produced by QUARTERLY goes here)...
               (QUARTERLY SAVED AS QUARTE.QRY)
              <QA>
**STORE
FUNCTION:     Stores the  current  query  in  its  English-language
              form.
FORMAT:       STORE [query-name]
DEFAULTS:     If you do not furnish a query name, IQL uses the name
              of  the  current  query.   If  you have not given the
              current query a name, IQL requests a query name.
DISCUSSION:   1) The stored query is kept in  its  English-language
              form  in  the  file QPQRYS.SEQ.  You may retrieve the
              query at any time to list, edit, run, or save it.
              2) If you attempt to STORE a query and  IQL  finds  a
              query  already  there by that name it notifies you of
              the conflict and refuses to store the query;  neither
              the  current  nor  the  previously  stored  query are
              affected.
              3) Please note the difference between stored  queries
              (kept  in  their  English-language  format) and saved
              queries (kept in their analyzed table format).
              4) The current query is not affected by storing it.
              5) To execute a stored query,  use  the  command  RUN
              with the query-name option.  See the RUN command.
EXAMPLES:     (the current query is named R2D2)
              <QA> store
               (R2D2 STORED)
              <QA>
              <QA> store   c3po
               (C3PO STORED)
              <QA>
**UPDATE
FUNCTION:     Sets IQL into update command mode so you  may  update
              or inspect a data file.
FORMAT:       UPDATE dictionary-name [file-name]
DISCUSSION:   1) IF IQL does not find the file  referenced  in  the
              dictionary, it notifies you and goes into INPUT mode.
              2) If you furnish a file-name IQL uses this file-name
              instead  of  the  file-name  in  the dictionary.  The
              file-name must be formatted ffffff.ext  where  ffffff
              is one to six characters.
              3) If IQL  finds  that  the  dictionary  is  password
              protected  at either the READ or WRITE level, it asks
              you for the password and checks it before letting you
              update.   If  you  respond with the READ password, it
              notifies you that it is opening  the  file  for  read
              only.
EXAMPLE:      <QA> update     customers
               *password:       mickey
               (YOUR DIARY FILE IS QL032U.LPT)
               (AT TOP OF FILE)
              <QU> list customer salesman sales all
               PORTABLE DEVICES INC  CARLETON SCOTT   1,472.00
               ELECTROSCAN LABS      BILL GLASS      21,500.00
              <QU> top
              <QU> change salesman to 'jim reilly' for custno 23
               SEAFOOD BROKERS INC   JIM REILLY     023456780023302
               0301111020
               ...(UPDATE session continues)...
               ...(you end UPDATE session via END or EXIT)...
              <QA>
              (For a more extensive example see Appendix D.)
**WRITE
FUNCTION:     Allows you to  begin  writing  a  new  query  in  the
              current  query  area.   To  do this IQL puts you into
              'insertion' mode of  the  DECsystem20   text
              editor.
FORMAT:       WRITE [query-name]
SYNONYMS:     REPORT
DEFAULTS:     If you do not furnish a query name, IQL does not give
              a name to the current query.  If you later attempt to
              save or store this query, IQL asks for a name for the
              query at that time.
DISCUSSION:   1)  WRITE  destroys  the  previous  contents  of  the
              current query area.
              2) WRITE works by putting you into  'insertion'  mode
              of  the DECsystem20 text editor.  It prompts for each
              new line by displaying the line number and waits  for
              you  to  enter  the  line.   End  your  lines  with a
              carriage return.
              3) To end input, simply enter an escape  key  as  the
              first  entry  in  the  line.  The editor goes up from
              'insert' to 'edit'  mode.   At  this  point  you  may
              either  correct  any  errors you made in entering the
              query or go on up to IQL assistance mode by  entering
              E.
              4) To correct  errors,  when  you  have  ended  WRITE
              input,  use any of the regular edit subcommands.  See
              the EDIT command.
EXAMPLES:     <QA> write
                                                       Input:
              QC022S.CRD
               00100  open personnel.
               00200  heading 'new hire list'.
               00300  if date-hire geq 770101 print name, dept.
               00400  $ (escape key)
               *e
               [QC022SC.CRD]
              <QA>
              <QA> write   new-hire-list
              Input QC022S.CRD
               00100  oper personnel.          (note error)
               00200  heading 'new hire list'.
               00300  if date-hire geq 770101 print name, dept.
               00400  $ (escape key)
               *p100
               00100  OPER PERSONNEL.
               *SOPER$OPEN$.    (fix error)
               00100  OPEN PERSONNEL.
               *e
               [QC022S.CRD]
              <QA>
**ACCEPT
FUNCTION:     Requests item values from the  terminal.   IQL  first
              issues a prompt for the value then waits for it to be
              entered.  The function of ACCEPT is to allow  you  to
              change  information  or  directives  during the query
              run.
FORMAT:       ACCEPT     item
                        --<---
DISCUSSION:   1) IQL accepts any alpha or  numeric  data  items  as
              well  as  numeric  or  alpha variables.  The accepted
              value replaces  the  previous  value  in  either  the
              current record (in core) or the variable.
              2) you may  use  ACCEPT  anywhere  and  as  often  as
              necessary.
              3) ACCEPT constructs a prompt from the information it
              finds  in  the  dictionary  entry  for the item to be
              accepted - it uses the  item  name,  top  and  bottom
              column  titles, item type, item length, and the scale
              (if any).  See the example below.
              4) IQL checks  accepted  values  as  follows:   Alpha
              items  are  checked  only to be sure they are not too
              long.  Numeric values are checked to make  sure  they
              do  not  have  too many integer or decimal places and
              for illegal (non-numeric) characters.  Numeric values
              may  contain  the  characters  $ + - , .  in context.
              The sign may begin or end  the  value.
              Generally  you  may enter a numeric value any way you
              would write it for another person.
              5) A frequent use of  ACCEPT  is  to  provide  search
              values  for  a  specific run of a query.  To do this,
              use ACCEPT before your OPEN statement (so it is  done
              only once) or under control of FIRSTIME.
EXAMPLES:     (a) using an accepted alpha variable to control an
              extract
                 ACCEPT ASTATE.
                 HEADING 'PROSPECTS IN ' ASTATE.
                 OPEN PROSPECTS.
                 IF STATE = ASTATE
                    PRINT DIRECTOR, SITE, HARDWARE.
              Might result in the prompt and response:
                 *ASTATE 2A: az
              (b) using repeated accepts to find keyed ISAM records
                  DISPLAY 'TO END SEARCH, ENTER "QUIT"'.
                  OPEN PROSPECTS.
                  ACCEPT ANAME.
                  IF ANAME = "QUIT" GO TO XT.
                  FIND KEY = ANAME.
                  DISPLAY ANAME, EQUIPMENT, SALES, PERCENT.
              (c) using IQL like a desk calculator (no OPEN):
                  DISPLAY 'TO QUIT, ENTER 0'.
                  TITLES X = 'ANNUAL//SALARY'.
                10ACCEPT X.
                  IF X = 0 GO TO XT.
                  COMPUTE X1 = X / 2080.
                  DISPLAY 'ANNUAL SALARY:',X,'HOURLY SALARY:',X1.
                  GO TO 10.
**ACROSS
FUNCTION:     Sets IQL to assemble more than  one  'logical'  print
              line  across  a  physical print line;  ie, it permits
              printing several  identically  formatted  lines  from
              different records across the page.
FORMAT:       ACROSS   integer
DEFAULTS:     If you do not use ACROSS in your  query,  IQL  prints
              one  physical  line per print statement;  ie, it acts
              as if you had used ACROSS 1.
DISCUSSION:   1) Each time IQL executes a print statement  it  sets
              up  a  logical  line.  If you do not use ACROSS, that
              logical line is  printed  right  away.   If  you  use
              ACROSS, IQL places the logical lines end to end until
              it has assembled as many  across  as  you  specified;
              then  it  prints  the  composite line.  At the end of
              each stage in the query, any in-progress print  lines
              are printed out.
              2) If you use a horizontal spacing  constant  at  the
              end of a print line, that many spaces are left at the
              end of that line before the next line is placed  next
              to it.
              3) If an assembled line is too long  to  fit  in  the
              space  between  your  left  and  right  margins,  IQL
              truncates the assembled  line  on  the  right  before
              printing it.  No warning is given.
              4) ACROSS is frequently used for setting  up  mailing
              labels  when  several  labels  across  are printed on
              special forms.  However, ACROSS  is  useful  in  many
              other cases for tightening up reports.
              5) The current setting for ACROSS is carried from one
              stage  to the next and from one report to the next in
              a multiple-report query.  If you need  a  new  across
              setting, even if it is 1, you must specifically reset
              it with another ACROSS statement.
EXAMPLES:     (a) mailing labels; (note paging turned off).
              PAGING OFF.             because special form
              TITLES OFF.
              ACROSS 2.               two across
              OPEN ALUMNI.
              VSPACE 3.               three spaces between labels
              PRINT NAME, 5.          name is 25 long
              VSPACE 1.               single space within label
              PRINT STREET,5.         street is 25 long
              PRINT CITY,3,STATE,5.   city 19 long,state 2 long
              PRINT ZIP,25.           zip is 5 long.
              might give:
              ALVIN J COWENS                JEROME C DAVIDSON
              45 MEADOWBROOK BLVD.          4762 FAIRMOUNT
              CLEVELAND HEIGHTS   OH        SHAKER HEIGHTS      OH
              44118                         44120
              ERIE C HOPWOOD                WILLIAM F FRANKLIN
              ..                           ...
**AUTHORITY
FUNCTION:     Provides authorized passwords  to  permit  access  to
              protected files or data items.
FORMAT:       AUTHORITY   password
                         ----<-----
DEFAULTS:     If you do  not  use  AUTHORITY  in  your  query,  IQL
              processes  unprotected  files  or items, but does not
              permit you to run a query which refers  to  protected
              files or items.
DISCUSSION:   1) PASSWORDS WHICH PROTECT FILES OR INDIVIDUAL  ITEMS
              ARE  STORED  (IN  ENCRYPTED  FORM)  AS  PD  (Password
              Definition)  entries  in  IQL  dictionaries.
              2) For using IQL with DBMS data  bases,  one  of  the
              passwords  furnished  in the AUTHORITY statement must
              correspond to the Privacy Key for Compile in the DBMS
              schema.
              3) You may furnish up to 10 passwords in an AUTHORITY
              statement.   The  order  in  which  the passwords are
              furnished does not matter.
              4) If you have used the exclusivity  option  in  your
              dictionary  to protect a specific data item, you must
              furnish  the  exact  password   in   your   AUTHORITY
              statement in order to use that item.
              5) If you have not used exclusivity in protecting  an
              item,  or  for  file  level  protection, the use of a
              particular password  unlocks  all  file  accesses  or
              non-exclusive  items protected at the same or a lower
              level (password number).
EXAMPLES:     Assume dictionary  PERSONNEL  is  read  protected  by
              password BEAR at level 10, and item SALARY is further
              protected by exclusive password TIGER at level 50:
              OPEN PERSONNEL.
              AUTHORITY BEAR.       (required to access any item)
              PRINT NAME, DEPT.
              OPEN PERSONNEL.
              AUTHORITY TIGER.          (required to access SALARY;
              PRINT NAME, SALARY, DEPT.  also unlocks for reading)
**AVERAGE
FUNCTION:     AVERAGE averages a numeric item (a)  over  an  entire
              report  or (b) within a specific value of one or more
              controlling items (breaks).
FORMAT:       AVERAGE   item   [BY   item ] [ ( = variable )]
                                    ---<---
DEFAULTS:     If you do not specify  otherwise  (see  below),  each
              AVERAGE   statement  both  calculates  the  specified
              average and prints it out.
DISCUSSION:   1)  AVERAGE  performs  two  functions:    first,   it
              calculates  the correct average and second, it prints
              the average at the proper time.
              2) AVERAGE is a stand alone  statement;   it  is  not
              necessary  for  you to use TOTAL or TALLY in order to
              use AVERAGE.
              3) If you do not specify a break item ( ie,  BY  item
              ),  the  average is calculated over all records which
              pass through the AVERAGE statement.
              4) If you  specify  a  break  item,  the  average  is
              calculated  and printed when IQL sees a change in the
              indicated item.
              5) You may specify more than one break item  as  long
              as each is minor to one preceeding it.  An average is
              calculated for each such break item.  When  a  change
              in any break item occurs, a change is assumed to have
              occurred in each break item to the right of it in the
              AVERAGE statement.  The purpose of this is to prevent
              inadvertent overlap of minor break items  over  major
              ones.   For instance if we were averaging grade point
              average  for  each  sex  in  each   school   and   we
              encountered  an  all-girls school, AVERAGE GPA BY SEX
              would give a misleading answer while AVERAGE  GPA  BY
              SCHOOL, SEX.  would give the correct one.
              6) Since averaging is an  arithmetic  operation,  the
              item  you  average  must  be  numeric.   However  the
              item(s) controlling the break may be any type.
              7) When AVERAGE prints, it  constructs  a  line  with
              explanatory  text  on the left and the average on the
              right.  For break averages the text is made up of the
              top  and bottom dictionary titles for the break item,
              the value of the  break  item,  the  top  and  bottom
              titles  for  the  averaged item, and the word 'AVG:'.
              See the examples below.
              8) You may override  the  automatic  printing  of  an
              average  by  using the statement SUMPRINT OFF in your
              query.  If you wish to turn on automatic printing  of
              the  average  (or any summary operation) use SUMPRINT
              ON as appropriate.  If you do turn automatic printing
              of  AVERAGE  off,  you  must  do your own printing as
              described in the next paragraph.
              8) You may give a name to the average 'bucket' itself
              by  using  the form ( = variable ) at the end of your
              AVERAGE statement.  The variable name must start with
              either  'X'  or 'ZZ'.  From this point on you may use
              the variable just  like  any  other  item,  including
              using  it  in  computations.   One  such  usage is to
              calculate percentages at the end of a query.  Another
              is  so that you may print the average in a print line
              with  other  data,  often  for   printing   summaries
              directly under details.
EXAMPLES:     (a) HEADING 'ORGANIZATIONAL BUDGETS'.
                  OPEN BUDGET-FILE.
                  AVERAGE BUDGET BY DIV, DEPT.
                  AVERAGE BUDGET.
              might give:
              HOME DEPT 421 ANNUAL BUDGET AVERAGE:    23,921.46
              HOME DEPT 427 ANNUAL BUDGET AVERAGE:    37,446.00
              HOME DEPT 433 ANNUAL BUDGET AVERAGE:    12,777.50
              HOME DIV 110 ANNUAL BUDGET AVERAGE:     24,714.82
              (b)  HEADING 'PRINTING AVERAGES UNDER DETAIL'.
                   SUMPRINT OFF.
                   OPEN LABOR-DETAIL.
                   IF NEWGROUP OF DIV PRINT XACTUAL XLASTYR XCURR.
                   AVERAGE ACTUAL-HRS BY DIV ( = XACTUAL ).
                   AVERAGE LASTYR-HRS BY DIV ( = XLASTYR ).
                   AVERAGE CURR-HRS BY DIV ( = XCURR ).
                   PRINT ACTUAL-HRS LASTYR-HRS CURR-HRS.
**COMPUTE
FUNCTION:     Computes a new value for a numeric item.
FORMAT:       COMPUTE    item   =   [(]    item       [)]
                                  --<----  constant  --<----
                                           [+]
                                           [-]
                                           [*]
                                           [/]
                                  --------------<-----------
DISCUSSION:   1) The item whose value is computed,  and  all  items
              used in COMPUTE, must be numeric.
              2) The  computation  follows  the  normal  inside-out
              algebraic rules pertaining to parentheses.
              3) If no parentheses are used, or within parentheses,
              multiplies  and  divides are done left to right, then
              adds and subtracts are done left to right.
              4) Constants may have a leading sign and may  contain
              imbedded  decimal  points.  For integer constants you
              should leave off the decimal point or imbed  it  (ie,
              write  475  or  475.0  rather than 475.) to avoid any
              possible confusion between  a  decimal  point  and  a
              period ending a statement.
              5) Intermediate computation results  are  carried  to
              thirteen (13) integer and five (5) decimal places.
              6) If a computation overflows (the integer part  gets
              too  big)  IQL  prints and displays an error message,
              truncates the integer, and continues.
              7) Decimal places past the fifth are rounded back  to
              the fifth at each step of a computation.
              8) You must leave at least one space on  either  side
              of  a  parenthesis or arithmetic operator, ie for the
              characters ( ) + - *.  This  is  to  avoid  confusion
              between operators and these characters in item names.
EXAMPLES:     (a)  HEADING "HIGH VOLUME//STORES".
                   OPEN STORES.
                   COMPUTE XRATIO = SALES / SQ-FT.
                   IF XRATIO GR 4.99 SORT BY DESCENDING SALES.
                   PRINT STORE-NAME, MANAGER, SALES, SQ-FT.
              (b)  HEADING 'SALES BONUSES'.
                   OPEN SALESMEN.
                   COMPUTE BONUS =
                   ( WKLY-SAL * 52 ) * ( SALES - QUOTA ) / QUOTA.
                   IF BONUS LS 0 COMPUTE BONUS = 0.
                   AVERAGE BONUS.  TOTAL BONUS.
                   PRINT SALESMAN, QUOTA, SALES, BONUS.
**COPY
FUNCTION:     Copies the current record from the primary  file  out
              to a new file.
FORMAT:       COPY [RECORD] [TO "filename"]
DISCUSSION:   1) The copied file is always the same mode (6-bit  or
              ASCII)  as  the  primary  input file.  If the primary
              input file is a DBMS data base, the  copy  output  is
              ASCII.
              2) COPY may be used after one or more SORT statements
              have  been  used.   in  this  case,  the order of the
              copied file is not the same  as  the  original  input
              file but is the order after the most recent sort.
              3) If you have changed the  value  of  items  in  the
              current  record  (via  SET,  RESET  or  COMPUTE), the
              copied record contains these  changed  values.   This
              feature  is  useful  for making systematic changes in
              files.
              4) If you use COPY under control of  IF,  only  those
              records   where   the  relationship  in  the  IF  was
              satisfied are copied out.
              5) Unless you furnish the  correct  password(s),  IQL
              does  not permit you to copy records when the primary
              input file is protected at either the  read  or  copy
              level.
              6) The copied file can  be  queried  using  the  same
              dictionary which you used to query the original file.
              Be sure to furnish the new  file  name  in  the  OPEN
              statement  so  you  query  the  copied  and  not  the
              original file.
              7) If you do not use the filename option,  IQL  gives
              the  file the same name as the primary input file and
              adds the extension ".OUT".  The file  is  written  on
              device DSK.
              8) If you use the filename option  but  the  filename
              does  not  contain  a  device, IQL uses the furnished
              filename and writes out the  copied  file  on  device
              DSK.
              9) If you use the filename option and  do  furnish  a
              device,  IQL  writes out the file under the furnished
              name and on the specified device.
              10) IQL  always  writes  output  files  in  the  same
              Directory in which the job is being run.
              11) If a file already exists which has the same  name
              as  the  one IQL is to write, IQL writes over the old
              file.
EXAMPLES:     (used in a complete query):
              OPEN ACCOUNTS.
              IF VENDOR-NO = 100 SET SALESMAN TO 'JONES'.
              COPY TO "ACCTS.SEQ".
              OPEN ACCOUNTS.
              IF BALANCE GR 999 SORT ACCOUNTS BY BALANCE.
              COPY RECORD.
**CREATE
FUNCTION:     Writes out a file whose records contain only specific
              items  and are formatted as specified in the 'CREATE'
              statement itself.  CREATE records may contain  record
              or  data  items for any input file as well as working
              items or filler positions.
FORMAT:       CREATE  ["filename"]  [=]    item
                                         literal
                                         FILLER =  integer
                                        --------<----------
DISCUSSION:   1) The record created is formatted from left to right
              by  putting  the item value side by side in the order
              named in your  CREATE  statement.   Numeric  variable
              values  are  written  as numeric (not binary) with 13
              integer and  5  decimal  places.   Binary  items  are
              converted  to numeric before being put in the created
              record.
              2) Created files are always written in ASCII mode.
              3) If you do not  use  the  filename  option,  CREATE
              writes  the  created file out on device DSK under the
              name CREATE.OUT.
              4) If you use the filename option but do not  furnish
              a  device,  CREATE  uses  the  furnished filename and
              writes the file out on device DSK.
              5) If you use the filename option and  do  furnish  a
              device,   CREATE   writes  out  the  file  under  the
              furnished filename and on the specified device.
              6)  IQL  always  writes  output  files  in  the  same
              Directory in which the job is being run.
              7) If a file already exists with the same filename as
              the  one  CREATE  is to write, it writes over the old
              file.
EXAMPLE:      HEADING 'HIGH VALUE//INVENTORY ITEM//ANALYSIS'.
              TITLES X = 'ITEM//VALUE'.
              PICTURE X = '$$$,$$$.99'
              OPEN INVENTORY PRICES.
              FIND PRICE-PARTNO = INVENTORY-PARTNO.
              IF PRICE GR 100 COMPUTE X = PRICE * QTY
                CREATE 'COST.SEQ' =
              PARTNO,PRICE,QTY,FILLER = 5,'VALUE',X
                PRINT PARTNO, PRICE, QTY, X.
**DATE
FUNCTION:     (a) Turns report dating on or off;  or (b) Gives your
              report  a  specific  date  value  to  print  in  page
              headings.
FORMAT:       DATE   [ON]
                     [OFF]
                     constant
                     literal
                     item
DEFAULTS:     If you do not use DATE in your query,  report  dating
              is automatically turned on - IQL puts the date of the
              run in report headings.
DISCUSSION:   1) You may turn report dating on or  off,  or  change
              the value of the report date, at any point.
              2) If you use DATE OFF, IQL does not put anything  at
              the top left of the page heading.
              3) If you use DATE ON, report dating is turned on and
              IQL  puts  the  date  the  report  is  run, formatted
              MM/DD/YY, at the top left of each page heading.
              4) If you furnish a value in DATE, report  dating  is
              turned on and the value is printed at the top left of
              the page heading.  The value may  be  a  constant,  a
              literal,  or  an item value.  If it is a constant, it
              must contain  six  digits  and  it  is  printed  with
              slashes inserted after the 2nd and 4th digits.  If it
              is a literal, it is printed exactly as furnished.  If
              it  is an item value, it is edited per the picture in
              the dictionary entry for that item.
              5) RPTDATE is a synonym for DATE.  It is carried over
              from previous versions of IQL.  Use DATE.
EXAMPLES  (individual commands):
              DATE ON
              DATE OFF
              DATE 060377          (prints as 06/03/77)
              DATE '3 JUNE 1977'   (prints as 3 JUNE 1977)
**DISPLAY
FUNCTION:     (a) Allows you to display messages or reports on your
              terminal  while  the  query  is running, or (b) Turns
              automatic terminal display of reports on or off.
FORMAT:       (a)  DISPLAY     item
                               literal
                               integer
                             -----<------
              (b)  DISPLAY     [ON]
                               [OFF]
DEFAULTS:     If you do not use DISPLAY ON or DISPLAY OFF  in  your
              query, IQL turns display mode on.
DISCUSSION:   1) Lines created by DISPLAY go only to your terminal.
              They   are  single  spaced.   No  column  titles  are
              displayed.
              2) Item values are laid out in your display line from
              left   to   right  as  they  occur  in  your  DISPLAY
              statement.  Unless you specify otherwise as described
              below,  three  spaces  are  left horizontally between
              item values.
              3) If you use an integer in your  display  statement,
              that many spaces are left between item values for the
              rest of the display  line  or  until  IQL  encounters
              another  such  spacing integer.  The use of a spacing
              integer overrides any other horizontal spacing.
              4) If you have not used a  spacing  integer  and  use
              HSPACE  in  your  query,  IQL  leaves  as many spaces
              between items as you specify in the HSPACE statement.
              5) Before being put in the display line, item  values
              are edited according to the picture in the dictionary
              (or any override picture you furnish).
              6) Generally DISPLAY is used  for  short  prompts  or
              progress report messages.  To put out reports on your
              terminal, use  PRINT;   it  has  much  more  powerful
              built-in formatting capability.
EXAMPLE:      DISPLAY 'ENTER CUT OFF TIME'.
              ACCEPT XTIME.
              OPEN RACE-RESULTS.
              IF RACE-TIME LEQ XTIME TALLY XRACER-NAME.
              IF XTALLY GEQ 100
                   DISPLAY 'TOO MANY BEAT THIS TIME; LOWER LIMIT'
                   GO TO XT.
              GO TO NR.
**FIND-ITEM
FUNCTION:     Does a sequential read of  a  secondary  (either  the
              second  or  third named file in the 'OPEN' statement)
              file.  Permits you to position this file on either  a
              specific value or the value of some other data item.
FORMAT:       FIND data-item = item [FROM BEGINNING]
                               literal
                               NEXT
DEFAULTS:     If you do not use FROM BEGINNING, IQL starts  reading
              from the current position of the file;  ie, the first
              record read is the next after the current record.
DISCUSSION:  1) You may use FIND item on either sequential or  ISAM
              files.   For  the latter it is useful for positioning
              on other than the key item.
              2) The item named on the left of the = tells IQL wich
              file it is to read.  This item name must be unique to
              the dictionary describing that file.  If  it  is  not
              unique,  make  it  so  by  prefixing  the name of the
              dictionary and a dash (ie:  SSNO in PERSONNEL is  the
              same as PERSONNEL-SSNO).
              3) IQL searches the file until  it  either  satisfies
              the  =  relationship or hits the end of the file.  If
              it hits the end of the file, it returns an all spaces
              record and continues.
              4) You may test to see if you are at  the  end  of  a
              file  by  using  IF  EOFn.  See the discussion in the
              section describing IF.
EXAMPLES:     OPEN PAYROLL, PERSONNEL.
              FIND PERSONNEL-SSNO = PAYROLL-SSNO.
              PRINT NAME, SSNO, WITHHOLDING-RATE.
              In the above example, the social security  number  is
              called   SSNO  in  both  the  PAYROLL  and  PERSONNEL
              dictionaries.  In the FIND statement it is  necessary
              to  qualify them.  In the PRINT statement, we can use
              SSNO since by that time they are the same.
**FIND-KEY
FUNCTION:     Reads ISAM (Indexed Sequential Access  Method)  files
              randomly  based on either the value of a data item or
              one or more specific values.  Permits reading  on
              either full or partial keys.
FORMAT:       (a) FIND    KEY   =    literal
                          KEYn       literal   THRU   literal
                                     literal   THRU   EOF
                                    -------------<--------------
               (b) FIND    KEY  =  item
                           KEYn
DISCUSSION:   1) If you do not use FIND KEY and you are  processing
              an  ISAM  file, IQL reads the ISAM file sequentially.
              This is useful for searches on items  which  are  not
              key items.
              2) If you use FIND KEY = literal, IQL  goes  directly
              to  the record which has that value of the literal as
              the full or partial (leading portion) key.  It  gives
              an  end  of  file  response  if  it does not find the
              record.
              3) If you use  a  range  of  literals  (literal  THRU
              literal  or  literal  THRU  EOF), IQL starts with the
              first record whose key is in the range, and each time
              it executes the FIND command it reads the next record
              in the  range.   If  you  use  several  such  literal
              ranges,  when  it  exhausts  one range it goes to the
              first record in the next.  The end-of-file  condition
              occurs  only when the last range is exhausted.  It is
              not necessary that the  ranges  be  in  any  specific
              order of key.
              4) If you use FIND KEY = item, IQL looks for a record
              which  has  as a key the value of the indicated item.
              If it does not find such a record, it returns an  all
              spaces record and continues.
              5) To read your primary file, use the form  FIND  KEY
              or  FIND KEY1.  To read your secondary file, use FIND
              KEY2, and to read your tertiary file, use FIND KEY3.
**FIND-DBMS
FUNCTION:     Reads DBMS data bases.
FORMAT:       (a)  FIND  recordname  USING  item
              (b)  FIND  NEXT  recordname  RECORD OF  setname  SET
                         PRIOR                        areaname AREA
                         FIRST
                         LAST
              (c)  FIND  OWNER  RECORD  OF  setname  SET
              (d)  FIND  recordname  RECORD
DISCUSSION:   1) The FIND format shown above is the same format  as
              DBMS FIND statements in COBOL.
              2) No GET is necessary;  IQL treats  FIND  as  if  it
              were both FIND and GET.
              3) If IQL cannot find a  record,  or  encounters  any
              other  data base error, it returns an error status in
              the special item ERROR-STATUS and the error count  in
              special  item ERROR-COUNT.  You may test ERROR-STATUS
              and ERROR-COUNT for specific values.  Please refer to
              your   DBMS   manual   for   the   meaning  of  these
              error/status codes.   For  convenience  of  reference
              here:   307 means 'end of area' and 326 means 'record
              not  found'.   Often  you  will  end  your  query  on
              receiving Error-status 307:
                 IF ERROR-STATUS = 307 GO TO XT.
              4) If you are  using  FIND  FIRST  or  FIND  NEXT  be
              careful to not put IQL into an unending loop.
              5) You may suppress currency updates for ALL, RECORD,
              AREA  or SET by appending a Suppression Clause to the
              FIND  formats  described  above.   The  format  of  a
              Suppression Clause is:
                  SUPPRESS ALL    CURRENCY UPDATES
                           RECORD
                           AREA
                           SET
EXAMPLES:
              HEADING 'BRANCH//SORTED'.
              OPEN MASTER.
              IF FIRSTIME FIND FIRST BRANCH RECORD OF AREA1 AREA
                  ELSE FIND NEXT BRANCH RECORD OF AREA1 AREA.
              IF ERROR-STATUS = 307 GO TO XT.
              IF ERROR-STATUS NEQ 0 GO TO QT.
              SORT MASTER BY BRANCH-NUMBER.
              PRINT BRANCH-NUMBER, BRANCH-NAME.
              The  above  example  prints  out,  in  branch  number
              sequence, all the branch names and their numbers.
**FORM-LINES
FUNCTION:     Specifies  the   number   of   printed   lines   from
              perforation  to  perforation of your paper.  IQL uses
              this count to position at the top of  the  each  page
              when output is on a terminal.
FORMAT:       FORM-LINES integer
DEFAULTS:     If you do not use FORM-LINES in your query, IQL  uses
              a  count  of 66 printed lines from one perforation to
              the next.
DISCUSSION:   1) The companion to FORM-LINES is PAGE-LINES.
              2) If the constant in FORM-LINES  is  less  than  the
              current setting of PAGE-LINES, IQL accepts the change
              but also resets PAGE-LINES down to the new  value  of
              FORM-LINES.   In  other  words,  the  system does not
              permit more lines per page than lines per form.
              3) FORM-LINES and PAGE-LINES are useful when you  are
              preparing  reports on a terminal or a printer and the
              paper is other than standard size.
EXAMPLE:      FORM-LINES 44.
              PAGE-LINES 36.
              OPEN MASTER.
              PRINT TITLE, PURPOSE, AMOUNT.
**GO
FUNCTION:     Sends control to (a) a designated statement,  (b)  to
              read the next record, (c) end the query stage, or (d)
              end the query run.
FORMAT:       GO TO   NR
                      XT
                      QT
                      integer
DISCUSSION:   1) if you use GO TO NR, IQL goes immediately  to  the
              statement  just  after  the OPEN or SORT which begins
              the current stage of the query.  Unless you are doing
              your  own reading of a data base or an ISAM file, IQL
              does a sequential read of  the  next  record  of  the
              primary file at this point.
              2) If you use GO TO XT, IQL closes  out  the  current
              stage  of  the query, closes any open files, wraps up
              any in-progress summary statements and  goes  to  the
              next  stage of the query.  If there is no next stage,
              IQL goes back up to Assistance mode.  Do not  use  GO
              TO  XT  to  get  from  one  report  to  the next in a
              multiple report query;   use  GO  TO  integer,  where
              integer  is  the  next  REPORT  statement.   See  the
              examples below.
              3) If you use GO TO QT, IQL closes  any  open  files,
              wraps  up any in-progress summary statements and goes
              back up to  Assistance  mode  regardless  of  whether
              there  is another stage to the query.  The purpose of
              GO TO QT is to let you terminate a multi-stage  query
              at any point.
              4) If you use GO TO integer, the integer  must  be  a
              statement number used elsewhere in this stage of your
              query.  This form of GO  TO  is  useful  for  routing
              control in a query.  Be sure you do not route control
              out  of  the  current   stage;    the   results   are
              unpredictable.
              5) Each query acts as if it had GO  TO  NR.   as  the
              last statement in each stage;  it is not necessary to
              write it.
EXAMPLES:       OPEN ACCOUNTS-RECEIVABLE.
                IF STATUS NOT EQ 'A' GO TO NR.
                IF AMT LS 1000 GO TO NR.
                TALLY ACCT ( = X ).
                IF X GEQ 500 PRINT 'TOO MANY; KICK TEST AMOUNT'
                    GO TO QT.
                SORT BY DESCENDING AMT, ACCOUNT.
                REPORT 1.
                  IF ZIP LEQ 50000 GO TO 10.
                  HEADING 'WESTERN HIGH BALANCE ACCTS RECEIVABLE'
                   '//ATTN: PHYLLIS CHAMBLISS'.
                  PRINT ACCT, AMT, VENDOR, CREDIT, DATE.
                  GO TO 20.
             10 REPORT 2.
                  HEADING 'EASTERN HIGH BALANCE ACCTS RECEIVABLE'
                   '//ATTN: JOSEPH LEGUIN'.
                  PRINT ACCT, AMT, VENDOR, CREDIT, DATE.
             20 SORT BY STATE, DESCENDING AMT.
                HEADING 'HIGH ACCTS RECEIVABLE BY STATE'.
                PRINT STATE, ACCOUNT, AMNT.
**HEADING
FUNCTION:     (a) turns automatic page headings on or off,  or  (b)
              furnishes specific text for page headings.
FORMAT:       (a) HEADING     ON
                              OFF
              (b) HEADING     literal
                              item
                              integer
                            ------<------
defaults:     If you do not use HEADING in your query, headings are
              automatically  turned  on and the heading text in the
              center is blank.
DISCUSSION:   1) You may turn headings on or off at any  point  and
              as often as necessary.
              2) If  you  have  turned  headings  off,  IQL  starts
              printing the body of the report as soon as it goes to
              a new page.
              3) If headings are turned on, when IQL goes to a  new
              page  it  prints a page heading which consists of the
              report date on the top left, a page number on the top
              right and one or more lines of report heading text in
              the center.  You may turn off or set any  or  all  of
              these ingredients of the page heading.
              4), If you use form (b), headings are turned on.
              5) The text in form (b) is exactly the same as for  a
              print  line  with  the  exception  that if IQL sees a
              double slash (//) in a literal it starts a new  line.
              Note  that  since  you  may use items in the heading,
              part or all of the heading may come from the  current
              record or variable values.
              6) Each line of heading text is centered at  the  top
              of  each  page.   The "center" is halfway between the
              current left and right margins.
              7) If you are creating only  one  report,  the  query
              will  run  faster  if  you put your HEADING statement
              before your OPEN statement so  that  it  is  executed
              only once.
              8) Headings, once set,  stay  set  until  you  change
              them.
              9) 'RESUMEHEADING' is a synonym for 'HEADING ON'  and
              'NOHEADING'  is  a  synonym for 'HEADING OFF'.  These
              formats are carried over  from  earlier  releases  of
              IQL.   HEADING ON and HEADING OFF are the recommended
              formats.  The older formats may not be  supported  in
              future versions of IQL.
              10) Also see:  NEWPAGE, PAGING.
EXAMPLES      (used in a query):
              HEADING OFF
              OPEN ACCOUNTS
              IF FIRSTIME PRINT 'THIS IS MY OWN CUSTOM HEADING'
                  PRINT ACCOUNT, BUYER, BALANCE.
              HEADING "ACCOUNTS//PAYABLE//SUMMARY BY DEPT", DEPT.
              OPEN PAYABLES.
              SORT BY DEPT, PO-DATE.
              IF NEWGROUP OF DEPT NEWPAGE.
              PRINT PO-DATE, VENDOR, APPROVAL, AMOUNT.
**HOLD
FUNCTION:     Holds the value of  each  named  item  in  a  special
              holding area so you may retrieve it at any time.
FORMAT:       HOLD         item
                          ---<---
DISCUSSION:   1) You may HOLD any numeric or alpha item as well  as
              numeric or alpha variables.
              2) To refer to a held item, prefix the item name with
              HELD-.  For instance:  HOLD NAME...  PRINT HELD-NAME.
              3) A held value stays  intact  until  you  hold  that
              specific item again.
              4) The initial value of a held item is blank  for  an
              alpha item and zero for a numeric item.
EXAMPLES:     HEADING "DUPLICATED NAMES".
              OPEN CLIENT-FILE.
              SORT BY NAME.
              IF NAME = HELD-NAME PRINT NAME.
              HOLD NAME.
              HEADING "BLIZZARD//DAMAGE//BY CITY".
              SUMPRINT OFF.
              OPEN DAMAGE-REPORTS.
              SORT BY CITY.
              IF NEWGROUP OF CITY PRINT HELD-CITY, X.
              TOTAL DAMAGE BY CITY ( = X ).
              HOLD CITY.
**HSPACE
FUNCTION:     Sets the default horizontal  spacing  increment  that
              IQL  uses  between  items  when setting up a print or
              display line.
FORMAT:       HSPACE integer
DEFAULTS:     If you do not use HSPACE  in  your  query,  IQL  puts
              three  spaces  between  items  in  a print or display
              line.
DISCUSSION:   1) You may  use  HSPACE  anywhere  and  as  often  as
              necessary.
              2) If you use specific horizontal spacing in a  PRINT
              statement  it  overrides  the current HSPACE setting.
              The latter remains unchanged.
              3) If you change HSPACE in one report of  a  multiple
              report query, that setting carries from one report to
              the next, unless you change it.
              4) If you are only using one HSPACE for all  reports,
              put  the  HSPACE  statement  before the OPEN so it is
              executed only once.  The query will run faster.
EXAMPLES:     HSPACE 5.
              LMARGIN 15.
              OPEN PUBLICATIONS.
              PRINT LIB-CONGRESS-NO, AUTHOR, TITLE.
              OPEN PUBLICATIONS.
              REPORT 1.
              HSPACE 3.        (to reset from next report)
              PRINT AUTHOR, TITLE.
              REPORT 2.
              HSPACE 10.
              IF CAT = 'REF' PRINT PUB-DATE,TITLE,PUBLISHER.
**IF
FUNCTION:     Specifies a condition for IQL to test.  Depending  on
              whether  the condition is satisfied or not, the query
              statements which follow are carried out.  Control  of
              the IF ends when IQL encounters a period.
FORMAT:       IF item   [NOT]  relation  item      AND .. [ELSE ..]
                 constant                constant  OR
                 literal                 literal
                ----------------<---------------------
              IF    FIRSTIME  .. [ELSE  ..]
                    LASTIME
                    BOF1
                    BOF2
                    BOF3
                    EOF1
                    EOF2
                    EOF3
DISCUSSION:   1)  Relationships  may  be  written  in  any  of  the
              following ways:
              RELATION
              equal                     EQ   EQUALS  =   IS
              not equal                 NQ   NE      <>  NEQ
              less than                 LS   LT      <   LESS
               greater than             GR   GT      >   GREATER
              less than or equal to     LEQ  LE      <=  LQ
              greater than or equal to  GEQ  GE      >=  GQ
              2)  Note  that  you  may  use  NOT   to   reverse   a
              relationship.   For  instance:  NOT EQ is the same as
              NE;  and NOT LEQ is the same as GR.
              3) You may combine simple  relationships  to  make  a
              complex  relationship by joining them with AND or OR.
              You  may   use   parentheses   to   clarify   complex
              relationships.   Within  parenthese, or if you do not
              use parentheses, all OR's are  evaluated  before  any
              AND's.
              4) If you use ELSE, the statements which  follow  are
              carried out only if the condition is not satisfied.
              5) If you are  comparing  two  numbers,  the  decimal
              points  are  lined  up  and  any necessary leading or
              trailing zeroes are supplied before the comparison is
              made.
              6) If you are comparing two alpha items or  literals,
              any  necessary  trailing  spaces  are  added  to  the
              shorter item before the comparison is made.
EXAMPLES:     (a) cutting off a query:
                  HEADING "SALES DETAIL".
                  OPEN SALES.
                  PRINT PO-NO,ACCOUNT.,LINE,ITEM,QTY,AMOUNT.
                  COMPUTE X = X + 1. IF X GEQ 50 GO TO XT.
              (b) comparing against a held item; exception report:
                  HEADING 'DUPLICATES IN INVENTORY FILE'.
                  OPEN INVENTORY.
                  SORT BY PART-NO.
                  IF FIRSTIME HOLD PART-NO GO TO NR.
                  IF PART-NO EQ HELD-PART-NO
                      PRINT PART-NO GO TO NR.
                  HOLD PART-NO.
              (c) using ANDs and ORs:
                  HEADING 'CANDIDATES FOR EXECUTIVE BOARD'.
                  OPEN PERSONNEL.
                  IF JOB = 'EXC' OR JOB EQ 'MGR' GO TO 10.
                  IF SALARY-CLASS GEQ 7 AND YR-HR LEQ 68 GO TO 10.
                  GO TO NR.
                10 PRINT NAME,JOB,DIV,DEPT,SALARY-CLASS,YR-HR.
              (d) using parentheses and ELSE:
                  HEADING "REGION 9 SPECIAL ATTENTION ACCOUNTS".
                  OPEN ACCOUNTS.
                  IF ( LASTYR GEQ 50000 OR THISYR GEQ 25000 OR
                     ( RATING = "A" AND PROJECTION GEQ 50000 ) )
                     AND ( STATE EQ "CA", "OR", "WA", "UT" )
                     PRINT CUSTNAME,STATE,LASTYR,THISYR
                     TOTAL LASTYR-SALES
                     ELSE TALLY CUSTNAME.
**LMARGIN
FUNCTION:     Sets the left margin for printing reports.
FORMAT:       LMARGIN integer
DEFAULTS:     If you do not use LMARGIN in your query, IQL  uses  a
              left margin of 1.
DISCUSSION:   1) You may use LMARGIN any place in your  query,  and
              as often as necessary.
              2) LMARGIN settings are  carried  from  one  multiple
              report  to  the next unless you use LMARGIN to change
              them.
              3) LMARGIN affects all of:   page  headings,  summary
              lines and detail print lines.
EXAMPLES:     (a)  LMARGIN 15.
                   HEADING 'MEMBER EXTRACT'
                   OPEN MEMBER-FILE.
                   IF SUBSCRIPTION GEQ 1000
                       PRINT NAME, DATE, SUBSCRIPTION.
              (b)  OPEN SALES.
                   SORT BY STATE.
                   REPORT 1.
                   HEADING 'SALES DETAIL'.
                   LMARGIN 1.          (to reset from 2nd report)
                   PRINT ACCT, SALESMAN, GROSS, PROJECTION.
                   TOTAL GROSS.  TOTAL PROJECTION.
                   REPORT 2.
                   LMARGIN 10.
                   HEADING 'HIGH VOLUME//SUMMARY'.
                   IF GROSS GEQ 10000
                       TALLY ACCOUNT BY STATE
                       TOTAL GROSS BY STATE.
**MAXIMUM
FUNCTION:     Calculates the maximum value of a  numeric  item  (a)
              over  an entire report or (b) within a specific value
              of one or more controlling items (breaks).
FORMAT:       MAXIMUM   item  [BY    item  ] [ ( = variable ) ]
                                    ---<--
DEFAULTS:     If you  do  not  specify  otherwise  in  your  query,
              MAXIMUM  both  calculates  the  requested maximum and
              prints the result at the proper time.
DISCUSSION:   1)  MAXIMUM  performs  two  functions:    first,   it
              calculates  the correct maximum, and second it prints
              the maximum in your report at the proper time.
              2) MAXIMUM is a stand-alone  statement.   It  is  not
              necessary that you use any other summary statement to
              use MAXIMUM.
              3) If you do not specify a break item (ie, BY  item),
              the  maximum is calculated overall records which pass
              through the MAXIMUM statement.
              4) If you  specify  a  break  item,  the  maximum  is
              calculated and printed on the change in the indicated
              item.  If you  specify  more  than  one  break  item,
              MAXIMUM breaks on a change in any of the break items.
              5) Since taking a maximum is an arithmetic operation,
              the  item  you  get  the  maximum of must be numeric.
              However, the item controlling the break  may  be  any
              type.
              6) When MAXIMUM prints, it  constructs  a  line  with
              explanatory  text  on the left and the maximum on the
              right.  The explanatory text is made up  of  the  top
              and  bottom dictionary titles for the break item, the
              value of that item before  the  break,  the  top  and
              bottom  titles  for  the  item whose maximum is being
              taken, and 'MAX:'.  For overall maximums, the  titles
              and  value  for  the  break  item  are  replaced with
              'OVERALL'.
              7) You may override the  automatic  printing  of  the
              maximum  by using SUMPRINT OFF in your query.  If you
              wish to turn automatic printing of the  maximum  back
              on  use  SUMPRINT  ON as appropriate.  If you do turn
              summary printing off, you must do your  own  printing
              as described in 8 below.
              8) You may give a name to the maximum  bucket  itself
              by  using  the  for ( = variable ) at the end of your
              maximum statement.  The variable name must start with
              'X'  or  'ZZ'.   From  this  point on you may use the
              variable just like any other item.  The most frequent
              use  of  giving  a name to a maximum bucket is so you
              may use it in a print line with  other  items,  often
              for printing summaries under detail.
EXAMPLES:     OPEN PAYROLL.
              SORT BY JOB-CLASS.
              MAXIMUM SALARY BY JOB-CLASS.
              MAXIMUM SALARY.
              SUMPRINT OFF.
              OPEN TEAM-SCORES.
              MINIMUM SCORE ( = XMIN ).
              MAXIMUM SCORE ( = XMAX ).
              IF LAST TIME
                 COMPUTE XPCT = 100 * ( XMAX - XMIN ) / XMIN
                 PRINT 'MAX:MIN PCT ' XPCT.
**MINIMUM
FUNCTION:     Calculates the minimum value of a  numeric  item  (a)
              over  an entire report or (b) within a specific value
              of one or more controlling items (breaks).
FORMAT:       MINIMUM item   [BY  item ] [ ( = variable ) ]
                                 ---<--
DISCUSSION:   1)  MINIMUM  performs  two  functions:    first,   it
              calculates  the  requested  minimum  and  second,  it
              prints the minimum in your report at the proper time.
              2) MINIMUM is a  stand-aone  statement;   it  is  not
              necessary for you to use another summary statement in
              order to use MINIMUM.
              3) If you do not specify a break item ( ie,  BY  item
              ),  the  minimum is calculated over all records which
              pass through the MINIMUM statement.
              4) If you  specify  a  break  item,  the  minimum  is
              calculated and printed on the change in the indicated
              item.  If you  specify  more  than  one  break  item,
              MINIMUM breaks on a change in any of the break items.
              5) Since taking a minimum is an arithmetic operation,
              the  item  you  take  the minimum of must be numeric.
              However the break item may be any type.
              6) When MINIMUM prints, it  constructs  a  line  with
              explanatory  text  on the left and the minimum on the
              right.  For break minimums, the explanatory  text  is
              made  up  of the top and bottom dictionary titles for
              the break item, the value before the break,  the  top
              and bottom titles for the item whose minimum is being
              taken, and the word 'MIN:'.  For non-break  minimums,
              the  break  item  titles  and  value  are replaced by
              'OVERALL'.
              7) You may override the  automatic  printing  of  the
              minimum by using SUMPRINT OFF in your query.  To turn
              automatic  printing  back  on,  use  SUMPRINT  ON  as
              appropriate.   If you do turn off automatic printing,
              you must do your  own  printing  as  described  in  8
              below.
              8) You may give a name to the minimum  bucket  itself
              by  using  the form ( = variable ) at the end of your
              MINIMUM statement.  The variable name must start with
              'X'  or  'ZZ'.   From  this  point on you may use the
              variable just like any other item, including using it
              in  computations.   One  frequent  such  use  is  for
              calculating percentages.  Another is so you  may  use
              the  minimum  in a print line with other items, often
              for printing minimums under detail.
EXAMPLES:     OPEN ACCOUNTS.
              MINIMUM BALANCE BY ACCOUNT-CLASS.
              TOTAL BALANCE BY ACCOUNT-CLASS.
              MINIMUM BALANCE.  MAXIMUM BALANCE.
              TOTAL BALANCE.    AVERAGE BALANCE.
              SUMPRINT OFF.
              OPEN INVENTORY.
              MINIMUM QUANTITY ( = ZZQTY ).
              MINIMUM VALUE ( = ZZVAL ).
              IF NEWGROUP OF CLASS
              PRINT ZZQTY, ZZVAL.
              PRINT QUANTITY,VALUE,CLASS.
**NEWPAGE
FUNCTION:     Goes immediately to a new page of the current report.
FORMAT:       NEWPAGE
DISCUSSION:   1) Any time you use NEWPAGE, IQL goes immediately  to
              a new page of the report.  This happens regardless of
              whether paging is on or off.
              2) If you have turned paging off, NEWPAGE goes  to  a
              new page anyway, but it does not turn paging back on.
              3) When IQL pages it  prints  a  page  heading  which
              consists  of  the  report  date on the left, the page
              number on the right, and one or more lines of  report
              heading  prose  in  the  center.  It does this before
              starting to print the body  of  the  report  on  that
              page.   You  may  individually turn off or set any of
              these ingredients of the page heading.
              4) Also see:  HEADING, PAGING
EXAMPLE       (used in an IF):
              HEADING 'BUDGET SUMMARY BY DEPARTMENT'.
              OPEN BUDGET-FILE.
              SORT BY DEPT, ACCOUNT.
              IF NEWGROUP OF DEPT NEWPAGE.
              TOTAL BUDGET-AMOUNT BY ACCOUNT.
              TOTAL BUDGET AMOUNT BY DEPT.
**OPEN
FUNCTION:     Tells IQL which dictionaries and which files  to  use
              in this query.
FORMAT:       OPEN   dictionary  ["filename"]
                    ----------<---------------
DEFAULTS:     If you do not furnish a filename in  quotes  after  a
              dictionary  name,  IQL reads from the file whose name
              it finds in the dictionary.
DISCUSSION:   1) Only one OPEN statement may be used  in  a  query.
              There  must  be  an  OPEN  statement  before any SORT
              statements.
              2) You may use from one to three dictionary names  in
              an  OPEN  statement,  depending on how many files you
              wish to process in the query.
              3) The file described by the first dictionary in  the
              OPEN  statement  is  called the "Primary" file.  This
              file controls this phase of the query.  If  it  is  a
              sequential file, IQL automatically reads it, the read
              coming immediately after the OPEN statement.  If  the
              primary file is an indexed sequential (ISAM) file and
              you do not do  your  own  reading  with  a  FIND  KEY
              statement, IQL automatically reads it sequentially.
              3) If you use more than one dictionary name  in  OPEN
              the   files   described   by  the  second  and  third
              dictionaries are 'subordinate' files.   You  must  do
              your own reading of these files by appropriate use of
              FIND item or FIND KEYn.  Normally  subordinate  files
              are  read  under  control of information you get from
              the Primary file.
              5) When IQL  comes  to  the  last  statement  in  the
              FIRST stage or it encounters a "GO TO NR", IQL goes
              directly to the statement just after the OPEN.  If it
              is  reading sequentially as described above, it reads
              the next record before carrying out the statement.
              6)  Any  statements  which  come  before   the   OPEN
              statement  are carried out only once at the beginning
              of the query and before any records  are  read.   The
              query  runs  faster  if  you  put one-time formatting
              statements here when you  are  not  going  to  change
              formats during the run.
**PAGE
FUNCTION:     Specifies a new  page  number,  overriding  automatic
              page numbering.
FORMAT:       PAGE     integer
                       variable
                       item
DEFAULTS:     If you do not use PAGE in your query, IQL starts page
              numbers  at  1  and  automatically increases the page
              number each time it pages.
DISCUSSION:   1) You may use any of:  integer constants,  variables
              or numeric data items on the right of a PAGE command.
              If the quantity  is  not  numeric,  the  results  are
              unpredictable.
**PAGE-LINES
FUNCTION:     Specifies the maximum number  of  printed  lines  you
              wish IQL to put on each page of your report.
FORMAT:       PAGE-LINES  integer
DEFAULTS:     If you do not use PAGE-LINES in your query, IQL  uses
              a  count  of 58 printed lines as the maximum for each
              page of your report.
DISCUSSION:   1) The companion to PAGE-LINES is FORM-LINES.
              2) The difference between FORM-LINES  and  PAGE-LINES
              is the number of blank lines at the top and bottom of
              each page.
              3) If the constant in PAGE-LINES is greater than  the
              current setting of FORM-LINES, IQL accepts the change
              but also resets FORM-LINES up to  the  new  value  of
              PAGE-LINES.   In  other  words,  the  system does not
              permit more lines per page than lines per form.
              4) FORM-LINES and PAGE-LINES are useful when you  are
              preparing  reports  on  a printer or terminal and the
              pagper is other that standard size.
EXAMPLE:      FORM-LINES 44.
              PAGE-LINES 36.
              OPEN MASTER.
              PRINT TITLE, PURPOSE, AMOUNT.
**PAGING
FUNCTION:     Turns automatic report paging on or off.
FORMAT:       PAGING    [ON]
                        [OFF]
DEFAULTS:     If you do not use PAGING in  your  query,  paging  is
              automatically turned on - IQL goes to a new page when
              it reaches the bottom of the current page.
DISCUSSION:   1) You may turn paging on or off at any point, and as
              often as necessary.
              2) If you have turned paging off,  IQL  prints  right
              past the perforation (if any) on the paper.
              3) When IQL pages it  prints  a  page  heading  which
              consists  of  the  report  date on the left, the page
              number on the right, and one or more lines of  report
              heading  prose  before it starts to print the body of
              the report.  You may individually turn of or set  any
              or all of these ingredients of the page heading.
              4) If paging is off, then headings are  automatically
              off  also.  If you want a heading at the beginning of
              the run,  use  PAGING  OFF  after  your  first  PRINT
              statement.
              5) 'RESUMEPAGING' is a synonym for  'PAGING  ON'  and
              'NOPAGING'  is  a  synonym  for  'PAGING OFF'.  These
              formats are carried over  from  earlier  releases  of
              IQL.
              6) Also see:  HEADING, NEWPAGE, DATE, PAGE.
EXAMPLES:     (used in a query):
              OPEN ACCOUNTS.
              REPORT 1.
              PAGING OFF.
              ACROSS 3.
              PRINT ACCOUNT-NAME,3.
              PRINT CITY,1,STATE,ZIP,3.
              REPORT 2.
              PAGING ON.
              HEADING "SUMMARY OF BALANCES BY ZIP".
              TOTAL BALANCE BY ZIP.
              PRINT ACCOUNT-NAME, BALANCE.
**PICTURE
FUNCTION:     Furnishes a picture for one or more  items.   May  be
              used  either  to  override  dictionary pictures or to
              furnish pictures for variables.
FORMAT:       PICTURE     item    =   "picture"
                         ------------<---------
DISCUSSION:   1) You  may  use  PICTURE  anywhere  and  repeatedly.
              However,  usual  usage is to set a picture for a full
              run;  in this case, put the PICTURE statement  before
              your OPEN statement so it is set up only once.
              2) The rules IQL uses for editing are  the  same  for
              pictures in dictionaries and pictures you provide via
              PICTURE.  They are:
                (a)  Pictures  for  alpha  items  may  contain  any
                character.    The   character   "X"   indicates   a
                substitution position - a character from  the  item
                is  substituted  for each X.  Fill in of characters
                from the item value proceeds  left  to  right.   If
                there  are not enough substitution positions in the
                picture, IQL truncates the item;  if there are  too
                many substitution positions, IQL fills in spaces.
                (b) Pictures for numeric items may contain only the
                characters 9 Z $ ( ) .  S or R.  The characters 9 Z
                $  R  designate  substitution   positions;    their
                specific functions are described below.  In editing
                a numeric item, IQL lines  up  the  item  with  the
                decimal  point  (if  any) then substitutes from the
                decimal point outwards.
                (c)  Each  9  is  a  substitution  position  -  the
                corresponding  digit  from the item value is filled
                in.  A 9 stops any  zero  suppression  or  floating
                characters  from  the  left, and a 9 stops rounding
                via R from the right.
                (d) Z may be used only on the left of the  picture.
                Z  positions indicated where zero suppression is to
                be used.  Only a single S or $ may be to  the  left
                of  the  leftmost  Z,  and  only  commas or decimal
                points may be used between Z's.
**PRINT
FUNCTION:     Specifies a print line in a report.
FORMAT:       PRINT     item      [,]
                        literal
                        integer
                       ------<-------
DEFAULTS:     If you do not specify otherwise,  IQL  turns  titling
              on,  uses  three  spaces  horizontally  between  item
              values and single spaces vertically.
DISCUSSION:   1) Item values are laid out in the  print  line  from
              left to right as they occur in your PRINT statement.
              2) Item values are edited according to their  picture
              in the dictionary (or any override picture you use in
              the query) before being put in the print line.
              3) The integer shown in the  format  paragraph  above
              overrides  standard spacing for this PRINT statement.
              It sets  the  horizontal  spacing  increment  to  the
              integer  value for the rest of the print statement or
              until you use  another  such  spacing  integer.   For
              instance, if you had used HSPACE 2 earlier:
                PRINT  NAME, STREET, 5, PHONE, TITLE, 1, YEAR
              gives two spaces between NAME and STREET, five spaces
              between  STREET  and PHONE, five spaces between PHONE
              and TITLE, and one space between TITLE and YEAR.
              4) If you do not use a spacing integer and use HSPACE
              in  your  query, as many spaces are left between item
              values as you designate with HSPACE.
              5) If your print line  is  too  long  for  the  space
              between  your  current  left  and  right margins, IQL
              truncates the print line on the right and  continues.
              No error message is issued.
              6) If titling is on, IQL prints two lines  of  column
              titles  at  the  top of each new page.  In laying out
              space for each item horizontally, IQL uses the longer
              of the edited item length or the length of the column
              title.   Column  titles  for  alpha  items  are  left
              justified.  Column titles for numeric items are right
              justified.
              7) If titling is on, and the current  print  line  is
              from  a  different PRINT statement than the preceding
              line, IQL prints titles before printing the  body  of
              the current line.
              8) If titling is off, IQL  prints  only  the  current
              line.   In laying out this line, it ignores the title
              lengths.  Note that if you print a line turn  titling
              off,  and  print  the  line  again,  there  may  be a
              difference in  alignment  since  the  length  of  the
              column  titles  may affect the first line but not the
              second.
              9) Vertical spacing is done  just  before  the  print
              line (and title if any) is printed.
EXAMPLES:     (a) OPEN PERSONNEL.
                  PRINT LAST-NAME,FIRST-NAME,INITIAL,OFFICE-PHONE.
              (b) SUMPRINT OFF.
                  PICTURE X = '$$$$,$$$.99'.
                  OPEN RETAIL-OUTLETS.
                  COMPUTE X = SALES / SQ-FT.
                  TOTAL SALES ( = XSALES ).
                  PRINT STORE,MGR,"SALES/SQ FT RATIO:",1,X.
                  IF LASTTIME PRINT 'TOTAL SALES:', XSALES.
**REPORT
FUNCTION:     Denotes a specific report in a multiple report  query
              run.    All  print,  report  formatting,  or  heading
              commands between this REPORT command and the next (or
              the  end  of  the  query)  pertain  to  that specific
              report.
FORMAT:       REPORT   integer
DEFAULTS:     If you do not use REPORT anywhere in your query,  IQL
              produces a single report and acts as if you had given
              REPORT 1 at the beginning of the query.
DISCUSSION:   1) Report number 1 is always routed directly  to  the
              printer.  All other reports are spooled out to a disk
              file and later separated and printed or displayed  at
              the end of the run.
              2) When you use a report format setting  (ie  LMARGIN
              10)  or heading (ie HEADING "EXCEPTION REPORT" ) that
              same setting is used in each subsequent report unless
              you change it.
EXAMPLES:     OPEN TICKETS.
              REPORT 1.
              RMARGIN 72.
              HEADING "SEPTEMBER//TICKETS".
              IF MONTH = 'SEPT'
                 PRINT NAME, DESTINATION, AIRLINE, FLIGHT, AMT.
              REPORT 2.
              RMARGIN 132.
              HEADING 'BURMUDA EXCURSIONS - FALL'.
              IF DESTINATION = 'BERMUDA'
                 AND MONTH = 'SEPT', 'OCT', 'NOV'
                 PRINT NAME, AGENT, HOTEL, DATE, PLAN.
**RESET
FUNCTION:     Resets the value of an item or variable.
FORMAT:       RESET      item
                        ---<---
DISCUSSION:   1) Alphabetic or alphanumeric items or variables  are
              reset to all spaces.
              2) Numeric items or variables are reset to zero.
              3) RESET X is equivalent to COMPUTE X = 0.
                 RESET A is equivalent to SET A TO ' '.
EXAMPLES:     HEADING 'BONUS PROJECTION'.
              OPEN SALES-FILE.
              COMPUTE XBONUS = SALARY * ( SALES - QUOTA ) / QUOTA.
              IF XBONUS LEQ 0 RESET XBONUS.
              PRINT NAME, SALES, QUOTA, XBONUS.
**REWRITE
FUNCTION:     Rewrites a record back in place in an  ISAM  (Indexed
              Sequential Access Method) file.
FORMAT:       REWRITE   [RECORD]
DISCUSSION:   1) The record rewritten is the last one read from the
              ISAM  file.   You  may  use  REWRITE  even if you are
              reading the ISAM file sequentially (ie, you  did  not
              use FIND KEY in your query.
              2) If you have changed information in the record, the
              changed values are rewritten into the file as part of
              the rewritten record.
              3) You should be careful in using  REWRITE  since  it
              writes  over  the  original  information  in the ISAM
              file.  It is a good idea to protect ISAM files with a
              fairly  high  level password in the dictionary at the
              FD rewrite password level.
EXAMPLES:     AUTHORITY Q2R3YA.
              OPEN PERSONNEL.
              FIND KEY = '00010', '00025' THRU '00047'.
              SET ASSIGNMENT TO 'SUPERVISOR'.
              REWRITE RECORD.
**RMARGIN
FUNCTION:     Sets the right margin for printing reports.
FORMAT:       RMARGIN integer
DEFAULTS:     If you do not use RMARGIN in your query, IQL  uses  a
              right margin of 132.
DISCUSSION:   1) You may use RMARGIN any place in your  query,  and
              as often as necessary.
              2) RMARGIN settings are  carried  from  one  multiple
              report  to  the next unless you use RMARGIN to change
              them.
              3) RMARGIN affects all of:   page  headings,  summary
              lines and detail print lines.
EXAMPLES:     (a) RMARGIN 72.
                  HEADING 'MEMBER EXTRACT'.
                  OPEN MEMBER-FILE.
                  IF SUBSCRIPTION GEQ 1000
                    PRINT NAME, DATE SUBSCRIPTION.
              (b) OPEN SALES.
                  SORT BY STATE.
                  REPORT 1.
                  HEADING 'SALES DETAIL'.
                  RMARGIN 132.         (to reset from 2nd report)
                  PRINT ACCT SALESMAN GROSS PROJECTION.
                  REPORT 2.
                  HEADING 'HIGH VOLUME//SUMMARY'.
                  RMARGIN 72.
                  IF GROSS GEQ 1000
                      TALLY ACCOUNT BY STATE
                      TOTAL GROSS BY STATE.
**SET
FUNCTION:     Sets a new value into an item.  The  value  may  come
              from another item, a constant or literal.
FORMAT:       SET  item    TO  item
                               constant
                               literal
                   ------------<---------
DISCUSSION:   1) If the item being set is  in  a  record,  the  new
              value  replaces  the  old  value in the record IQL is
              working with but not in the file itself.  However  if
              you subsequently write out the record it contains the
              value.
              2) When a numeric item is set to a numeric value, the
              decimal  points  are  lined  up  first,  then leading
              and/or trailing zeros are supplied if necessary.   If
              the integer or decimal portions of the supplied value
              are too  long,  they  are  truncated  with  no  error
              message.
              3) When an alpha item is set to an alpha  value,  the
              supplied  value  is  left  justified with blank right
              fill if necessary.  If the value is too long,  it  is
              truncated on the right with no error message.
              4) SET X TO ...  is equivalent to COMPUTE X = ...
              5) You may set alpha items to  numeric  values.   The
              integer part of the numeric item is left justified in
              the alpha item with blank right fill if necessary.
              6) You may also set numeric items  to  alpha  values,
              but this is only legitimate if the alpha value is all
              digits.  As many digits as necessary are  taken  from
              the  left  of  the  alpha  value  to fill the integer
              portion of the numeric item.  The fractional portion,
              if any, is zeroed.
              7) You should avoid mixing item types as in  (5)  and
              (6),  ie  setting  alpha  to  numeric and vice versa.
              These operations are expensive in  computer  time  if
              done very often.
EXAMPLES:     (a) OPEN SALES-MASTER.
                  FIND KEY = '456701'
                  SET QUOTA TO 200,000 REGION TO 'NORTHWEST'.
                  REWRITE RECORD.
**SORT
FUNCTION:     Sorts the primary input file on  one  or  more  keys,
              which may be data items or variables and which may be
              sorted ascending or descending.
FORMAT:       SORT  BY   [ASCENDING]    item
                         [DESCENDING]
                        ------------<------------
DEFAULTS:     If you do not specify ASCENDING  or  DESCENDING,  IQL
              sorts ascending.
DISCUSSION:   1) There is no maximum number of sort keys  that  can
              be  used  other than that the number of characters in
              all sort keys  -taken  together-  cannot  exceed  the
              total length of the record.
              2)  You  may  sort  on  calculated  variable  values.
              However,  the  calculated value does not come through
              the sort.  For instance, in the second example  query
              below if you wanted to print XRATIO you would have to
              recompute it after the sort.
EXAMPLES:     (a) OPEN CONGLOMERATE.
                  SORT BY ASCENDING UNIT-NO DESCENDING SALES.
                  TOTAL SALES BY UNIT-NO.
              (b) OPEN STORES.
                  COMPUTE XRATIO = SALES / SQ-FEET.
                  SORT BY XRATIO, SALES.
                  PRINT SALES, SQ-FEET, STORE-NAME.
              (c) OPEN CANDIDATE-FILE.
                  COMPUTE XTOTAL = POLL-PCT * PRECINCT-POPULATION.
                  SORT BY PRECINCT, XTOTAL.
                  IF NEWGROUP OF PRECINCT PRINT PRECINCT, CANDIDATE
                      ELSE PRINT CANDIDATE.
**TALLY
FUNCTION:     Tallies (counts) occurrences of an item (a)  over  an
              entire  report  or (b) within a specific value of one
              or more controlling items (breaks).
FORMAT:       TALLY  item  [BY  item ] [ ( = variable ) ]
                               ---<--
DISCUSSION:   1) TALLY performs two functions:  first it calculates
              the  requested  tally and second, it prints the tally
              at the proper time.
              2) It is not necessary  for  you  to  use  any  other
              summary statement in order to use TALLY.
              3) If you do not specify a break item ( ie BY item  )
              the  tally  is  calculated overall records which pass
              through the TALLY statement.
              4)  If  you  specify  a  break  item,  the  tally  is
              calculated and printed on the change in the indicated
              item.  If you specify more than one break item, TALLY
              breaks  on  a  change  in  any of the indicated break
              items.
              5) Since TALLY merely runs a counter, incrementing it
              by  one each time the TALLY statement is executed, it
              does not matter what type the  item  tallied  or  the
              break item are.
              6) When TALLY  prints,  it  constructs  a  line  with
              explanatory  text  on  the  left and the tally on the
              right.  For break tallies, the  explanatory  text  is
              made  up  of the top and bottom dictionary titles for
              the break item, the value of  that  item  before  the
              break,  the  top  and  bottom  titles  for  the  item
              tallied, and the word 'TALLY:' For non-break  tallies
              the  break  item  titles  and  value  are replaced by
              'OVERALL.  Please note that the item tallied  matters
              only  in the choice of titles which go into the tally
              text.
              7) You may override the  automatic  printout  of  the
              tally  by  using  SUMPRINT OFF in your query.  If you
              wish to turn automatic printout back on, use SUMPRINT
              ON  as  approprite  in  your  query.   If you do turn
              automatic printing on, you must do your own  printing
              as described below in 8.
              8) You may give a name to the tally itself  by  using
              the  form  (  =  variable  ) at the end of your TALLY
              statement.  The variable name must start with 'X'  or
              'ZZ'.   From  this  point on you may use the variable
              just like any  other  item,  including  using  it  in
              computations and print lines.
EXAMPLES:     OPEN SCHOOLS.
              TALLY STUDENT BY CLASS.

**TITLES
FUNCTION:     (a) Turns automatic column titling on or off, or  (b)
              Furnishes specific column titles for designated items
              when you wish to provide titles for working items  or
              to override the dictionary titles.
FORMAT:       TITLES    ON
                        OFF
                        item = literal
                       -------<-------
DEFAULTS:     If you do not use TITLES in your  query,  titling  is
              automatically  turned  on.   For  data  items, column
              titles are obtained from  their  description  in  the
              dictionary.   For working items, the name of the item
              is used as the column title.
DISCUSSION:   1) When IQL is about to print a line it looks to  see
              if this line is from a different print statement than
              the most recent one and if titling is  on.   If  both
              conditions  are  satisfied,  IQL  prints two lines of
              column titles and a line of  spaces  before  printing
              the actual line.  Otherwise it prints only the actual
              line.
              2) If you use TITLES OFF, titling is turned  off  and
              no column titles are printed before the print line.
              3) If you  use  TITLES  ON,  titling  is  turned  on.
              Column titles are printed as described in (1) above.
              4) If you use TITLES item = ...  , IQL turns  titling
              on  and  sets  the column title for the named item to
              the literal value.  If you use a double slash (//) in
              the  literal,  the top title is to the left of the //
              and the bottom title is to the right.  If you do  not
              use  a  double  slash, the literal is used as the top
              title and the bottom title  is  blank.   To  force  a
              single   title  to  the  bottom,  start  with  double
              slashes.  For instance:  '//LAST NAME'.
EXAMPLES:     TITLES X = 'SALES//SQ FT'.
              OPEN STORES.
              COMPUTE X = SALES / AREA.
              PRINT STORE-NAME, SALES, AREA, X.
**TOTAL
FUNCTION:     Totals a numeric item either over an entire report or
              within  a  specific  value of one or more controlling
              items (breaks).
FORMAT:       TOTAL  item  [BY  item ] [ ( = variable ) ]
                               ---<--
DEFAULTS:     If you do not specify  otherwise  (see  below),  each
              TOTAL  statement  both calculates the specified total
              and prints it out.
DISCUSSION:   1)  TOTAL  performs   two   functions:    first,   it
              calculates  the  correct  total and second, it prints
              the total at the proper time.
              2) If you do not specify a break item (ie, BY item ),
              the  total  is calculated over all records which pass
              through the TOTAL statement.
              3)  If  you  specify  a  break  item,  the  total  is
              calculated  and printed when IQL sees a change in the
              indicated item.  If you specify more than  one  break
              item,  TOTAL breaks if it sees a change in any of the
              indicated items.
              4) You may specify more than one break item  as  long
              as  each  is  minor to one preceeding it.  A total is
              calculated for each such break item.  When  a  change
              in any break item occurs, a change is assumed to have
              occurred in each break item to the right of it in the
              TOTAL  statement.   The purpose of this is to prevent
              inadvertent overlap of minor break items  over  major
              ones.   For  instance if we were totaling grade point
              total for each sex in each school and we  encountered
              an  all-girls  school,  TOTAL GPA BY SEX would give a
              misleading answer while TOTAL  GPA  BY  SCHOOL,  SEX.
              would give the correct one.
              6) Since totaling is  an  arithmetic  operation,  the
              item  you total must be numeric.  However the item(s)
              controlling the break may be any type.
              7) When TOTAL  prints,  it  constructs  a  line  with
              explanatory  text  on  the  left and the total on the
              right.  For break totals the text is made up  of  the
              top  and bottom dictionary titles for the break item,
              the value of the  break  item,  the  top  and  bottom
              titles  for  the totaled item, and the word 'TOTAL:'.
              See the examples below.
              8) You may override the automatic printing of a total
              by  using  the  statement SUMPRINT OFF in your query.
              If you wish to turn  on  automatic  printing  of  the
              total  (or  any summary operation) use SUMPRINT ON as
              appropriate.  If you do turn  automatic  printing  of
              TOTAL off, you must do your own printing as described
              in the next paragraph.
              8) You may give a name to the total  'bucket'  itself
              by  using  the form ( = variable ) at the end of your
              TOTAL statement.  The variable name must  start  with
              either  'X'  or 'ZZ'.  From this point on you may use
              the variable just  like  any  other  item,  including
              using  it  in  computations.   One  such  usage is to
              calculate percentages at the end of a query.  Another
              is  so  that  you may print the total in a print line
              with  other  data,  often  for   printing   summaries
              directly under details.
EXAMPLES:     (a)  HEADING 'ORGANIZATIONAL BUDGETS'.
                   OPEN BUDGET-FILE.
                   TOTAL BUDGET BY DIV, DEPT.
                   TOTAL BUDGET.
              might give:
              HOME DEPT 421 ANNUAL BUDGET TOTAL:    23,921.46
              HOME DEPT 427 ANNUAL BUDGET TOTAL:    37,446.00
              HOME DEPT 433 ANNUAL BUDGET TOTAL:    12,777.50
              HOME DIV 110 ANNUAL BUDGET TOTAL:     74,144.96
              ....
              OVERALL ANNUAL BUDGET TOTAL:         549,873.64
**VSPACE
FUNCTION:     Changes the vertical spacing of reports.
FORMAT:       VSPACE integer
DEFAULTS:     If you do not use VSPACE in your  query,  IQL  single
              spaces  reports;   ie,  it  acts  as  if you had used
              VSPACE 1.
DISCUSSION:   1) IQL physically  vertical  spaces  just  before  it
              prints a line or the titles which go with the line.
              2) You may use VSPACE at any point and repeatedly.
              3) VSPACE only affects reports produced by PRINT;  it
              does not affect output from DISPLAY.
              4) If you are producing multiple reports, any  VSPACE
              setting  stays in effect from one report to the next.
              If you wish to use a different  vertical  spacing  in
              reports,  you  must  use VSPACE to change it, and you
              must use VSPACE again in the first report to  set  it
              back.  See the examples below.
              5) The integer in VSPACE may be any reasonable value.
EXAMPLES:     OPEN STUDENTS.
              REPORT 1.
              TITLES ON.
              VSPACE 1.
              PAGING ON.
              HEADING 'HIGH GPA STUDENTS'.
              IF GPA GEQ 3.5 PRINT NAME, CLASS, GPA, YEAR.
              REPORT 2.
              TITLES OFF.
              *STUDENT ADDRESS LABELS*.
              PAGING OFF.
              VSPACE 3.
              PRINT NAME.
              VSPACE 1.
              PRINT STREET.
              PRINT CITY.
              PRINT STATE, ZIP.
**APPEND
FUNCTION:     Positions the file at the end (bottom) and then  goes
              into  'insert'  mode  to  receive  new records.  This
              command is exactly the same as if you entered  BOTTOM
              followed by INSERT.
FORMAT:       APPEND
DISCUSSION:   1)  The  first  record  inserted   by   APPEND   goes
              immediately  after  the  last  record  of the current
              file.
              2) For a detailed description  of  entering  records,
              see the section describing INSERT.
EXAMPLES:     <QA> append
               (at end of file)
               (next record)
               *custno (customer number) 5 n:  1
               *customer (customer name) 16 a: jones
               *BUYER (BUYER NAME) 15 A: BARNABAS
               *CYSALES ..........
**BOTTOM
FUNCTION:     Positions the file at the end (bottom).
FORMAT:       BOTTOM
DISCUSSION:   If a file is positioned at the end, it is  positioned
              after  the  last record.  There is no current record.
              An attempt to list or otherwise act  on  the  current
              record  results  in  an error message and the file is
              not moved.
<QA>bottom
               (at end of file)
              <QA>
**CHANGE
FUNCTION:     Changes the contents of one or more items  in  either
              the  current  record  or selected records.  If verify
              mode is on, displays the changed record(s).
                     --------<---------
FORMAT:       CHANGE item [TO]    value [IN     findlist]
                          [EQ]          [IF     KEY = value
                          [=]           [FOR
                          [EQUAL]       [WHERE
                          [EQUALS]      [WHEN
DEFAULTS:     If you do not furnish a findlist the changes are made
              in  the  current  record  only  and  the  file is not
              repositioned.
DISCUSSION:   1) If you specify a findlist, the  system  makes  the
              specified  changes  in  the  records  located  by the
              findlist.  The file is left positioned  at  the  last
              record  changed.  If your findlist starts with ALL or
              if a record is not found, the file is left positioned
              at its end.
              2) The rules for furnishing new item values  are  the
              same   as   for   other  commands.   Please  see  the
              'FINDLIST' section.
EXAMPLES:     CHANGE DEPT TO 421
              CH DEPT 421
              CH NAME 'SEISS' IN SSNO 572409987
              CHANGE VENDOR TO 'BRAND X' SALESMAN TO ++
                      JONES REGION = 6 FOR ALL VEND-NO ++
                      = 50 SALESMAN= 'SMITH'
**COLUMNS
FUNCTION:     Designates the left and right columns of the  portion
              of  the  record  to  be displayed by LIST (or CHANGE,
              DOWN, FIND, UP if verify mode is on).
FORMAT:       COLUMNS  integer   [integer]
              Where  the  first  integer   designates   the   first
              (leftmost)  column  to  be  displayed  and the second
              integer  is  the  last  (rightmost)  column   to   be
              displayed.
DEFAULTS:     1) If you do not  use  COLUMNS  in  the  session  IQL
              displays   the   full  record,  wrapping  around  the
              terminal as necessary.
              2) If you  do  not  specify  a  second  integer,  IQL
              displays  a  72  character  portion  of  the  record,
              beginning at  the  column  designated  by  the  first
              integer.
DISCUSSION:   1) The leftmost character in a record is in column 1.
EXAMPLES:     COLUMNS      40   75
              CO           40   75
              CO           601
**DELETE-IMMEDIATE
FUNCTION:     Deletes one or more selected records.
FORMAT:       DELETE    [findlist]
                        [integer]
              where the integer is the  number  of  records  to  be
              deleted.
DEFAULTS:     If you specify neither a findlist  nor  a  number  of
              records, IQL deletes the current record.
DISCUSSION:   1) If you specify an integer, IQL deletes  that  many
              sequential records, starting with the current one.
              2) If you specify a findlist, IQL deletes the records
              located  by  the findlist.  Please see the 'FINDLIST'
              section.
              3) Regardless of what form of  DELETE  you  use,  the
              file  is left positioned at the record after the last
              record deleted.  However, if you use a findlist which
              starts  with  ALL  or  if  the  system  cannot find a
              specified record, the file is left positioned at  its
              end.
EXAMPLES:     DELETE
              DE
              DE 10
              DELETE ALL RECORDS FOR REGION 56
              DELETE FIRST RECORD ACCT 7252
              DELETE NEXT RECORD WHERE VENDOR NOT = 'BLT'
              DE VENDOR NOT BLT
**DOWN
FUNCTION:     Moves the file down (toward  the  end  or  bottom,  a
              specified  number  of records.  If verify mode is on,
              displays the new current record.
FORMAT:       DOWN    [integer]
              where the integer is the number of records  the  file
              is to be moved down.
DEFAULTS:     If you omit the integer, IQL moves the file down  one
              record.
DISCUSSION:   If IQL encounters the end of the file before  it  has
              moved down the requested number of records, it issues
              an 'AT END OF  FILE'  message  and  leaves  the  file
              positioned  at its end.  If the file is positioned at
              its beginning and you use DOWN or  DOWN  1,  the  new
              current record is the first record in the file.
EXAMPLES:     DOWN
              DO
              DOWN   12
              DO     600
**EXIT-IMMEDIATE
FUNCTION:     Ends the update or browse session and saves the final
              version  of  your file.  Returns you to the operating
              system.
FORMAT:       EXIT
DISCUSSION:   EXIT and END are synonyms.
EXAMPLES:     EXIT
              EX
**EXTRACT
FUNCTION:     Extracts selected records from the current  file  and
              writes them to a new sequential file.
FORMAT:       EXTRACT   [TO  'file.ext']    findlist
DEFAULTS:     If you do not furnish a file name IQL writes the file
              on  name.OUT,  where 'name' is the name of your input
              file.
DISCUSSION:   1) Please see the discussion in the section
              entitled 'Findlist'.
              2) The file written out retains the same mode  (ASCII
              or 6-bit) as your original file.
              3) EXTRACT always goes to the beginning of the  input
              file before doing the extract.
              4) After EXTRACT,  IQL  switches  to  processing  the
              extracted file.
**FIND-IMMEDIATE
FUNCTION:     Positions the file at a selected record.   If  verify
              mode is on, displays the new current record.
FORMAT:       FIND   [findlist]
                     KEY = value
DEFAULTS:     If you do not furnish a findlist, FIND uses the  last
              findlist  that was furnished.  This lets you continue
              a search by simply entering FIND or FI.
DISCUSSION:   1) Please see the discussion in the section
              entitled 'Findlist'.
              2) If IQL does not find a record which qualifies,  it
              issues  an  'AT  END  OF FILE' message and leaves the
              file positioned at the end.
EXAMPLES:     FIND NEXT RECORD WHERE NAME EQUALS 'SMITH'
              FIND NEXT NAME EQ 'SMITH'
              FIND NAME 'SMITH'
              FI NAME 'SMITH'
              FI        (if used after the above FIND,
                         continues the search)
              FIND KEY = '234581099'
              FIND DEPT GR 421 AND DIV EQ 3
              FIND ACCOUNT GEQ 6000 AND YEAR NOT LESS 75
              FIND ACCOUNT GE 6000 AND YEAR GE 75
**Findlist
FUNCTION:     A 'findlist' is  a  set  of  item-names,  values  and
              relationships  which  direct IQL to locate records in
              your  file.   Findlists  are  used  in  the  commands
              CHANGE,  DELETE,  FIND and LIST.  An example findlist
              is:
              NEXT RECORD WHERE NAME EQUALS 'SMITH'
                               |-------------<-------------|
FORMAT:       [ALL]  [RECORDS] [IF] [item [NOT] [EQ] value] [AND]
              [NEXT] [RECORD]  [WHEN]           [NEQ]
              [FIRST]          [WHERE]          [GEQ]
                               [FOR]            [LEQ]
                                                [GR]
                                                [LS]
DISCUSSION:   1) The item-names referenced above may be any defined
              in the dictionary controlling this run.
              2) You may  use  a  number  of  synonyms  to  specify
              relationships (ie, EQ above):
              relationship                 synonyms
              ------------                 --------
              equals                       EQ,EQUAL,
                                           EQUALS,IS,=
              is not equal to              NEQ,NE,NQ,<>
              is greater than or equal to  GEQ,GE,GQ,>=
              is less than or equal to     LEQ,LE,LQ,<=
              is greater than              GR,GT,GREATER,>
              is less than                 LS,LT,LESS,<
              If you do not specify  a  relationship,  IQL  assumes
              'equals'.
              3)  The  word  NOT  reverses  a  relationship.    For
              instance NOT GR is the same as LEQ.
              4) The words RECORD, RECORDS, WHERE, FOR,  WHEN,  AND
              and  IF  are  optional.   They  have no effect on the
              search and  are  processed  simply  so  you  may  use
              phrases which read like English.
              5) If you use NEXT, the search begins at  the  record
              after  the  current record and the file is positioned
              at the next record which satisfies the findlist.
              6) If you use FIRST, the search begins at  the  first
              record  in  the file.  This is the same as if you had
              used the TOP command  and  then  used  NEXT  in  your
              findlist.
              7) If you use ALL, the search begins  at  the  record
              after  the  current one and the file is positioned in
              turn at each downstream record  which  satisfies  the
              findlist.  The file is left positioned at the end.
              8) If you do not use  any  of  the  key  words  NEXT,
              FIRST,  or ALL the search proceeds as if you had used
              NEXT.
              9) The rules for formating item values in a  findlist
              are  the  same  as  for furnishing item values in the
              INSERT command.
              10) Remember that a findlist is only part of  another
              command.  See the discussions of CHANGE, DELETE, FIND
              and LIST for uses of findlists.  ERRORS: IQL   issues
              an  error  message  and  rejects  the  command  if it
              detects any of the following in a findlist:
              (a) item-name not contained in dictionary.
              (b) alphanumeric value too long.
              (c) numeric value contains illegal alphabetics.
              (d) Too many decimal or  integer  places  in  numeric
              value.
**INSERT
FUNCTION:     Inserts one or more new records immediately after the
              current  record.   Prompts for each new item value in
              each record.  Allows you to furnish numeric values in
              a  variety  of  formats.  Takes care of decimal point
              alignment,  leading  zeros  and  trailing  zeros   or
              blanks.
DISCUSSION:   1) If your file is currently positioned  at  the  top
              (beginning),  INSERT  adds the new records before the
              previous first one.
              2) If your file is currently positioned at the bottom
              (end), INSERT adds the new records after the previous
              last one.
              3) INSERT operates under control of your  dictionary.
              For each new record it starts at the beginning of the
              dictionary and issues a prompt for  the  first  input
              data  item.   When  you  respond with a value for the
              item, INSERT issues the prompt  for  the  next  input
              item.  This process continues until either the end of
              the dictionary is reached or you  enter  one  of  the
              special values NEXT, KILL, or UP.  (see next page).
              4) The prompt issued for each item is contructed from
              the  dictionary  entry  for the top and bottom title,
              the  item  length,  and  the  scale  (if  any).   For
              alphanumeric  items  the  prompt  ends with nnA where
              'nn' is the length of the item.  For  numeric  items,
              the prompt ends with nn.mmN where 'nn' is the maximum
              number of integer positions and 'mm' is the number of
              decimal positions (if any).  Examples of prompts:
                   *LAST NAME 16 A :
                   *EARNINGS 7.2 N :
              5) The rules for entering data item  values  are  the
              same  for  INSERT as for other commands.
              6) There are a number of control words you may use to
              control INSERT:
                (a) If you enter a carriage return, all spaces,  or
                '  ',  alphabetic  items  are set to all spaces and
                numeric items are set to zero.
                (b) If you enter the special  value  KILL  anywhere
                (ie,  if  you have made a serious error in entering
                the record and wish to 'kill' it), IQL rejects  the
                record  and  lets  you begin entering it again from
                the beginning.
                (c) If you make an error in entering  a  value  and
                catch  it  later  in the same record, you may 'back
                up' to correct the entry.  Enter the special  value
                BACK  integer.   IQL  moves back that many entries,
                prompts for  that  item,  and  continues  down  the
                dictionary  again.   If  you  omit the integer, IQL
                moves back one prompt.
                (d) To go on to the next record, enter the  special
                value  NEXT.   IQL  goes  through  the  rest of the
                current record,  blanking  out  alphanumeric  input
                items  and  setting  numeric  input  items to zero.
                Then it writes out the record and prompts  you  for
                the first value in the next record.
                (e) To terminate INSERT, enter  the  special  value
                END as the first value in a record.
ERRORS:       If INSERT detects an improper value, it  rejects  the
              value with an error message, reissues the prompt, and
              waits for you to enter the value correctly.  improper
              values are:  (a) alphanumeric value too long, (b) too
              many integer or decimal places in a numeric value, or
              (c) numeric item contains illegal characters.
EXAMPLE:
         *insert
         (NEXT RECORD)
         *CUSTNO (CUSTOMER NUMBER) 5 N:    23
         *CUSTOMER (CUSTOMER NAME) 16 A:   'savings trust'
         *BUYER (BUYER NAME) 15 A:         purchasing
         *CYSALES (CURR YR SALES) 7.2 N:   L000
         %VALUE TOO LONG OR CONTAINS ALPHA
         *CYSALES (CURR YR SALES) 7.2 N:   1000
         *LYSALES (LAST YR SALES) 7.2 N:   575.98
         *LPDATE (LAST PO DATE) 6 N:       780112
         (NEXT RECORD)
         *CUSTNO (CUSTOMER NUMBER) 5 N:    24
         *CUSTOMER (CUSTOMER NAME) 16 A:   "winnebago sales"
         *BUYER (BUYER NAME) 15 A:         'jerry cowens'
         *CYSALES (CURR YR SALES) 7.2 N:   next
         (NEXT RECORD)
         *CUSTNO (CUSTOMER NUMBER) 5 N:    25
         *CUSTOMER (CUSTOMER NAME) 16 A:   'royal cylle'
         *BUYER (BUYER NAME) 15 A:         'ron kline'
         *CYSALES (CURR YR SALES) 7.2 N:   up 2
         *CUSTOMER (CUSTOMER NAME) 16 A:   'royal cycle'
         *BUYER (BUYER NAME) 15 A:         'ron kline'
         *CYSALES (CURR YR SALES) 7.2 N:   451
         *LYSALES (LAST YR SALES) 7.2 N:   $217.45
         *LPDATE (LAST PO DATE) 6 N:       780210
         (NEXT RECORD)
         *CUSTNO (CUSTOMER NUMBER) 5 N:    16
         *CUSTOMER (CUSTOMER NAME) 16 A:   rietronicx
         *BUYER (BUYER NAME) 15 A:         kill
         (NEXT RECORD)
         *CUSTNO (CUSTOMER NUMBER) 5 N:    26
         *CUSTOMER (CUSTOMER NAME) 16 A:   riatronics
         *BUYER (BUYER NAME) 15 A:         "lauren l lee"
         *CYSALES (CURR YR SALES) 7 2 N:   -250.
         *LYSALES (LAST YR SALES) 7.2 N:   22,250
         *LPDATE (LAST PO DATE) 6 N:       780130
         (NEXT RECORD)
         *CUSTNO (CUSTOMER NUMBER) 5 N:    end
**LIST-IMMEDIATE
FUNCTION:     Lists one or more records on  your  terminal.   Lists
              either  a  selected  portion  of  each record or only
              selected items,  depending  on  format  of  the  LIST
              command.
                                           ---<---
FORMAT:       (a)  LIST   [no-of-records]   [item]
                          ---<---
              (b)  LIST    [item]            [findlist]
                                             KEY = value
              where 'no-of-records' is the number of records to  be
              listed.
DEFAULTS:     If you use only the word LIST, IQL lists the  current
              record and the file is not moved.
DISCUSSION:   1) If you do not specify any item names to be listed,
              LIST  displays  the  entire  record  or a part of it,
              depending on whether you have used COLUMNS or not.
              2)  The  following  paragraphs  summarize  the   LIST
              command options:
              (a)  LIST
                   Lists the entire current record.
              (b)  LIST no-of-records
                   Lists the current and  following  records  until
                   the   specified  number  of  records  have  been
                   listed.
              (c)  LIST no-of-records item-name item-name ...
                   Lists  only the  named items,  starting
                   with the current record, until these items have
                   been listed for
                   the specified records. Signs and decimal points
                   are shown for
                   numeric items. The 'items' format is generally
                   easier to read than a continuous portion of the
                   record, especially if binary items are involved.
              (d) LIST item-name item-name ...
                  Lists only named items for  the  current  record.
                  Does not move the file.
              (e) LIST findlist
                  Lists all records located by the findlist.
              (f) LIST item-name item-name ...  findlist
                  Lists only named items for each record located by
                  the findlist.
              IQL leaves the file positioned  at  the  last  record
              listed  unless  (1)  you used ALL in your findlist or
              (2) in listing the system encountered the end of  the
              file.   In these cases, it issues an 'AT END OF FILE'
              message and leaves the file positioned at its end.
EXAMPLES:     LIST
              LIST   10
              LIST   20  ACCOUNT  LEDGER  AMOUNT
              LIST   ACCOUNT  LEDGER  AMOUNT
              LIST FIRST ACCOUNT = 6000
              LIST ALL ACCOUNT = 6000
              LIST LEDGER AMOUNT FOR ALL ACCOUNT = 6000
              LIST ACCOUNT LEDGER AMOUNT RATE FOR ALL ++
                           ACCOUNT GEQ 6000 AND YEAR 76
**SAVE-IMMEDIATE
FUNCTION:     Saves the current version of your file.  The  current
              version  replaces  the original version of your file.
              The file is left positioned at its beginning.
FORMAT:       SAVE
EXAMPLES:     SAVE
              SA
**TOP
FUNCTION:     Positions the file at the beginning (top).
FORMAT:       TOP
DEFAULTS:     If the file is already positioned at  the  beginning,
              it is left there.
DISCUSSION:   If a file is  positioned  at  its  beginning,  it  is
              positioned  before  the  first record and there is no
              current record.
EXAMPLES:     TOP
              TO
**UP
FUNCTION:     Moves the file up (toward its  top  or  beginning)  a
              specified  number  of records.  If verify mode is on,
              displays the new current record.
FORMAT:       UP [no-of-records]
              where 'no-of-records' is the number  of  records  the
              file is to be moved up.
DEFAULTS:     If you omit no-of-records, the system moves the  file
              up one record.
DISCUSSION:   If IQL encounters the beginning of the file before it
              has  moved  up  the  specified  number of records, it
              issues an 'AT BEGINNING OF FILE' message  and  leaves
              the  file  positioned  at  its  beginning (before the
              first record).  If the file is positioned at its  end
              (after  the  last record) and UP or UP 1 is used, IQL
              moves the file up to the last record in the file.
EXAMPLES:     UP
              UP 600
ERRORS:       If   alphabetic   characters   are   encountered   in
              no-of-records  IQL  issues  an error message, rejects
              your UP command and does not move the file.
**VERIFY
FUNCTION:     Sets IQL into or out of verify mode.
FORMAT:       VERIFY      [ON]
                          [OFF]
DEFAULTS:     When you begin your update session,  verify  mode  is
              automatically on.
DISCUSSION:   If IQL  is  in  verify  mode,  it  (1)  automatically
              displays  the new current record located by UP, DOWN,
              or FIND commands and (2) automatically displays  each
              changed  record  as  a CHANGE command is carried out.
              If the system is not in verify  mode,  these  records
              are not automatically displayed.
EXAMPLES:     VERIFY
              VE     ON
              VERIFY ON
              VERIFY OFF
ERRORS:       If IQL encounters a word other than ON or  OFF  after
              VERIFY,  it  issues an error message and turns verify
              mode on.