There is a field containing a date. It needs to be
displayed in the format
"ddmonyy" if it's before 1975,
"dd mon ccyy" if it's after 1985, and
as 'Disco Years' if it's between 1975 and 1985.
How would you accomplish this in data step code? Using
only PROC FORMAT

Answer Posted / kavitha

DATA D1;
INPUT SLNO DATE DATE9. ;
DATALINES;
1 12DEC08
2 22NOV08
3 01JAN08
4 12FEB07
5 13MAR07
6 24APR06
7 17MAY06
8 20JUN05
9 29JUL05
10 30APR09
;
RUN;

proc format ;
value KAVI low-'31DEC2006'd='***ddmonyy***'
'01JAN2007'd-'31DEC2007'd='***dd mon ccyy***'
'01JAN2008'd-high=' **Disco Years **';
RUN;

proc print data=D2 noobs label;
format DATE KAVI.;
RUN;

Is This Answer Correct ?    2 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How you can read the variables that you need?

656


For a user to have access to a standard workspace server, is internal authentication alone is sufficient? : sas-grid-administration

538


What areas of SAS are you most interested in?

1070


Did you used proc test? when?

1577


What does proc print, and proc contents are used for?

613






what is data integration? : Sas-di

617


what is the purpose of _error_? : Sas programming

614


How to convert a numeric variable to a character variable?

634


how to generate the test data in sas without input data? : Sas-administrator

582


is data integration and etl programming is same? : Sas-di

578


What are the different servers in sas? : sas-grid-administration

605


Explain what Proc glm does?

642


what is the limit of the number of the rows and columns available in the worksheet? : Sas-bi

636


Differentiate between format and informat? : sas-grid-administration

584


How long can a macro variable be? A token? : sas-macro

721