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 / kavitha
DATA D1;
INPUT SLNO DATE DATE9. ;
DATALINES;
1 12DEC08
2 22NOV08
3 01JAN08
4 12FEB07
5 13MAR07
6 24APR06
7 17MAY06
8 20JUN05
9 29JUL05
10 30APR09
;
RUN;
proc format ;
value KAVI low-'31DEC2006'd='***ddmonyy***'
'01JAN2007'd-'31DEC2007'd='***dd mon ccyy***'
'01JAN2008'd-high=' **Disco Years **';
RUN;
proc print data=D2 noobs label;
format DATE KAVI.;
RUN;
| Is This Answer Correct ? | 2 Yes | 5 No |
Post New Answer View All Answers
describe how to adjust the performance of data integrator? : Sas-di
What are the best sas programming practices for handling very large datasets? : sas-grid-administration
Which statement does not perform automatic conversions in comparisons?
How to test the debugging in sas?
If you could design your ideal job, what would it look like?
what is operational data and operational system? : Sas-di
sas implementing companies in pune implementing clinical projects if anyone knows plz send ans immediately
if a variable contain dates like "2015/01"---"2015/12" (yymm) ,How to add day to those dates,if them month is jan then 31 if the month is feb then 28 so on ...
Explain data_null_?
Tell e how how dealt with..
how are numeric and character missing values represented internally? : Sas programming
How do dates work in SAS data?
what is sas data set?
what is sas metadata server? : Sas-di
Explain data step in SAS