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 how you can debug and test your SAS program?
How can you create a macro variable with in data step? : sas-macro
What is the difference between input and infile statement?
What are SAS/ACCESS and SAS/CONNECT?
List out some key concept of SAS
How do you add a number to a macro variable? : sas-macro
What are types of transport files?
What is maximum number of rows and cols can be handled in SAS?
If you were told to create many records from one record, show how you would do this using array and with proc transpose?
What are the features of base sas system?
what are some problems you might encounter in processing missing values? In data steps? Arithmetic? Comparisons? Functions? Classifying data? : Sas programming
What does P-value signify about the statistical data?
What is a pdv and what are its functions?
what versions of sas have you used (on which platforms)? : Sas programming
What is the difference between SAS functions and procedures?