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
Explain bmdp procedure?
Which date function advances a date, time or datetime value by a given interval?
To what type of programms have you used scratch macros?
what is transformation in sas data integration? : Sas-di
what is hash files in sas and why we are using this one in sas?
What are the functions used for character handling?
what is broad cast agent? : Sas-bi
How might you use MOD and INT on numeric to mimic SUBSTR on character Strings?
Can you explain the process of calendar?
What is by-group processing?
Difference between nodup and nodupkey options?
What are the 3 components in sas programming?
What is the difference between one to one merge and match merge? Give an example.
how do the in= variables improve the capability of a merge? : Sas programming
I need level 2 to 5 sas using companies in india