|
There is probably a more elegent way of doing it, but this should get you
there:
DATA HAVE;
INPUT date $17.;
CARDS;
January 2008
February 2008
;
RUN;
DATA WANT;
SET HAVE;
FORMAT QUARTER YYQ6. ;
DATE=UPCASE(DATE);
XVAL = SUBSTR(DATE,1,3)||COMPRESS(DATE,COMPRESS(DATE,'1234567890'));
QUARTER = INPUT(XVAL,MONYY7.);
DROP XVAL;
RUN;
|