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


Please Help Members By Posting Answers For Below Questions

Explain proc sort?

651


do you prefer proc report or proc tabulate? Why? : Sas programming

561


What does PROC print, and PROC contents do?

704


What is a method to debug and test your SAS program?

698


What do you code to create a macro? : sas-macro

561






What would be the value of month at the end of data step execution and how many observations would be there?

564


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

1905


How do you define proc in sas? : sas-grid-administration

660


what does the run statement do? : Sas programming

544


Explain the difference between informat and format with an example.

670


: and & modifiers.

854


What are the new features included in the new version of SAS Programming Language?

722


how do you pull data from equifax?tell me the process?

1369


Where do you use proc means over proc freq?

548


where are dashboard components are created and maintained? : Sas-bi

545