An XTAB program is a program that reads a file one record at a time. The user specifies commands that are to be executed, selection criteria, and cross-tabulation specifications. The user issues no file open, reads, next record logic, or closes.

XTAB is a lower case language. All commands and keywords are lower case.

The structure of the program is a set of sections containing a set of section specific commands.

The program is created by the user with a text editor. (ule - Unix Line Editor - might be a consideration.)


An XTAB program consists of the following sections:

*files
*variables
*init
*instructions
*term
*tables

The *files section is manditory, and the sections must appear in the above order.

The *section must begin in column 1.

A blank line, or comment (a line beginning with *<space>comment) may be placed any where in the program.


The commands within each section:

*section
 command       Abrev    Definition

*files        *f
 input         in       Defines the input file.
 limit         li       Limits the number of records read.
 output        ou       Defines an output file(s).
 html          ht       Specifies HTML output format of tables.
 csv           cs       Specifies CSV  output format of tables.

*variables    *v
 var                    variable/label/start(-end) column(s).

*init                   Process before input file is opened.
 ..                     (Same as *instructions)

*instructions *i
 var eq                 Replaces contents of variable (STRINGS).
 trim          tm       Removes leading and trailing spaces.
 ucase         uc       Converts to upper case.
 lcase         lc       Converts to lower case.
 select        se       Continue if condition true, else read next.
 if                     If condition.
 elseif        ef       Elseif condition.
 else          el       Else condition.
 endif         nf       Endif condition.
 print         pr       print output.
 write         wr       write output to file.

*term                   Process after input file is closed.
 ..                     (Same as *instructions)
 
*tables       *t
 table         ta       Define table heading(s).
 select        se       Select condition for THIS table.
 labels        la       Define labels for stub (optional).
 stub          st       Define stub (row) variable contents.
 labels        la       Define labels for spread (optional).
 spread        st       Define spread (column) variable contents.

In the *tables section the table-spread group may be repeated.

It is standard, but not necessary, coding practice to seperate sections with one blank line, and indent commands one space.


The Ultimate XTAB definition. (Red = unimplemted):

*section
 command       Abrev    Definition

*files        *f
-title         ti       Appears on each page of output.
 input         in       Defines the input file.
 limit         li       Limits the number of records read.
-page          pa       Defines logical page (width, length).
 output        ou       Defines an output file(s).
 html          ht       Specifies HTML output format of tables.
 csv           cs       Specifies CSV  output format of tables.
-xtab          xt       Specifies XTAB output format of tables.
-web           we       Posts output to WEBSITE.
-email         em       Sends/notifies user output as attachments.

*variables    *v
 var                    variable/label/start(-end) column(s).

*init                   Process before input file is opened.
 ..                     (Same as *instructions)

*instructions *i
 var eq                 Replaces contents of variable (STRINGS).
-var =                  Replaces contents of variable (Equation).
-translate     tr       Translates one set of codes to another.
 trim          tm       Removes leading and trailing spaces.
 ucase         uc       Converts to upper case.
 lcase         lc       Converts to lower case.
-zfill         zf       Converts leading spaces to zeros.
-nnzero        nz       Converts non-numeric variable to 0.
 select        se       Continue if condition true, else read next.
-noselect      ns       Create select false condition.
 if                     If condition.
 elseif        ef       Elseif condition.
 else          el       Else condition.
 endif         nf       Endif condition.
-subtitle      su       Like title, but only applies to *instructions.
 print         pr       print output.
 write         wr       write output to file.
-table         ta       Call a table.
 
*term                   Process after input file is closed.
 ..                     (Same as *instructions)

*tables       *t
 table         ta       Define table heading(s).
-footnote      fo       Define table footing(s).
 select        se       Select condition for THIS table.
-percents      pc       Create additional tables with percents by
                         row, column, and/or grand totals.
-accum         ac       Accumulate variable (as opposed to count).
-zerolines     zl       Display lines with 0 row total values.
 labels        la       Define labels for stub (optional).
 stub          st       Define stub (row) variable contents.
-labels        la       Define secondary labels for stub (optional).
-stub          st       Define secondary stub (row) variable contents.
 labels        la       Define labels for spread (optional).
 spread        st       Define spread (column) variable contents.