You can define a new column on the FORM.COLUMNS panel similar to the way you define a new column in a query.
For this example, you will add a total earnings (SALARY+COMMISSION) column for each employee.
To add a new column:
If you want to skip the Specify panel, type SPECIFY DEFINITION on the QMF command line. Then, move the cursor to the column you want to define and press Enter. The Definition panel for the column displays.
Figure 80. The Definition panel
+--------------------------------------------------------------------------------+ |FORM.COLUMNS MODIFIED | |+--------------------------------------------------------------------+ | || Definition | | || | | || Column Number : 6 | | || Column Heading: TOTAL_EARNINGS | | || | | || Type an expression to define this column. | | || Expression (_&4_+_&5____________________________________________) | | || Pass Nulls? (_NO_____) | | |+--------------------------------------------------------------------+ | || F1=Help F5=Previous Column F6=Next Column | | || F10=Previous Definition F11=Next Definition F12=Cancel | | |+--------------------------------------------------------------------+ | +--------------------------------------------------------------------------------+
You can process null values if you are defining a column by using REXX EXECs.
For more information on passing nulls and writing REXX EXECs, see the QMF Reference, SC26-4716-05 .
Figure 81. The changed report shows the new column.
+--------------------------------------------------------------------------------+ | TOTAL | | NAME DEPT JOB SALARY COMM EARNINGS | | --------- ------ ----- ---------- ---------- ---------- | | KERMISCH 15 CLERK 12258.50 110.10 12368.60 | | NGAN 15 CLERK 12508.20 206.60 12714.80 | | ROTHMAN 15 SALES 16502.83 1152.00 17654.83 | | JAMES 20 CLERK 13504.60 128.20 13632.80 | | PERNAL 20 SALES 18171.25 612.45 18783.70 | | SNEIDER 20 CLERK 14252.75 126.50 14379.25 | | ABRAHAMS 38 CLERK 12009.75 236.50 12246.25 | | NAUGHTON 38 CLERK 12954.75 180.00 13134.75 | | O'BRIEN 38 SALES 18006.00 846.55 18852.55 | | QUIGLEY 38 SALES 16808.30 650.25 17458.55 | +--------------------------------------------------------------------------------+