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

data new ;
input date ddmmyy10. ;
cards;
01/05/1955
01/09/1970
01/12/1975
19/10/1979
25/10/1982
10/10/1988
27/12/1991
;
run;

proc format ;

value dat low-'01jan1975'd=ddmmyy10.
'01jan1975'd-'01JAN1985'd="Disco Years"
'01JAN1985'd-high=date9.;
run;

proc print;
run;

proc print;
format date dat. ;
run;

Is This Answer Correct ?    3 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the use of divide function?

609


why is sas data integration studio important? : Sas-di

564


what is sas and what are the functions? : Sas-administrator

544


name several ways to achieve efficiency in your program? : Sas programming

573


What are SAS/ACCESS and SAS/CONNECT?

636






what are the considerations when picking a SAS/STAT procedure?

2906


Mention what is PROC in SAS?

605


How does the internal authentication work in sas? : sas-grid-administration

586


How can I remove header from output data set?

2066


Assuming {et} is randomly drawn from N(0,1) and e0 = 0, generate 200 observations of xt = et − 0.5e(t−1) and draw a line graph of xt.

1465


What is run-group processing?

628


how does sas handle missing values in: assignment statements, functions, a merge, an update, sort order, formats, procs? : Sas programming

604


What are the different types of sas functions?

612


what is data governance? : Sas-di

626


What is the length assigned to the target variable by the scan function?

679