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 / paul
proc format ;
value dat low-'31DEC1974'd=[date7.]
'01JAN1975'd-'31DEC1985'd="Disco Years"
'01JAN1986'd-high=[date9.];
run;
proc sql;
select date format=dat. from D1 ;
quit;
| Is This Answer Correct ? | 3 Yes | 0 No |
Post New Answer View All Answers
how can you import .csv file in to sas? : Sas programming
What is the use of divide function?
how to do user inputs and command line arguments in sas?
what r the job openings SAS for fresher graduates !
What does PROC print, and PROC contents do?
Explain the use of proc print and proc contents?
What are symget and symput? : sas-macro
sas implementing companies in pune implementing clinical projects if anyone knows plz send ans immediately
data data1; input dt account; format dt date9.; cards; 1745 1230 1756 1120 1788 1130 1767 1240 ; data data2; input startdt enddt total; format startdt date9. enddt date9.; cards; 1657 1834 12300 1557 1758 16800 1789 1789 12300 1788 1345 12383 1899 1899 13250 ; proc sql; create table data3 as select * from data1 as x left join data2 as y on x.dt>=y.startdt and x.dt<=y.enddt; quit; Here, we are getting cartision product. But,I want left join report consisting of this program. It should not get duplicate values. you can modify the program also.
What is the basic syntax style in SAS?
If a variable contains letters or special characters, can it be numeric data type?
How to include or exclude specific variables in a data set?
what are the benefits of data integration? : Sas-di
name some data transformation used in sas di? : Sas-di
What are common programming errors committed in sas