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
Hi, If anyone has base SAS certification dumps, please share.
What does proc print, and proc contents are used for?
How can sas program be validated?
how could you generate test data with no input data? : Sas programming
What can be the size of largest dataset in SAS?
what is data access? : Sas-di
Are you sensitive to code walk-throughs peer review or QC review?
what is the difference between infile and input? : Sas-administrator
What do you code to create a macro? : sas-macro
what are informats in sas? : Sas-administrator
What is the order of application for output data set options, input data set options and SAS statements?
What would be the value of month at the end of data step execution and how many observations would be there?
What does the trace option do?
For clinical entire study how many tables will create approx?
How to test the debugging in sas?