Using QMF

Specifying punctuation for the values in a column

You can use QMF's edit codes to specify how to punctuate the values in a column.

An edit code is a set of characters that tells QMF how to format and punctuate the data in a specific column of a report. You specify edit codes on the FORM.COLUMNS panel. QMF assigns a default edit code that is based on the data type of the column to each column in a report. You can change the default. For example, you can use an edit code to specify a currency symbol, a decimal point, and commas for numeric data.

You can follow a numeric data edit code (such as L, D, P, or K) with a number that indicates the number of decimal places to use for that data. This number can range from 0 to 99. For example, L2 means to display a numeric value by using the L edit code, and allow 2 digits after a decimal.

Here are some common edit codes:

C
Character data--specifies no punctuation.

L
Numeric data--specifies a decimal point and negative sign, if they occur.

D
Numeric data--specifies a currency symbol and a separator for groups of three digits, as well as a decimal point and negative sign, if they occur.

P
Numeric data--specifies numeric data as a percentage by using the % symbol, as well as a decimal point and negative sign, if they occur.

K
Numeric data--supplies a minus sign for negative values, a separator for groups of three digits, and decimal placement.

Suppressing zero values

With numeric data edit codes, you can also choose to use a Z edit code in the second position to suppress zero values in a report. For example, DZ indicates numeric data, zero suppression, with a currency symbol, a separator for groups of three digits, and a decimal point and negative sign, if they occur.

Specifying a currency symbol

With the D edit code, you can also choose to use a C edit code in the second or third position. The C edit code causes QMF to use the currency symbol that you specify with the DSQDC_CURRENCY global variable.

For example, DC indicates numeric data, with the currency symbol that is specified with the DSQDC_CURRENCY global variable, a separator for groups of three digits, and a decimal point and negative sign, if they occur.

Note that if you use both Z and C with the D edit code, C must follow Z.

For additional information about edit codes, see the QMF Reference, SC26-4716-05 .

Changing edit codes

In this example, you will change the edit codes for the SALARY, COMMISSIONS, and TOTAL_EARNINGS columns to display the values as dollar amounts.

To change edit codes:

  1. On the FORM.COLUMNS panel, move the cursor under the EDIT field for the column you want to change.
  2. Type the new edit code.

    In this example, type D2 in the SALARY, COMMISSIONS, and TOTAL_EARNINGS columns. The D2 edit code tells QMF to punctuate the values in these columns with a currency symbol, and to allow two digits after the decimal.

    Figure 90. Change the way columns are punctuated on FORM.COLUMNS.

    +--------------------------------------------------------------------------------+
    | FORM.COLUMNS                                          MODIFIED                 |
    |                                                                                |
    |                        Total Width of Report Columns: 73                       |
    |  NUM COLUMN HEADING                           USAGE   INDENT WIDTH EDIT  SEQ   |
    |  --- ---------------------------------------- ------- ------ ----- ----- ---   |
    |    1 EMPLOYEE_NAME                                    4      9     C     3     |
    |    2 DEPT._NUMBER                                     2      6     L     1     |
    |    3 JOB                                              4      5     C     2     |
    |    4 SALARY                                           2      12    D2    4     |
    |    5 COMMISSIONS                                      2      11    D2    5     |
    |    6 TOTAL_EARNINGS                                   4      12    D2    6     |
    |      *** END ***                                                               |
    +--------------------------------------------------------------------------------+
  3. Press the Report function key to see the changed report.

    Figure 91. The changed report shows the dollar sign punctuation.

    +--------------------------------------------------------------------------------+
    |   DEPT.              EMPLOYEE                                     TOTAL        |
    |   NUMBER    JOB        NAME           SALARY  COMMISSIONS        EARNINGS      |
    |   ------    -----    ---------  ------------  -----------    ------------      |
    |     15      CLERK    KERMISCH     $12,258.50      $110.10      $12,368.60      |
    |     15      CLERK    NGAN         $12,508.20      $206.60      $12,714.80      |
    |     15      SALES    ROTHMAN      $16,502.83    $1,152.00      $17,654.83      |
    |     20      CLERK    JAMES        $13,504.60      $128.20      $13,632.80      |
    |     20      SALES    PERNAL       $18,171.25      $612.45      $18,783.70      |
    |     20      CLERK    SNEIDER      $14,252.75      $126.50      $14,379.25      |
    |     38      CLERK    ABRAHAMS     $12,009.75      $236.50      $12,246.25      |
    |     38      CLERK    NAUGHTON     $12,954.75      $180.00      $13,134.75      |
    |     38      SALES    O'BRIEN      $18,006.00      $846.55      $18,852.55      |
    |     38      SALES    QUIGLEY      $16,808.30      $650.25      $17,458.55      |
    +--------------------------------------------------------------------------------+
    
    

The default currency symbol displays. You can specify a different currency symbol to use in the report by using the currency symbol edit code.

To change the currency symbol:

  1. On the command line, enter the following to define a new currency symbol:
    SET GLOBAL (DSQDC_CURRENCY = DM
    

    Where DM is the currency symbol you want to use.

    The currency symbol can be a string with a length from 1 to 18 bytes.

  2. On the FORM.COLUMNS panel, change the column width for the TOTAL _EARNINGS column to 13.
  3. Change the edit code for TOTAL_EARNINGS to DC2. The edit code C causes QMF to display the currency symbol you defined with the SET GLOBAL (DSQDC_CURRENCY = DM command.
  4. Press the Report function key to see the changed report.

    Figure 92. The changed report shows the Deutch mark punctuation.

    +--------------------------------------------------------------------------------+
    |   DEPT.              EMPLOYEE                                     TOTAL        |
    |   NUMBER    JOB        NAME           SALARY  COMMISSIONS        EARNINGS      |
    |   ------    -----    ---------  ------------  -----------    -------------     |
    |     15      CLERK    KERMISCH     $12,258.50      $110.10      DM12,368.60     |
    |     15      CLERK    NGAN         $12,508.20      $206.60      DM12,714.80     |
    |     15      SALES    ROTHMAN      $16,502.83    $1,152.00      DM17,654.83     |
    |     20      CLERK    JAMES        $13,504.60      $128.20      DM13,632.80     |
    |     20      SALES    PERNAL       $18,171.25      $612.45      DM18,783.70     |
    |     20      CLERK    SNEIDER      $14,252.75      $126.50      DM14,379.25     |
    |     38      CLERK    ABRAHAMS     $12,009.75      $236.50      DM12,246.25     |
    |     38      CLERK    NAUGHTON     $12,954.75      $180.00      DM13,134.75     |
    |     38      SALES    O'BRIEN      $18,006.00      $846.55      DM18,852.55     |
    |     38      SALES    QUIGLEY      $16,808.30      $650.25      DM17,458.55     |
    +--------------------------------------------------------------------------------+
    
    

    If you want a space between the DM currency symbol and the currency values, reissue the SET GLOBAL command as follows:

    SET GLOBAL (DSQDC_CURRENCY = 'DM '      
    
  5. Press the Report function key to see the changed report.

    Figure 93. The changed report shows the Deutch mark punctuation.

    +--------------------------------------------------------------------------------+
    |   DEPT.              EMPLOYEE                                     TOTAL        |
    |   NUMBER    JOB        NAME           SALARY  COMMISSIONS        EARNINGS      |
    |   ------    -----    ---------  ------------  -----------    -------------     |
    |     15      CLERK    KERMISCH     $12,258.50      $110.10     DM 12,368.60     |
    |     15      CLERK    NGAN         $12,508.20      $206.60     DM 12,714.80     |
    |     15      SALES    ROTHMAN      $16,502.83    $1,152.00     DM 17,654.83     |
    |     20      CLERK    JAMES        $13,504.60      $128.20     DM 13,632.80     |
    |     20      SALES    PERNAL       $18,171.25      $612.45     DM 18,783.70     |
    |     20      CLERK    SNEIDER      $14,252.75      $126.50     DM 14,379.25     |
    |     38      CLERK    ABRAHAMS     $12,009.75      $236.50     DM 12,246.25     |
    |     38      CLERK    NAUGHTON     $12,954.75      $180.00     DM 13,134.75     |
    |     38      SALES    O'BRIEN      $18,006.00      $846.55     DM 18,852.55     |
    |     38      SALES    QUIGLEY      $16,808.30      $650.25     DM 17,458.55     |
    +--------------------------------------------------------------------------------+
    
    

To change the currency symbol to a dollar sign, issue this command:

SET GLOBAL (DSQDC_CURRENCY = $


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]