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 / paul
proc format ;
value dat low-'31DEC1974'd=[date7.]
'01JAN1975'd-'31DEC1985'd="Disco Years"
'01JAN1986'd-high=[date9.];
run;
proc sql;
select date format=dat. from D1 ;
quit;
| Is This Answer Correct ? | 3 Yes | 0 No |
Post New Answer View All Answers
Intern stastical programmer written test
How to test the debugging in sas?
What versions of SAS have you used (on which platforms)?
Describe the function and untility of the most difficult SAS macro that you have written.
what is the difference between nodup and nodupkey options? : Sas programming
How would you code a merge that will write the matches of both to one data set, the non-matches from the left-most data?
what is sas metadata repository? : Sas-bi
which date function advances a date, time or datetime value by a given interval? : Sas programming
How to limit decimal places for variable using proc means?
Did you used proc test? when?
what is operational data and operational system? : Sas-di
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
why is sas data integration studio important? : Sas-di
what is program data vector? : Sas-administrator
What is run-group processing?