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
its
between 1975 and 1985. How would you accomplish this in
data step code? Using only PROC FORMAT.

Answer Posted / kamalan

proc format;
value datestyl low-'31dec1974'd = [date7.]
'01jan1975'd - '31dec1985'd = 'disco Years'
'01jan1986'd - max = [date9.] ;
Run;

proc print data = abc;
format dateval datestyl.;
Run;

Is This Answer Correct ?    6 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

If you were told to create many records from one record, show how you would do this using array and with proc transpose?

806


Which statement does not perform automatic conversions in comparisons?

1205


What is interleaving in SAS?

679


What is the use of divide function?

608


what are input dataset and output dataset options? : Sas programming

567






What are the difficulties u faced while doing vital signs table or dataset?

1939


how does sas handle missing values in sort order? : Sas programming

537


describe the interaction table in sas di? : Sas-di

597


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

598


what are some differences between proc summary and proc means? : Sas programming

511


do you need to know if there are any missing values? : Sas programming

553


Can you execute a macro within a macro? Describe. : sas-macro

678


how many types prompting framework can be broken down to? : Sas-bi

637


What is the difference between SAS functions and procedures?

661


Explain the difference between using drop = data set option in set and data statement?

687