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
its
between 1975 and 1985. How would you accomplish this in
data step code? Using only PROC FORMAT.
Answer Posted / kamalan
proc format;
value datestyl low-'31dec1974'd = [date7.]
'01jan1975'd - '31dec1985'd = 'disco Years'
'01jan1986'd - max = [date9.] ;
Run;
proc print data = abc;
format dateval datestyl.;
Run;
Is This Answer Correct ? | 6 Yes | 0 No |
Post New Answer View All Answers
If you were told to create many records from one record, show how you would do this using array and with proc transpose?
Which statement does not perform automatic conversions in comparisons?
What is interleaving in SAS?
What is the use of divide function?
what are input dataset and output dataset options? : Sas programming
What are the difficulties u faced while doing vital signs table or dataset?
how does sas handle missing values in sort order? : Sas programming
describe the interaction table in sas di? : Sas-di
name the scheduler for scheduling job and explain the scheduler? : Sas-di
what are some differences between proc summary and proc means? : Sas programming
do you need to know if there are any missing values? : Sas programming
Can you execute a macro within a macro? Describe. : sas-macro
how many types prompting framework can be broken down to? : Sas-bi
What is the difference between SAS functions and procedures?
Explain the difference between using drop = data set option in set and data statement?