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
Explain by-group processing?
how does sas handle missing values in formats? : Sas programming
What Proc glm does?
what are the categories that sas informats are used to the place the data? : Sas-administrator
How would you include common or reuse to be processed along with your statements?
Explain what is data step?
Describe the ways in which you can create macro variables? : sas-macro
Explain proc univariate?
how do you pull data from equifax?tell me the process?
what is the use of sas management console? : Sas-di
How to convert a numeric variable to a character variable?
where are dashboard components are created and maintained? : Sas-bi
How does SAS handle missing values in: assignment statements, functions, a merge, an update, sort order, formats, PROCs?
How can I remove header from output data set?
how many display types available in sas bi dashboard? : Sas-bi