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 / amit gupta

proc sql;
select
case when date lt '31DEC2006'd then date end as mydate
format=date7. from d1
case when date gt '31DEC2008'd then date end as mydate
format=date9. ,
case when '01JAN2007'd <= date <= '31DEC2008'd then 'DUMMY'
end as mydate
from d1 ;
quit;


Just that these are in three different columns;

Tried the above resolutions but unsuccessfully.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

If a variable contains letters or special characters, can it be numeric data type?

970


What are the difficulties u faced while doing vital signs table or dataset?

2156


do you need to know if there are any missing values? : Sas programming

756


If you need the value of a variable rather than the variable itself what would you use to load the value to a macro variable? : sas-macro

807


how to do user inputs and command line arguments in sas?

2649


how are numeric and character missing values represented internally? : Sas programming

847


Enlist the functions performed by sas.

858


What are the difference between sas functions and procedures?

835


explain the key concept of sas? : Sas-administrator

742


what are sas bi dashboard components? : Sas-bi

859


what is sas application server? : Sas-di

711


What do the put and input function do?

771


what is the different between functions and procs that calculate the same simple descriptive statistics? : Sas programming

799


What do you know about sas data set?

797


Name some categories in sas 9? : sas-grid-administration

731