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 / vijs
data new ;
input date ddmmyy10. ;
cards;
01/05/1955
01/09/1970
01/12/1975
19/10/1979
25/10/1982
10/10/1988
27/12/1991
;
run;
proc format ;
value dat low-'01jan1975'd=ddmmyy10.
'01jan1975'd-'01JAN1985'd="Disco Years"
'01JAN1985'd-high=date9.;
run;
proc print;
run;
proc print;
format date dat. ;
run;
| Is This Answer Correct ? | 3 Yes | 5 No |
Post New Answer View All Answers
Explain the difference between informat and format with an example.
what is function of retain statment
how does sas handle missing values in functions? : Sas programming
If you use a symput in a data step, when and where can you use the macro variable? : sas-macro
how does sas handle missing values in assignment statements? : Sas programming
How might you use MOD and INT on numeric to mimic SUBSTR on character Strings?
Have you used macros? For what purpose you have used? : sas-macro
Describe the function and untility of the most difficult SAS macro that you have written.
What are the default statistics that proc means produce?
Explain what Proc glm does?
How do you delete duplicate observations in sas?
What do the mod and int function do? : Sas programming
What is the basic structure of a sas program?
explain what is data set in sas? : Sas-administrator
Explain the special input delimiters used in sas programming.