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 / schuler
data formated(keep=datenew);
length datenew $10.;
set new;
if date<'31dec1974'd then datenew=put(date,date7.);
else if date>'31dec1984'd then datenew=put(date,date7.);
else datenew='Disco Year';
run;
proc print data=formated nobs;run;
Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
is data integration and etl programming is same? : Sas-di
what is SAS OPTIMIZATION?
I have a dataset concat having variable a b & c. How to rename a b to e & f?
what is ae onset date n what is RDS
Can you suggest us materials for sdtm mapping?
If you have a dataset that contains 100 variables, but you need only five of those, what is the code to force SAS to use only those variables?
what is business intelligence? : Sas-bi
What is program data vector (pdv) and what are its functions?
What function CATX syntax does?
Mention sas system options to debug sas macros.
What are the difference between sas functions and procedures?
Explain the use of proc print and proc contents?
name some data transformation used in sas di? : Sas-di
What are the difference between the sas data step and sas procs?
How long can a macro variable be? A token? : sas-macro