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 / sheldon
proc sql;
create table fmtdate(keep=newdate) as
select date,
case
when date lt '31DEC1974'd then put(date,date7.)
when date gt '31DEC1984'd then put(date,date9.)
else 'Desco Year'
end as newdate
from d1;
quit;
Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
what are 5 ways to perform a table lookup in sas? : Sas-administrator
I have a SCD Type 2 Dimention for Location In which A Sales Office in Having two Surrogate Keys just because of the change in it's Sales Group. SKey SalesGroup Sales Office BeginDate EndDate 280 SG1 SO1 01APR2000 01APR2010 281 SG2 SO1 02APR2010 31MAR2999 Now while loading the Fact, the Lookup ir returning SKey 280 for records before and after 01APR2010. I am not able to give WHERE condition in the Lookup Properties (TranDate between BeginDate and EndDate). Please help.
Which command is used to save logs in the external file?
Tell e how how dealt with..
what is the purpose of _error_? : Sas programming
What is the role of administrative users? : sas-grid-administration
What is program data vector (pdv) and what are its functions?
Explain append procedure?
What are the implications?
Describe crosslist option in tables statement?
Did you used proc test? when?
what is metadata? : Sas-bi
If you were told to create many records from one record, show how you would do this using array and with proc transpose?
What are the different operating system platforms in which we can use sas? : sas-grid-administration
How do you add a number to a macro variable? : sas-macro