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 proc sort?
do you prefer proc report or proc tabulate? Why? : Sas programming
What does PROC print, and PROC contents do?
What is a method to debug and test your SAS program?
What do you code to create a macro? : sas-macro
What would be the value of month at the end of data step execution and how many observations would be there?
what is scheduling and how will u implement it. In scheduling 5 jobs r running if there is an error occured at 3rd job and how will u check and waht necessary steps will u take not to repeat the same mistake
How do you define proc in sas? : sas-grid-administration
what does the run statement do? : Sas programming
Explain the difference between informat and format with an example.
: and & modifiers.
What are the new features included in the new version of SAS Programming Language?
how do you pull data from equifax?tell me the process?
Where do you use proc means over proc freq?
where are dashboard components are created and maintained? : Sas-bi