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 / amit gupta
proc sql;
select
case when date lt '31DEC2006'd then date end as mydate
format=date7. from d1
case when date gt '31DEC2008'd then date end as mydate
format=date9. ,
case when '01JAN2007'd <= date <= '31DEC2008'd then 'DUMMY'
end as mydate
from d1 ;
quit;
Just that these are in three different columns;
Tried the above resolutions but unsuccessfully.
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What areas of SAS are you most interested in?
hi all, I need the SAS DI DUMP(A00 260) for attending the certification. if any one have, pls provide it.Please Email to vrpotluri@hotmail.com. Thanks - Ramana
How many ways to overcome a missing values???
what is function of retain statment
what is null hypothesis? why do you consider that?
Explain what is data step?
describe how to adjust the performance of data integrator? : Sas-di
What is the purpose of trailing @ and @@? How do you use them?
Can you execute a macro within a macro? Describe. : sas-macro
where are dashboard components are created and maintained? : Sas-bi
What is the difference between class statement and by statement in proc means?
how to read the variables in sas? : Sas-administrator
How would you code a macro statement to produce information on the sas log? This statement can be coded anywhere? : sas-macro
what are sas/access and sas/connect? : Sas programming
Explain input and put function?