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


Please Help Members By Posting Answers For Below Questions

how to do user inputs and command line arguments in sas?

2640


How do you delete duplicate observations in sas?

791


What is the command used to find missing values?

786


what is metadata? : Sas-bi

780


what other sas products have you used and consider yourself proficient in using? : Sas programming

875


please can you tell me that in companies sas work are doing by through sas coding or sas wizard ??

1876


what is sas data set?

855


what is the difference between nodup and nodupkey options? : Sas programming

857


How do you define proc in sas? : sas-grid-administration

851


Describe crosslist option in tables statement?

923


What do the mod and int function do? : Sas programming

802


What are the applications primarily used by business analyst? : Sas-bi

747


what is the Population you used in your project, is it ITT or PP?

2439


Explain proc univariate?

776


what is a method for assigning first.var and last.var to the by groupvariable on unsorted data? : Sas programming

757