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


Please Help Members By Posting Answers For Below Questions

what is function of retain statment

1527


What are common programming errors committed in sas

674


How do you add a number to a macro variable? : sas-macro

545


What is the good sas programming practices for processing large data sets?

632


What is the basic syntax style in SAS?

621






what is data governance? : Sas-di

626


Mention how to limit decimal places for the variable using proc means?

647


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.

1700


for whom is sas data integration studio designed? : Sas-di

558


what is the difference between unique key and primary key? : Sas-di

603


How does proc sql work?

618


What is the difference between order and group variable in proc report?

845


how does sas handle missing values in functions? : Sas programming

604


What is the basic syntax of a sas program?

671


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)?

1216