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
Differentiate between format and informat? : sas-grid-administration
How to create a permanent sas data set?
name several ways to achieve efficiency in your program? : Sas programming
What is the function of Stop statement in a SAS Program?
How will you use the WHO Drug Dictionary for Reporting Clinical Trials?
How do you specify the number of iterations and specific condition within a single do loop?
how many types prompting framework can be broken down to? : Sas-bi
what is the effect of the options statement errors=1? : Sas programming
hi tell be about pfizer? how to compare the work with other companies ? please tell me how to login and work also?
: and & modifiers.
What is the function of output statement in a SAS Program?
What do the put and input function do?
What is the differnce between SDTM 3.1.2 to 3.1.1 version
what is function of retain statment
Explain how you can debug and test your SAS program?