DEFINE FILE CAR
CAR1/I11= IF CAR_ID NE '' THEN 1 ELSE 0;
CAR2/I11= IF INF_ID EQ '' THEN 1 ELSE 0;
CTRY/I11= IF LEG_ID EQ '' THEN 1 ELSE 0;
E_IT/I11= IF MAT_ID NE '' THEN 1 ELSE 0;
-*
OPEN_DATE/YYM = HDATE(OPEN_DATE, 'YYMD');
REOPEN_DATE/YYM= HDATE(REOPEN_DATE, 'YYMD');
CLOSE_DATE/YYM= HDATE(CLOSE_DATE, 'YYMD');
OP_C/I11= IF OPEN_DATE LT 200010 THEN 1 ELSE 0;
NEW_C/I11= IF OPEN_DATE GE 200010 THEN 1 ELSE 0;
-*
END
I was in need of the below o/p from the above DEFINE..
This message has been edited. Last edited by: Kerry,
June 02, 2010, 09:38 AM
GinnyJakes
Since OP_C and NEW_C are mutually exclusive from the way you coded them, you only need one field to identify the value which will be 0 or 1. Then you can use a DECODE to give them a name. Please reference the following example:
DEFINE FILE CAR
SORT1/I1=IF COUNTRY EQ 'ENGLAND' THEN 0 ELSE IF COUNTRY EQ 'JAPAN' THEN 1 ELSE 2;
SORTFLD/A10=DECODE SORT1(0 'NEW_C' 1 'OP_C');
END
TABLE FILE CAR
SUM DEALER_COST RETAIL_COST
BY SORT1 NOPRINT
BY SORTFLD AS ''
ON TABLE ROW-TOTAL
WHERE SORT1 LT 2
END
Also, please, please put your code in between the code tags (the red left and right carats to the far right of the ribbon bar) so that it lines up properly.