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
what is function of retain statment
What are common programming errors committed in sas
How do you add a number to a macro variable? : sas-macro
What is the good sas programming practices for processing large data sets?
What is the basic syntax style in SAS?
what is data governance? : Sas-di
Mention how to limit decimal places for the variable using proc means?
I have a SCD Type 2 Dimention for Location In which A Sales Office in Having two Surrogate Keys just because of the change in it's Sales Group. SKey SalesGroup Sales Office BeginDate EndDate 280 SG1 SO1 01APR2000 01APR2010 281 SG2 SO1 02APR2010 31MAR2999 Now while loading the Fact, the Lookup ir returning SKey 280 for records before and after 01APR2010. I am not able to give WHERE condition in the Lookup Properties (TranDate between BeginDate and EndDate). Please help.
for whom is sas data integration studio designed? : Sas-di
what is the difference between unique key and primary key? : Sas-di
How does proc sql work?
What is the difference between order and group variable in proc report?
how does sas handle missing values in functions? : Sas programming
What is the basic syntax of a sas program?
Hi,by usining ptf how we have to combine (likr merge)10 datasets at a time in the oracle database(and write a macro code also)?Like this i have a douts a lot if you dont mind may please send one text mail for me(madhusudhanap16@gmail.com)?