Previous Topic: Select a PRINT StatementNext Topic: Arrange Column Order


Edit PRINT Statement

To edit the PRINT statement template:

  1. Type over FROM table-name ROWS with TITLE1 'FILLED CUSTOMER ORDERS'.
  2. Type over part of the PRINT format in line 06 with (SHIP-PRICE) PICTURE 'Z,ZZZ,ZZ9.99-'.
  3. Use the ERASE key to delete the remainder of the PRINT format on line 06.
  4. Move the cursor to the line number for line 06.
  5. Type I in the line number.
  6. Press Enter to complete the insert line command.
  7. Move the cursor to the first space in the new line (07).
  8. To add a title, type TITLE1 and 'FILLED CUSTOMER ORDERS' after PRINT.
  9. Since the query searches only one table, it is not necessary to use the FROM file-name ROWS portion of the PRINT format.
  10. The temporary result, SHIP-PRICE, needs to be included in the report and totals should be produced on it each time a control break occurs, so (SHIP-PRICE) must be typed in. (The parentheses specify a control break.)
  11. Add a PICTURE Clause.

    To show how to use an edit pattern, the clause PICTURE 'Z,ZZZ,ZZ9.99-' is included. Notice that the edit pattern allows for seven digits to the left of the decimal and two to the right. This is because this temporary result has been given a precision of (7.2) in the SET statement and the edit pattern must fit the column length. Using commas in the edit pattern shows you that you can do this to clarify the numeric value. The Z indicates that leading zeros are to be suppressed, that is, not displayed, in the report. The 9 tells CA Dataquery to display the appropriate value for this position, even if it is a zero. If all Zs were specified, you'd see a blank in the report if the value happened to be 0.00. You can see that your choice of edit pattern influences how meaningful your report will be.

  12. Select PRINT Columns.

    Inserting one line and pressing <PF3> DISPLAY COLUMNS shows you how you can select more than one column from the list of columns in the table you are searching.

=> TO ORDER THE COLUMNS, ENTER A NUMBER IN FRONT OF EACH ONE --------------------------------------------------------------------------DQB90 DATAQUERY: COLUMN DISPLAY DICTIONARY DATABASE ID: 189 ------------------------------------------------------------------------------- TABLE NAME: CAI-DETAIL-TBL DB NAME: DTL DB ID: 010 ------------------------------------------------------------------------------- COLUMN NAME | DESCRIPTION ------------------------------------------------------------------------------- __ CUST-ID | __ ITM-ID | __ ORD-QTY | __ SHIP-QTY | __ UNIT-PRICE | __ DISC-PCT | __ ACT-DT | __ ACT-YR | __ ACT-MO | __ ACT-DAY | | | - LAST PAGE ------------------------------------------------------------------- <PF1> HELP <PF2> RETURN <PF3> NOT USED <PF4> NOT USED <PF5> EXTENDED DEFN <PF6> TEXT <PF7> BACKWARD <PF8> FORWARD