Previous Topic: Arrange Column OrderNext Topic: Step 7: Specify Mathematical Function


Move Lines

To use EDITOR commands to move lines on the panel, follow these steps:

  1. Type M in the line number for line 06.
  2. Type A in the line number for line 10.
  3. Press Enter to complete the MOVE line command.
  4. Type >8 (EDITOR line command to shift data to the right, within the line, in this case 8 spaces) in the line number for line 06.
  5. Press Enter to complete the shift data line command.
  6. Type >8 in the line number for line 07.
  7. Press Enter to complete the shift data line command.
  8. Type >8 in the line number for line 08.
  9. Press Enter to complete the shift data line command.
  10. Type >8 in the line number for line 09.
  11. Press Enter to complete the shift data line command.

You need to know how you can use the EDITOR's line commands to move lines within your query and how you can shift the position of data within a line. See the CA Dataquery Reference Guide.

Notice that each column to appear in the report is listed on a separate line. They could be typed on one line, but this listing makes it easier to determine which individual columns are included in the report. As in previous steps, new lines have been inserted along with the data retrieved from the COLUMN DISPLAY.

After looking at the order of the columns, you can see that it is not logical to have the temporary result report column appear first in the report, so moving it makes it the last column in the report. Typing M indicates which line to move and typing A indicates which line it is to be placed after, then press Enter.

When the move operation is complete, it looks like a good idea to align names of the other columns with the SHIP-PRICE name, to improve visibility. Counting provides the number of spaces the column name must be shifted within the line and typing >8 in the line number of the first column and pressing Enter performs the shift. The > indicates that the data is to be moved to the right, while the 8 indicates that the shift is to be 8 spaces. Since the EDITOR does not perform multiple shift requests simultaneously, you must perform a separate operation for each line. After completing the shift operations, the query appears as shown in the next panel.

Completed Example

=> --------------------------------------------------------------------------DQD10 DATAQUERY: EDITOR CURRENT TABLE: CAI-DETAIL-TBL ------------------------------------------------------------------------------- NAME: USER-SAMPLE TYPE: QUERY STATUS: PRIVATE DESCRIPTION: TOTAL ORDERS PER CUSTOMER -- AVERAGE PRICE ....+....1....+....2....+....3....+....4....+....5....+....6....+....7....+. .. ================================ T O P ===================================== 01 FIND ALL CAI-DETAIL-TBL ROWS 02 WITH SHIP-QTY GT 0 03 SET SHIP-PRICE(7.2) = UNIT-PRICE * SHIP-QTY 04 SORT BY (CUST-ID) 05 PRINT FROM TITLE1 'FILLED CUSTOMER ORDERS' 06 CUST-ID 07 ITM-ID 08 SHIP-QTY 09 UNIT-PRICE 10 (SHIP-PRICE) PICTURE 'Z,ZZZ,ZZ9.99-' .. =========================== B O T T O M ================================== -------------------------------------------------------------------------------  <PF1> HELP        <PF2>  RETURN     <PF3> DISPLAY COLUMNS <PF4> DISPLAY KEYS  <PF5> DISPLAY ALL <PF6>  LIST TABLES<PF7> BACKWARD        <PF8> FORWARD  <PF9> TEMPLATE    <PF10> VALIDATE   <PF11> RIGHT/LEFT     <PF12>PROCESS MODE

Other Things You Could Do

The report has only one title line, but you can specify a second line to further describe the report.

You could specify an edit pattern for each column in the PRINT statement. You could also accumulate control break totals for other numeric columns. Each column, or selected columns, could be given an alternate heading to appear in the report.

Instead of shifting data to the right, you could shift it to the left using the < line command and a numeric factor to indicate the number of spaces the data is to be shifted. If you do not specify a numeric factor with either shift command, the default is one space.