Previous Topic: Including Other Types of FieldsNext Topic: Literals


Parameter or Working Data Fields

To include a working data or parameter data variable in your report, specify the field name defined in the working data or parameter fill‑in as the field name on the detail fill‑in.

For example, in a report of customers in Texas, it might be important to note which customers are in arrears. Assume that a working data variable named BADDEBT is defined as a one‑character alphanumeric value. In this program, when the OPEN$ amount is greater than zero and the ACTDT, last activity date, is greater than six months, an asterisk is assigned to BADDEBT. Otherwise, BADDEBT contains a blank. The value of BADDEBT and the customer name, city, and outstanding amount owed prints. The detail fill‑in for this report is shown in the following screen:

=> ‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑ IDEAL : RPT DETAIL DEFN. RPT CUSTRPT (001) TEST SYS: DOC DISP Field Name, Literal,      Sort Break Function Column Function, or               L A L S I T M M A H W Command Arithmetic Expression      V / V K N O A I V D ID Tab Edit Pattern                                     L D L P D T X N G G TH ‑‑‑‑‑‑ ‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑ ‑ ‑ ‑ ‑ ‑ ‑ ‑ ‑ ‑ ‑ ‑‑ ‑‑‑ ‑‑‑‑‑‑‑‑‑‑‑‑‑ ====== =========== T O P ======= = = = = = = = = = = == === ============= 000300 BADDEBT                    _ _ _ _ _ _ _ _ _ N __ ___ _____________ 000400 CUSTOMER.NAME              _ _ _ _ _ _ _ _ _ _ __ ___ _____________ 000500 CUSTOMER.CITY              _ _ _ _ _ _ _ _ _ _ __ ___ _____________ 000600 CUSTOMER.OPEN$             _ _ _ _ _ _ _ _ _ _ __ ___ Z,ZZZ,ZZ9.99 ====== ========= B O T T O M === = = = = = = = = = = == === =============

The pertinent program segment is coded as follows:

FOR EACH CUSTOMER
     WHERE STATE EQ 'TX'
   IF OPEN$ GT 0 AND
      $TODAY ‑ ACTDT GT 180
        SET BADDEBT = '*'
   ELSE
        SET BADDEBT = $SPACES
   ENDIF
   PRODUCE CUSTRPT
ENDFOR

Although ACTDT is evaluated in the program, it is not used in the report. The output appears as shown in the following sample:

   NAME                          CITY OPEN$ * CHEMICAL MUTUAL               FORT WORTH           931.72    GULF LAND USA                 DALLAS             7,100.00 * TEXAS LIFE & CASUALTY CO.     DALLAS               543.21    AFTON INDUSTRIES              DALLAS             1,234.51    PALMOLIVE INNS                FORT WORTH           758.93