August 14, 2007, 01:06 PM
TryFocusAdding a New Field
Hi guys,
Want to add a new columns which shows the Date. But I want to add this Date field as last column but restricting to only 1 row.
Below is sample data Format...
COUNTRY|SEATS|CurrentDATE|
ENGLAND|2 |2007/08/14 |
FRANCE |4 | |
ITALY |5 | |
JAPAN |6 | |
Know how to create using DEFINE and using IF condition like IF COUNTRY EQ 'ENGLAND' THEN &YYMD.
But COUNTRY|SEATS is a Hold file (Which is created depending on data - We can't use IF condition as data is not same for every RUN)
Any suggestions or work arounds is appreciated.
Thanks
August 14, 2007, 03:00 PM
ETHere is adding the date to the first record.
Good luck!!
TABLE FILE CAR
PRINT SEATS
COMPUTE CNT1/I9=LAST CNT1 + 1; NOPRINT
COMPUTE DT/MDY=IF CNT1 EQ 1 THEN '081407' ELSE 0;
BY COUNTRY
END
COUNTRY SEATS DT
------- ----- --
ENGLAND 4 08/14/07
5
4
2
FRANCE 5
ITALY 2
2
4
2
JAPAN 4
4
W GERMANY 5
5
4
5
5
5
August 14, 2007, 03:57 PM
TryFocusThank you.