The following query demonstrates the use of specifying an edit pattern in the PRINT statement.
FIND 10 CAI-SLSHST-REC ROWS
WITH SHIP-QTY > 0
PRINT FROM CAI-SLSHST-REC SLMN-ID 'REPRESENTATIVE'
ORD-ID 'ORDER NUMBER'
ITM-ID 'ITEM NUMBER'
SHIP-QTY 'QUANTITY SHIPPED'
PICTURE 'ZZZZZZ9-'
UNIT-PRICE 'PRICE'
PICTURE '$$$$$9.99-'
DISC-PCT 'PERCENT DISCOUNT'
PICTURE '99.9-'
Replace leading zeros with blanks.
Indicate that the corresponding digit position in the column is to be printed, even if it is a zero.
Instructs CA Dataquery to place a dollar sign to the left of the first digit which is not 0. For UNIT-PRICE, an extra dollar sign is required to allow for a floating dollar sign even when the column is a full seven digits long.
Indicates a signed column (determined by displaying the Extended Column Definition).
The number of positions identified in each PICTURE clause represents the maximum width of the column (plus any floating dollar sign).
Output
When you execute the preceding query, the following appears as output. Notice the result of the PICTURE clause for SHIP-QTY and UNIT-PRICE. Also notice that the DISC-PCT column output does not appear on this page of the report.
PRINT Output with PICTURE Clause
=> 01/02/2010 CA Dataquery PAGE 1A 15:30:52 DETAIL REPRESENTATIVE ORDER NUMBER ITEM NUMBER QUANTITY SHIPPED PRICE -------------- ------------ ----------- ---------------- -------- I4790 01002 A10002 4 $19.99 I4790 01002 A20000 1 $149.99 I4790 01002 A30000 2 $39.99 15266 01004 A40000 5 $5.99 I4790 01002 A60000 4 $49.99 52733 02121 C10001 23 $21.00 H4130 01003 H10003 100 $12.99 H4130 01003 H20005 200 $17.99 H4130 01003 H30001 102 $14.99 H4130 01003 H40000 900 $15.99 -------------------------------- LAST PAGE --------------------------------- => <PF1> HELP <PF2> RETURN <PF3> TOTALS ONLY <PF4> DETAIL <PF5> NO TOTALS <PF6> STATS <PF7> BACKWARD <PF8> FORWARD <PF9> NOT USED <PF10> NOT USED <PF11> LEFT <PF12> RIGHT
|
Copyright © 2014 CA.
All rights reserved.
|
|