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 is SAS? What are the functions does it performs?
what is sas metadata repository? : Sas-bi
Are you involved in writing the inferential analysis plan? Tables specifications?
how to change the execute of macro
what is the basic structure sas administrator? : Sas-administrator
what are some differences between proc summary and proc means? : Sas programming
How will you generate test data with no input data?
what is the difference between nodup and nodupkey options? : Sas programming
To what type of programms have you used scratch macros?
how to generate the test data in sas without input data? : Sas-administrator
Are you involved in writing the inferential analysis plan? Tables specfications?
how do the in= variables improve the capability of a merge? : Sas programming
Explain data_null_?
What is the basic syntax of a sas program?
how do you test for missing values? : Sas programming