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
Explain input and put function?
Are you involved in writing the inferential analysis plan? Tables specfications?
what do the pad and dim functions do? : Sas programming
Are you sensitive to code walk-throughs peer review or QC review?
how does sas handle missing values in a merge? : Sas programming
Explain the purpose of retain statement.
I am preparing SAS Certified Advanced Programmer for SAS 9 in 2014. If anybody has the latest dumps for this exam, please mail me at dhiman.mukherjee@gmail.com
Do we follow ADAM in analysis dataset development?How? Usually which version? Why is it necessary?
what is sas database server? : Sas-di
How many ways to overcome a missing values???
What are pdv and it functions?
how can you put a "trace" in your program? : Sas programming
Explain how you can debug and test your SAS program?
What do you know about sas and what we do? : sas-grid-administration
what are the categories that sas informats are used to the place the data? : Sas-administrator