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
What would be the result of the following SAS function (given that 31 Dec, 2000 is Sunday)?
What are the difference between the sas data step and sas procs?
How do you define proc in sas? : sas-grid-administration
What is the role of unrestrictive users? : sas-grid-administration
how would you create a data set with 1 observation and 30 variables from a data set with 30 observations and 1 variable? : Sas programming
what is operational data and operational system? : Sas-di
What is the use of stop statement?
Explain the difference between using drop = data set option in set and data statement?
name the scheduler for scheduling job and explain the scheduler? : Sas-di
How we can call macros with in data step? : sas-macro
What is the use of divide function?
What do you know about symput and symget?
do you need to know if there are any missing values? : Sas programming
What are the features of base sas system?
What is the difference between order and group variable in proc report?