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


Please Help Members By Posting Answers For Below Questions

What are the scrubbing procedures in sas?

573


What is the difference between INPUT and INFILE ?

754


Mention common programming errors committed in sas ?

647


what is the difference between calculating the 'mean' using the mean function and proc means? : Sas programming

627


name the scheduler for scheduling job and explain the scheduler? : Sas-di

594






what is the use of proc sql? : Sas programming

594


what is the function of catx syntax? : Sas-administrator

654


Tell e how how dealt with..

1773


Is the physical structure of the data set in the same orientation as the report? Do you need to reshape the data sets? What method should you use to reshape the data–DATA steps,PROC TRANSPOSE,output data set from a procedure?

1768


what do the mod and int function do? What do the pad and dim functions do? : Sas programming

617


what are sas/access and sas/connect? : Sas programming

548


Explain what is SAS informats?

623


AE datasets names? how many types?

2078


how the sas basic syntax style described? : Sas-administrator

608


What is PDV?

725