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 is the difference between: x=a+b+c+d; and x=sum (of a, b, c ,d);? : Sas programming

1145


If you have a dataset that contains 100 variables, but you need only five of those, what is the code to force SAS to use only those variables?

1165


Which date function advances a date, time or datetime value by a given interval?

1155


What are the different versions of sas that you have used until now? : sas-grid-administration

1341


what are several options for creating reports in web report studio? : Sas-bi

1159


What is the difference between input and infile statement?

1178


How do dates work in SAS data?

1182


I need level 2 to 5 sas using companies in india

2382


What are the special input delimiters used in SAS?

1184


what is sas application server? : Sas-di

1083


What are the data types that sas contain?

1186


What are the statements in proc sql?

1105


What are the differences between proc means and proc summary?

1145


Give some examples where proc report’s defaults are same as proc print’s defaults?

1113


How do you use the do loop if you don’t know how many times you should execute the do loop?

1263