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
how to do user inputs and command line arguments in sas?
How do you delete duplicate observations in sas?
What is the command used to find missing values?
what is metadata? : Sas-bi
what other sas products have you used and consider yourself proficient in using? : Sas programming
please can you tell me that in companies sas work are doing by through sas coding or sas wizard ??
what is sas data set?
what is the difference between nodup and nodupkey options? : Sas programming
How do you define proc in sas? : sas-grid-administration
Describe crosslist option in tables statement?
What do the mod and int function do? : Sas programming
What are the applications primarily used by business analyst? : Sas-bi
what is the Population you used in your project, is it ITT or PP?
Explain proc univariate?
what is a method for assigning first.var and last.var to the by groupvariable on unsorted data? : Sas programming