HP 3000 Manuals

Query commands [ QUERY/V Reference Manual ] MPE/iX 5.0 Documentation


QUERY/V Reference Manual

Chapter 3  Query commands 

REPORT 

Lists data item values of entries located by a retrieval command in the
format you specify.

Syntax 

     R[EPORT] report statement;... END

For example:

     >REPORT
     >>H1,"NAME LIST",20,SPACE A2
     >>D,LAST-NAME,20
     >>D,FIRST-NAME,30
     >>END

or

     >R H1,"NAME LIST",20,SPACE A2;D,LAST-NAME,20;D,FIRST-NAME,30;END

Where header statement = H1,"NAME LIST",20,SPACE A2 and
 detail statements = D,LAST-NAME,20 and D,FIRST-NAME,30

Parameters 

report statements      consist of a sequence of header, detail, sort,
                       group, total, register, edit, and output control
                       statements, as outlined in Table 3-1.  These
                       statements are explained in detail later in this
                       section.  Statements can be entered on separate
                       lines or on one line separated by semicolons.

Discussion 

If you enter REPORT without following it with report statements, QUERY
will prompt you for the statements until you enter an END at the prompt.

If the first report statement is in error, the REPORT command terminates.

The REPORT command is an extension of a retrieval command in that it
prints a report of the data entries located by the last FIND, MULTIFIND,
or SUBSET command.

REPORT output can be directed to any desired output device through the
MPE :FILE command and the QUERY OUTPUT= command.  Refer to the OUTPUT=
command for further discussion.

You can specify your own user defined procedure(s) to enable your report
to perform specialized tasks not provided by QUERY. This is an advanced
capability used by programmers.  Refer to Appendix F for further
discussion.

          Table 3-1.  REPORT Statements 

--------------------------------------------------------------------------------------------
|                              |                                                           |
|        STATEMENT TYPE        |                         FUNCTION                          |
|                              |                                                           |
--------------------------------------------------------------------------------------------
|                              |                                                           |
| Header                       | Prints title, column headings, page numbers, time of day, |
|                              | and the date at the top of each report page.              |
|                              |                                                           |
| Detail                       | Prints data item or register values or a character string |
|                              | in the column position specified.                         |
|                              |                                                           |
| Sort                         | Sorts data based on the value of a specified data item.   |
|                              |                                                           |
| Group                        | Prints a data item value or character string whenever the |
|                              | value of an appropriate "sort item" changes.              |
|                              |                                                           |
| Total                        | Prints count, average, or totals for logical groups or    |
|                              | entire report.                                            |
|                              |                                                           |
| Edit                         | Describes edit masks used to punctuate Group, Detail, or  |
|                              | Total fields.                                             |
|                              |                                                           |
| Register                     | Specifies an operation to be executed in Register n.      |
|                              |                                                           |
| Output control               | Specifies the report output parameters.                   |
|                              |                                                           |
--------------------------------------------------------------------------------------------

REPORT Statements.  Statements can also contain additional parameters
which perform such tasks as skipping to the top of the next report page,
spacing between report lines, and indicating edit masks to be used to
insert punctuation such as decimal points, dollar signs, etc., into
values printed in the report.  These options are described in Table 3-2.

          Table 3-2.  REPORT Statement Parameters 

-----------------------------------------------------------------------------------------------
|                       |                                             |                       |
|       PARAMETER       |                  FUNCTION                   |      APPLICABLE       |
|                       |                                             |      STATEMENTS       |
|                       |                                             |                       |
-----------------------------------------------------------------------------------------------
|                       |                                             |                       |
| print position        | determines the rightmost print position     | Header, Detail,       |
|                       | (column number) for the print element.For   | Group, Total          |
|                       | character data, this is the rightmost       |                       |
|                       | character; for numeric data, it is the      |                       |
|                       | position of the least significant digit.    |                       |
|                       |                                             |                       |
| SPACE A[number]       | space number lines after printing the       | Header, Detail,       |
|                       | report line.  If number is omitted, one     | Group, Total          |
|                       | line is spaced.                             |                       |
|                       |                                             |                       |
| SPACE B[number]       | space number lines before printing the      | Header, Detail,       |
|                       | report line.  If number is omitted, one     | Group, Total          |
|                       | line is spaced.                             |                       |
|                       |                                             |                       |
| number                | is the number of lines to be spaced (from 1 |                       |
|                       | to 5).                                      |                       |
|                       |                                             |                       |
|                       | skips to the top of the next report page    | Detail, Group, Total  |
|                       | after printing the report line (SKIP A) or  |                       |
|      { A}             | before printing the report line (SKIP B).   |                       |
| SKIP { B}             |                                             |                       |
|                       |                                             |                       |
|                       | indicates that either an edit mask defined  | Detail, Group, Total  |
|                       | in the identically numbered edit statement  |                       |
|  { number}            | (Enumber) is used to punctuate a value or,  |                       |
| E{ Z     }            | if you use the letter Z, that leading zeros |                       |
|                       | are to be suppressed.  In the latter case,  |                       |
|                       | no edit statement is required.              |                       |
|                       |                                             |                       |
-----------------------------------------------------------------------------------------------

Skipping and Spacing.  When paging is in effect, the following rules
govern skipping and spacing:

   1.  If a SKIP B and a SPACE B are both associated with the same output
       line, the SKIP B is processed before the SPACE B.

   2.  If there are not enough lines remaining on the current page to
       satisfy a SPACE B, a page is ejected and then the spacing is
       effected.

   3.  If a SKIP A and a SPACE A are both associated with the same output
       line, the SPACE A is ignored.

   4.  If there are not enough lines remaining on the current page to
       satisfy a SPACE A, it is treated as a SKIP A.

   5.  A SKIP A on the last line of the report will not be executed.

   6.  SPACE A and SPACE B are allowed on the same REPORT statement.  The
       SPACE B is done first, then the SPACE A.

Designing a Report.  Report formats vary according to their use.
However, many reports assume the general format depicted in Figure 3-1.
The TITLE and HEADERS describe the report and are printed at the top of
each page along with the page number.  HEADERS are usually used to
describe the report columns.

The report body consists of DETAIL lines, GROUP TITLES, and TOTALS along
with other descriptive labels.  Normally, each detail line displays
information from a single data entry, although information can appear on
more than one line per entry.  A DETAIL field can be edited to include
commas, decimal points, dollar signs, and other punctuation characters.

DETAIL lines can be sorted and grouped according to the values of data
items in the entry.  For example, a sales report may list sales results
by country, region, sales office, and finally by individual salesperson
within each office.  A GROUP TITLE can be printed whenever a "sort field"
changes value.  For example, when the country changes, the name of the
country could be displayed as a GROUP TITLE. The title can be a series of
characters or a data item value.

SUBTOTALS can be printed for logical groups (for example, for each sales
office) and GRANDTOTALS for the entire report.  These totals add,
average, or count the DETAIL fields in each column of the report.  Like
DETAIL and GROUP fields, TOTAL fields can be edited with punctuation
characters.
_________________________________________________________________________________
|                                                                               |
|                                       TITLE OF REPORT                 PAGE NO.|
|                                                                               |
|                                                                               |
|                        HEADER             HEADER             HEADER           |
|                                                                               |
|                                                                               |
|     GROUP TITLE        DETAIL             DETAIL             DETAIL           |
|                        DETAIL             DETAIL             DETAIL           |
|                        DETAIL             DETAIL             DETAIL           |
|                                                                               |
|                        SUBTOTAL           SUBTOTAL           SUBTOTAL         |
|                                                                               |
|                                                                               |
|     GROUP TITLE        DETAIL             DETAIL             DETAIL           |
|                        DETAIL             DETAIL             DETAIL           |
|                        DETAIL             DETAIL             DETAIL           |
|                                                                               |
|                        SUBTOTAL           SUBTOTAL           SUBTOTAL         |
|                                                                               |
|                                                                               |
|                        GRANDTOTAL         GRANDTOTAL         GRANDTOTAL       |
_________________________________________________________________________________

          Figure 3-1.  General Report Format 

Through the following sections on REPORT Statements, a report is created
by adding one statement type at a time and showing how the added
statements change the report.  Figure 3-2 contains the final version of
the report.
_______________________________________________________________________________
|                                                                             |
|     AS OF: 01/07/86                                                         |
|                                 BOBO'S MERCANTILE                           |
|                                 ON HAND INVENTORY                           |
|                                                                             |
|                                                                             |
|     BIN#  SUPPLIER              STOCK       SHIP DATE          INVENT       |
|                                                                   AMO       |
|                                                                             |
|       0   H & S SURPLUS                                                     |
|                                 7391Z22F     8/13/85           $5,012.50    |
|                                 5405T14F     9/11/85          $12,129       |
|                                 6650D22S    12/05/85          $14,985       |
|                                                                             |
|          BIN TOTAL                                            $32,127.10  * |
|                                                                             |
|                                                                             |
|       1   ACME WIDGET                                                       |
|                                 2457A11C    12/01/85     $553,477,666       |
|           BAY PAPER CO.                                                     |
|                                 7391Z22F    12/01/85           $4,704       |
|           CARDINAL MILLS                                                    |
|                                 5405T14F    11/28/85           $1,396       |
|           JAKE'S JUNK                                                       |
|                                 3739A14F    12/15/85           $1,189       |
|                                                                             |
|          BIN TOTAL                                       $553,485,956.27  * |
|                                                                             |
|                                                                             |
|       2   ACME WIDGET                                                       |
|                                 4397D13P     3/02/85          $55,080       |
|           CARDINAL MILLS                                                    |
|                                 3586T14Y    11/20/85             $358       |
|                                                                             |
|          BIN TOTAL                                            $55,438.56  * |
|                                                                             |
|                                                                             |
|       3   ACME WIDGET                                                       |
|                                 6650D22S    12/03/85          $75,716       |
|           H & S SURPLUS                                                     |
|                                 6650D22S    12/14/85             $187       |
|                                 6650D22S    12/15/85             $153       |
|                                                                             |
|          BIN TOTAL                                           $75,057.92  *  |
|                                                                             |
|                                                                             |
|                                                                             |
|          TOTAL INVENTORY                                 $553,248,578.85  **|
_______________________________________________________________________________

          Figure 3-2.  Sample Report 

HEADER STATEMENTS 

Header statements are used to print report titles and column headings at
the top of each report page.

Syntax 

     Hheader number,print element,print position[,SPACE A[number]]

                   [  {number}]
[,SPACE B[number]] [,E{Z     }]

For example:

     H2,F-NAME,20,SPACE A5

Where header number = 2, print element = F-NAME,
 print position = 20, and number of spaces = 5

Parameters 

header number          is an integer from 1 to 9.  Up to nine lines of
                       header information can be printed in addition to
                       blank lines created by spacing before and after
                       non-blank lines.  Header information with the same
                       header number is printed on the same line.  The
                       lowest-numbered header statement is printed first,
                       the next-highest numbered statement is printed
                       next.  Header statements do not have to be
                       consecutively numbered.

print element          (1) is the name of a simple item or a compound
                       item with an optional subscript parameter.  The
                       value of the specified data item is printed.  The
                       data item can be qualified with the data base and
                       data set to which it belongs.  The form is:

                                         [data set name.      ]
                       [data base name:] [dummy data set name.]

                            data item name [(subscript)]

                       dummy data set name is a temporary data set name
                       used in multiple data set access (refer to the
                       JOIN command).

                       subscript is a number to indicate which sub-item
                       you want to access.  Subscript is entered with
                       parenthesis and must be an integer > 1 and <= the
                       number of sub-items defined for the compound item.
                       QUERY will default to the first sub-item if no
                       subscript is specified.

                       (2) is characters enclosed in quotation marks.
                       The characters are stripped of the surrounding
                       quotation marks and printed.

                       (3) is PAGENO, DATE, or TIME.

                       PAGENO                 consecutively numbers each
                                              page of the report.

                       DATE                   prints the date in the
                                              form:  MMDDYY. The form of
                                              the date varies depending
                                              on the language.

                       TIME                   prints the time in the
                                              form:  HH:MM:SS.

print position          /
                        |
SPACE Anumber           |
                        |      Refer to Table 3-6 at the beginning of the REPORT command
                        |      for descriptions of these parameters.
                        |
SPACE Bnumber           |
                        |
                        |
                        |
 { number}              \
E{ Z     }

Discussion 

A header can contain up to 9 lines of information and any number of blank
lines as long as it does not exceed the page size as defined by the
output control statement LINES=.  (Refer to the description at the
beginning of this section.)  A report consisting of only header
statements will not generate any output.

Negative data item values of type P, Z, I, J, and K are output with a
special character in the rightmost position, unless you use the NOPUNCH
output control statement.  This type of output is called overpunch.
Refer to the REPORT ALL command for more information on overpunch.

Example 

     >F ALL INVENTORY.STOCK# 
     USING SERIAL READ
     13  ENTRIES QUALIFIED
     >REPORT 
     >>H1,"AS OF:",6 
     >>H1,DATE,15 
     >>H1,PAGENO,71  
     >>H1,"PAGE",69  
     >>H2,"BOBO'S MERCANTILE",45  
     >>H3,"ON HAND INVENTORY",45,SPACE A2  
     >>H7,"BIN#",4  
     >>H7,"SUPPLIER",14  
     >>H7,"STOCK",33  
     >>H7,"SHIP DATE",49  
     >>H7,"INVENTORY",68  
     >>H8,"AMOUNT",68  
            .
            .
            .

In the example above, entries are located first.  Then report statements
are entered describing the report headings.  Characters in quotation
marks are printed as they appear in the statement.  DATE and PAGENO are
generated and printed by QUERY. The following is an example of the
specified report.  The column and heading markers, in the example below,
do not appear in an actual report.
_______________________________________________________________________________
|                                                                             |
|             Col.      Col.              Col.         Col. Col.        Cols. |
|              6         15                33          45   49         68  71 |
|              |         |                 |           |    |           |  |  |
|              v         v                 v           v    v           v  v  |
|     H1,->AS OF: 01/07/86                                            PAGE 1  |
|     H2,->                            BOBO'S MERCANTILE                      |
|     H3,->                            ON HAND INVENTORY                      |
|                                                                             |
|                                                                             |
|     H7,->BIN#  SUPPLIER              STOCK       SHIP DATE         INVENTORY|
|     H8,->                                                             AMOUNT|
_______________________________________________________________________________

DETAIL STATEMENTS 

Detail statements usually specify a data item name whose value changes
with each data entry reported, although a fixed series of characters can
be specified as well.  The statement specifies the print position,
top-of-form, line spacing, and applicable edit masks.

Syntax 

     D[detail number],print element,print position[,SPACE A[number]]

                  [      {A}] [  {number}]
[,SPACE B[number]][,SKIP {B}] [,E{Z     }]

For example:

     D2,BADGE#,35,SKIP B,E8

Where detail number = 2, print element = BADGE#,
 print position = 35, and edit number = 8

     D,R3,15,SPACE A2

Where print element = R3, print position = 15, number of spaces = 2

Parameters 

detail number          is an integer from 1 to 99.  If the number is
                       omitted, the print element is printed on a group
                       line when any control break occurs.  (Refer to the
                       discussion of both group and sort statements.)
                       The lowest numbered statement is printed first and
                       others follow in numeric sequence.  Detail
                       statements with the same number are printed on the
                       same line.  Information from a single data entry
                       can therefore be printed on up to one hundred
                       separate lines.

print element          (1) is a simple data item name or a compound data
                       item name with an optional subscript parameter.
                       When a data item is specified, its value is
                       printed for each entry reported.  A data item can
                       be qualified with the data base and data set to
                       which it belongs.  The form is:

                                         [data set name.      ]
                       [data base name:] [dummy data set name.]

                            data item name [(subscript)]

                       dummy data set name is a temporary data set name
                       used in multiple data set access.  (Refer to the
                       JOIN command).

                       subscript is a number that indicates which
                       sub-item you want to access.  Subscript must be an
                       integer >= 1 and <= the number of sub-items
                       defined for the compound item.  QUERY will default
                       to the first sub-item if no subscript is
                       specified.

                       (2) is the contents of a register (Rn).  If a
                       register is specified, the data in the register is
                       printed.  You must enter both the letter and the
                       number.  Refer to REPORT Register Statement for
                       more information.

                       (3) is a series of characters enclosed in
                       quotation marks.  The characters are printed
                       without the surrounding quotation marks, and are
                       printed once for each entry reported.

print position          /
                        |
SPACE Anumber           |
                        |
                        |
                        |
SPACE Bnumber           |
                        |      Refer to Table 3-6 at the beginning of the REPORT command
                        |      for descriptions of these parameters.
                        |
                        |
                        |
     { A}               |
SKIP { B}               |
                        |
                        |
 { number}              \
E{ Z     }

Discussion 

Negative data item values of type P, Z, I, J, and K are output with a
special character in the rightmost position, unless you use the NOPUNCH
output control statement.  This type of output is called overpunch.
Refer to the REPORT ALL command for more information on overpunch.

Example 

     >REPORT
     >>H1,"AS OF:",6
     >>H1,DATE,15
     >>H1,PAGENO,71
     >>H1,"PAGE",69
     >>H2,"BOBO'S MERCANTILE",45
     >>H3,"ON HAND INVENTORY",45,SPACE A2
     >>H7,"BIN#",4
     >>H7,"SUPPLIER",14
     >>H7,"STOCK",33
     >>H7,"SHIP DATE",49
     >>H7,"INVENTORY",68
     >>H8,"AMOUNT",68
     >>D1,STOCK#,36 
     >>D1,LASTSHIPDATE,48 
     >>END

If the same report shown in the header statement example has detail
statements added, the result follows.  The first detail statement prints
the value of STOCK# ending in column 36.  The next statement prints
LASTSHIPDATE value on the same detail line ending in column 48.  Note
that detail lines are printed once per entry.
__________________________________________________________________________________
|                                                                                |
|                                           Col.        Col.                     |
|                                            36          48                      |
|                                            |           |                       |
|                                            v           v                       |
|         AS OF: 01/07/86                                                  PAGE 1|
|                                     BOBO'S MERCANTILE                          |
|                                     ON HAND INVENTORY                          |
|                                                                                |
|                                                                                |
|         BIN#  SUPPLIER              STOCK       SHIP DATE          INVENTORY   |
|                                                                       AMOUNT   |
|     D1->                            6650D22S      120385                       |
|     D1->                            2457A11C      120185                       |
|     D1->                            3586T14Y      112085                       |
|       .                             7391Z22F      120185                       |
|       .                             5405T14F      112885                       |
|       .                             7391Z22F       81385                       |
|       .                             5405T14F       91185                       |
|       .                             4397D13P       30285                       |
|       .                             3739A14F      121585                       |
|       .                             6650D22S      120585                       |
|       .                             6650D22S      121485                       |
|     D1->                            6650D22S      121585                       |
__________________________________________________________________________________

EDIT STATEMENTS 

The edit statement is used for formatting data item values printed in a
report.  The statement performs such functions as suppressing leading
zeros in numeric values, inserting characters such as dollar signs,
dashes, commas, and decimal points.  It also masks characters to
eliminate them from the printed output.  Edit statements can appear
anywhere in the report.

Syntax 

     Enumber,"edit mask"

For example:

     E3,"$$$999CR"

Where number = 3, and edit mask = "$999CR" 

Parameters 

number                 is an integer from 0 to 9 identifying the edit
                       statement.  A report can have at most ten edit
                       statements, each with a unique number.

"edit mask"            consists of from 1 to 20 characters (if the mask
                       is to edit numeric data item values) or from 1 to
                       the maximum length of the data item, not to exceed
                       the maximum record length of the output device (if
                       the mask is to edit alphanumeric data item
                       values.)  In either case, the characters must be
                       surrounded by quotation marks.  The length of the
                       edit mask determines the length of the output
                       field that is printed.

Alphanumeric Edit Masks.  Alphanumeric edit masks consist of X's (used as
place holders) and any other ASCII alphanumeric printing characters (used
as insertion characters).  QUERY examines the data item value specified
in the detail, group, or total statement and the edit mask specified in
the referenced edit statement, starting with the leftmost character of
each.

If the character in the edit mask is X, a character from the data item
value is printed in the corresponding position of the output field.  If
the character in the edit mask is any character other than an X, the edit
mask character is printed in the corresponding position of the output
field.  For example, if the value ABCD is edited with the mask "X-X-X-X",
the result is printed as A-B-C-D.

If there are fewer X's in the edit mask than there are in the data item
value, the rightmost characters of the data item value that do not
correspond to an X in the mask are omitted.  For example, if the value
ABCD is edited with the mask "XX", the result is printed as AB.

If there are more X's in the edit mask than there are characters in the
data item value, QUERY prints asterisks in place of the unused X's in the
edit mask.  All insertion characters in the mask are printed in the
output field.  For example, if the value ABCD is edited with the mask
"XXXX-X", the result is printed as ABCD-*.

Here are two more examples of alphanumeric edit masks:

-----------------------------------------------------------------------------------------------
|    DATA ITEM VALUE    |            EDIT MASK             |          PRINTED RESULT          |
-----------------------------------------------------------------------------------------------
|         A34B          |                                  |                                  |
|         ABCD          | "X//X-X-X-X" "- - - X"           | A//3-4-B-* - - - A               |
-----------------------------------------------------------------------------------------------

Numeric Edit Masks.  A numeric edit mask consists of the placement
holders (9,Z,*,$), the sign characters (CR,-), and any other numeric
ASCII printing characters used as insertion characters.  Each of the
place holders and sign characters serves a special purpose in editing
data item values.  Characters and their usage are specified in Table 3-3.

The numeric edit mask edits decimal integer values consisting of up to 20
characters (not counting the sign characters) in the combinations
outlined in Table 3-4.

If the number of significant digits of the data item value is greater
than the number of place holders (9,Z,*,$) in the edit mask, the output
field is filled with asterisks.  For example, if the value 12345 is
edited with the mask "999CR" the result is *****.

Only one decimal point can appear in any edit mask.

If a minus sign appears in the edit mask in any position other than the
rightmost character of the mask, the minus is treated as an insertion
character.  For example, if the value 12345 is edited with the mask
999-99, the result is 123-45.

Figure 3-3 shows the results of printing numeric data item values using
numeric edit masks.

          Table 3-3.  Numberic Edit Mask Characters 

---------------------------------------------------------------------------------------------
|                         |                                                                 |
|        CHARACTER        |                           EXPLANATION                           |
|                         |                                                                 |
---------------------------------------------------------------------------------------------
|                         |                                                                 |
|            9            | Each 9 in the edit mask is replaced with a decimal digit from   |
|                         | the data item value in the corresponding position of the output |
|                         | field.                                                          |
|                         |                                                                 |
---------------------------------------------------------------------------------------------
|                         |                                                                 |
|            Z            | Z is a zero suppression place holder.  A Z in the edit mask is  |
|                         | replaced with a decimal digit from the data item value in the   |
|                         | corresponding position of the output field.  If the data item   |
|                         | value digit under consideration is a zero appearing to the left |
|                         | of the leftmost significant digit, QUERY inserts a blank in the |
|                         | output field, and all other zeros to the left of the            |
|                         | significant digit are replaced by a blank in the output field.  |
|                         |                                                                 |
---------------------------------------------------------------------------------------------
|                         |                                                                 |
|            *            | * is an asterisk place holder.  An * in the edit mask acts just |
|                         | like a Z with the exception that leading zeros in the data item |
|                         | value are replaced with asterisks in the output field.          |
|                         |                                                                 |
---------------------------------------------------------------------------------------------
|                         |                                                                 |
|            $            | $ is the dollar sign place holder.  A $ in the edit mask acts   |
|                         | just like a Z, except that the first zero in the data item      |
|                         | value to the left of the leftmost significant digit is replaced |
|                         | with the dollar sign in the output field.  All zeros to the     |
|                         | left of the first leading zero are replaced with blanks in the  |
|                         | output field.                                                   |
|                         |                                                                 |
---------------------------------------------------------------------------------------------
|                         |                                                                 |
|           CR            | CR is a sign character, and always appears in the two rightmost |
|                         | positions of the edit mask.  If the data item value is          |
|                         | negative, QUERY prints the two characters (CR) in the first two |
|                         | rightmost positions of the output field.  If the data item      |
|                         | value is positive, QUERY prints two blank characters in place   |
|                         | of the CR. No characters from the data item value are ever      |
|                         | placed in the first two rightmost positions of the output       |
|                         | field.                                                          |
|                         |                                                                 |
---------------------------------------------------------------------------------------------
|                         |                                                                 |
|            -            | - is a sign character and acts the same as the CR characters.   |
|                         | If the data item value is negative, QUERY prints the minus sign |
|                         | (-) in the rightmost position of the output field.  If the data |
|                         | item value is positive, QUERY prints a blank in place of the    |
|                         | minus.  No character from the data item value is ever placed in |
|                         | the rightmost position of the output field.                     |
|                         |                                                                 |
---------------------------------------------------------------------------------------------
|                         |                                                                 |
|        Insertion        | Insertion characters consist of any ASCII printing characters   |
|       characters        | not previously mentioned.  Insertion characters are printed in  |
|                         | the output field in the same position they appear in the edit   |
|                         | mask.  Any insertion character appearing in the edit mask to    |
|                         | the left of the leftmost significant digit of the data item     |
|                         | value is replaced with blanks or an asterisk, depending upon    |
|                         | which zero suppression character is specified in the edit mask. |
|                         | Only one decimal point can appear in an edit mask.              |
|                         |                                                                 |
---------------------------------------------------------------------------------------------

          Table 3-4.  Numeric Edit Mask Combinations 

--------------------------------------------------------------------------------------------
|                                                           |                              |
|                       COMBINATIONS                        |           EXAMPLE            |
|                                                           |                              |
--------------------------------------------------------------------------------------------
|                                                           |                              |
| 9's only                                                  | "99"                         |
|                                                           | "999999"                     |
|                                                           | "9999"                       |
|                                                           |                              |
--------------------------------------------------------------------------------------------
|                                                           |                              |
| Z's only                                                  | "ZZ"                         |
|                                                           | "ZZZZZZZZZZ"                 |
|                                                           |                              |
--------------------------------------------------------------------------------------------
|                                                           |                              |
| Asterisks only                                            | "****"                       |
|                                                           | "**********"                 |
|                                                           |                              |
--------------------------------------------------------------------------------------------
|                                                           |                              |
| Dollar signs only                                         | ""                           |
|                                                           | ""                           |
|                                                           |                              |
--------------------------------------------------------------------------------------------
|                                                           |                              |
| Sign characters preceded by 9's                           | "9999CR"                     |
|                                                           | "999999-"                    |
|                                                           |                              |
--------------------------------------------------------------------------------------------
|                                                           |                              |
| Sign characters preceded by 9's which are preceded by     | "ZZ99999-"                   |
| Z's, asterisks, or dollar signs                           | "******9999999CR"            |
|                                                           | "$999CR"                     |
|                                                           |                              |
--------------------------------------------------------------------------------------------
|                                                           |                              |
| 9's preceded by Z's, asterisks, or dollar signs           | "ZZZZ9999"                   |
|                                                           | "***99999999"                |
|                                                           | "$999999"                    |
|                                                           |                              |
--------------------------------------------------------------------------------------------
|                                                           |                              |
| Any of the above combinations including insertion         | "999,999.99-"                |
| characters such as commas, one decimal point, slashes,    | "999-9999"                   |
| etc.  located anywhere in the edit mask, except to the    | "99/99/99"                   |
| right of sign characters.                                 | "9999.99CR"                  |
|                                                           |                              |
--------------------------------------------------------------------------------------------

_________________________________________________________________________
|                                                                       |
|     DATA ITEM VALUE         EDIT MASK             PRINTED RESULT      |
|                                                                       |
|         0059               "$$$,999"                $059              |
|         001024             "ZZZ,ZZZ"                1,024             |
|         -0010555           "$$,$$$.99CR"            $105.55CR         |
|         00010555           "$$,$$$.99CR"            $105.55           |
|         -0010555           "$$,$$$.99-"             $105.55-          |
|         15039250           "$,$$$,$$$.99CR"         $150,392.50       |
|         00049              "*****"                  ***49             |
|         044240474          "999-99-9999"            044-24-0474       |
|         -2145              "$,$$$.99"               $21.45            |
_________________________________________________________________________

          Figure 3-3.  Sample Output Using Numeric Edit Masks 

Real Numbers.  Real values can be printed in either fixed-point (xx.xxx)
or floating-point (xx.xxxExx) form.  The default is that R2 values less
than .1 or greater than 10 to the sixth (106 ) and R4 values less than .1
or greater than 10 to the sixteenth (1016 ) are printed in floating point
(scientific notation).  All other R2 and R4 values are printed in
fixed-point notation.  To override the default and specify that fixed
point form always be used for real number values, you can use edit masks.

These edit masks work the same way as for other data types except that
the placement of the decimal point determines where the number will be
placed in the field.  Note that fixed R2 values occupy up to eight
characters and floating-point R2 values occupy up to 12 characters.  R4
values occupy up to 18 and 22 characters for fixed and floating-point
respectively.

------------------------------------------------------------------------------------------------
|                                 |              |                                             |
|           REAL VALUE            |     TYPE     |            DEFAULT REPORT OUTPUT            |
|                                 |              |                                             |
------------------------------------------------------------------------------------------------
|                                 |              |                                             |
| 0                               |      R2      | 0.00000                                     |
| 8399607                         |      R2      | .839961E+07                                 |
| 123456                          |      R2      | 123456.                                     |
| .0034567                        |      R2      | .345670E-02                                 |
|                                 |              |                                             |
------------------------------------------------------------------------------------------------

----------------------------------------------------------------------------------------------------
|                           |              |                           |                           |
|        REAL VALUE         |     TYPE     |         EDIT MASK         |       REPORT OUTPUT       |
|                           |              |                           |      WITH EDIT MASK       |
|                           |              |                           |                           |
----------------------------------------------------------------------------------------------------
|                           |              |                           |                           |
| 0                         |      R2      | "ZZZZZ9"                  | 0                         |
| 8399607                   |      R2      | "ZZZZZZ"                  | 839610*                   |
| 123456                    |      R2      | "999999"                  | 123456                    |
| .0034567                  |      R2      | ".9999999"                | .0034567                  |
|                           |              |                           |                           |
----------------------------------------------------------------------------------------------------

* Rounding difference:  For this number to come out as 8399607 it must be
R4 precision.

Example 

     >REPORT
     >>H1,"AS OF:",6
     >>H1,DATE,15
     >>H1,PAGENO,71
     >>H1,"PAGE",69
     >>H2,"BOBO'S MERCANTILE",45
     >>H3,"ON HAND INVENTORY",45,SPACE A2
     >>H7,"BIN#",4
     >>H7,"SUPPLIER",14
     >>H7,"STOCK",33
     >>H7,"SHIP DATE",49
     >>H7,"INVENTORY",68
     >>H8,"AMOUNT",68
     >>D1,STOCK#,36
     >>D1,LASTSHIPDATE,48,E2
     >>E2,"XX/XX/XX" 
     >>END

In the example above, LASTSHIPDATE is altered with edit mask E2.  Edit
mask E2 is defined as "XX/XX/XX".  Now the report looks like this:
______________________________________________________________________________
|                                                                            |
|     AS OF: 01/07/86                                                  PAGE 1|
|                                 BOBO'S MERCANTILE                          |
|                                 ON HAND INVENTORY                          |
|                                                                            |
|                                                                            |
|     BIN#  SUPPLIER              STOCK       SHIP DATE          INVENTORY   |
|                                                                   AMOUNT   |
|                                 6650D22S    12/03/85                       |
|                                 2457A11C    12/01/85                       |
|                                 3586T14Y    11/20/85                       |
|                                 7391Z22F    12/01/85                       |
|                                 5405T14F    11/28/85                       |
|                                 7391Z22F     8/13/85                       |
|                                 5405T14F     9/11/85                       |
|                                 4397D13P     3/02/85                       |
|                                 3739A14F    12/15/85                       |
|                                 6650D22S    12/05/85                       |
|                                 6650D22S    12/14/85                       |
|                                 6650D22S    12/15/85                       |
______________________________________________________________________________



MPE/iX 5.0 Documentation