Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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 / j. sheetal

Here is the correction in above example,
proc format;
value datestyl low-'31dec1974'd = [date7.]
'01jan1975'd - '31dec1985'd = 'disco Years'
'01jan1986'd - high = [date9.] ;
Run;

Example:

data k1;
input date2 $9.;
cards;
31dec1974
01jan1975
01jan1985
01jan1990
;

data temp;
set k1;
date1=input(date2,date9.);
sam = date1;
format sam datestyl.;
run;

proc print;
run;

Is This Answer Correct ?    4 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the differences between proc means and proc summary?

1066


what are 5 ways to perform a table lookup in sas? : Sas-administrator

1179


What do the PUT and INPUT functions do?

1269


What is PROC in SAS?

1000


How to create an external dataset with sas code?

1068


Differentiate between proc means and proc summary.

998


What are the difference between the sas data step and sas procs?

1102


What is the purpose of _character_ and _numeric_?

1012


Explain what is the use of proc gplot?

1124


Describe the ways in which you can create macro variables?

1110


What is the use of divide function?

1009


Given an unsorted data set, how to read the last observation to a new data set?

1286


What is your favorite all time computer book? Why?

2454


If a variable contains letters or special characters, can it be numeric data type?

1160


what cause the "error: connect:" and "error in the libname statement" when there weren't any such problems?

2125