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
Difference between SAS STATA & SPSS?
What are the features of base sas system?
If you could design your ideal job, what would it look like?
what are informats in sas? : Sas-administrator
Give an example where SAS fails to convert character value to numeric value automatically?
Describe a time when you were really stuck on a problem and how you solved it?
What are the new features included in the new version of SAS Programming Language?
describe about metadata object? : Sas-di
How to specify variables to be processed by the freq procedure?
Approximately what date is represented by the SAS date value of 730?
What does PROC print, and PROC contents do?
Differences between where and if statement?
what are _numeric_ and _character_ and what do they do? : Sas programming
Explain how you can debug and test your SAS program?
Tell e how how dealt with..