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

Hi, If anyone has base SAS certification dumps, please share.

1390


What does proc print, and proc contents are used for?

613


How can sas program be validated?

581


how could you generate test data with no input data? : Sas programming

635


What can be the size of largest dataset in SAS?

721






what is data access? : Sas-di

611


Are you sensitive to code walk-throughs peer review or QC review?

2615


what is the difference between infile and input? : Sas-administrator

615


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

585


what are informats in sas? : Sas-administrator

590


What is the order of application for output data set options, input data set options and SAS statements?

1087


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

583


What does the trace option do?

671


For clinical entire study how many tables will create approx?

1523


How to test the debugging in sas?

612