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
How would you determine the number of missing or nonmissing values in computations?
Differentiate between proc means and proc summary.
What are types of transport files?
I have a SCD Type 2 Dimention for Location In which A Sales Office in Having two Surrogate Keys just because of the change in it's Sales Group. SKey SalesGroup Sales Office BeginDate EndDate 280 SG1 SO1 01APR2000 01APR2010 281 SG2 SO1 02APR2010 31MAR2999 Now while loading the Fact, the Lookup ir returning SKey 280 for records before and after 01APR2010. I am not able to give WHERE condition in the Lookup Properties (TranDate between BeginDate and EndDate). Please help.
What is the good sas programming practices for processing large data sets?
Explain the purpose of retain statement.
What would be the value of month at the end of data step execution and how many observations would be there?
What does PROC print, and PROC contents do?
for whom is sas data integration studio designed? : Sas-di
How to limit decimal places for the variable using proc means?
Do you need to know if there are any missing values?
how sas deals with business intelligence? : Sas-bi
Describe a time when you were really stuck on a problem and how you solved it?
Compare sas with other data analytics tools.
What are the statements in proc sql?