The following sample query illustrates the use of a PICTURE clause in the DISPLAY statement.
FIND 10 CAI-SLSHST-REC ROWS
WITH SHIP-QTY > 0
DISPLAY 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 this DISPLAY query, the following appears as output. Notice the result of the PICTURE clause.
DISPLAY Output with PICTURE Clause
=> ------------------------------------------------------------------------DQED0 DATAQUERY: COLUMN VALUE DISPLAY ROW 00001 PAGE 00001 ----------------------------------------------------------------------------- REPRESENTATIVE I4790 ORDER NUMBER 01002 ITEM NUMBER A10002 QUANTITY SHIPPED 4 PRICE $19.99 PERCENT DISCOUNT .0 ----------------------------------------------------------------------------- <PF1> HELP <PF2> RETURN <PF3> PREV ROW <PF4> NEXT ROW <PF5> NOT USED <PF6> STATS <PF7> BACKWARD <PF8> FORWARD
|
Copyright © 2014 CA.
All rights reserved.
|
|