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 / schuler

data formated(keep=datenew);
length datenew $10.;
set new;
if date<'31dec1974'd then datenew=put(date,date7.);
else if date>'31dec1984'd then datenew=put(date,date7.);
else datenew='Disco Year';
run;
proc print data=formated nobs;run;

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

is data integration and etl programming is same? : Sas-di

578


what is SAS OPTIMIZATION?

1818


I have a dataset concat having variable a b & c. How to rename a b to e & f?

583


what is ae onset date n what is RDS

1939


Can you suggest us materials for sdtm mapping?

4039






If you have a dataset that contains 100 variables, but you need only five of those, what is the code to force SAS to use only those variables?

707


what is business intelligence? : Sas-bi

585


What is program data vector (pdv) and what are its functions?

631


What function CATX syntax does?

693


Mention sas system options to debug sas macros.

664


What are the difference between sas functions and procedures?

644


Explain the use of proc print and proc contents?

562


name some data transformation used in sas di? : Sas-di

548


What are the difference between the sas data step and sas procs?

614


How long can a macro variable be? A token? : sas-macro

721