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 other sas products have you used and consider yourself proficient in using? : Sas programming
how to change the execute of macro
what do the mod and int function do? What do the pad and dim functions do? : Sas programming
What is the difference between match merge and one to one merge?
What is SAS?
How will you use the WHO Drug Dictionary for Reporting Clinical Trials?
what cause the "error: connect:" and "error in the libname statement" when there weren't any such problems?
what is slowly changing dimension? : Sas-di
What are the advantages of using sas?
What can you learn from the SAS log when debugging?
Give an example where SAS fails to convert character value to numeric value automatically?
How would you code a macro statement to produce information on the sas log? This statement can be coded anywhere? : sas-macro
What function CATX syntax does?
for whom is sas data integration studio designed? : Sas-di
what r the job openings SAS for fresher graduates !