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

Answer Posted / amit gupta

Apologies,
above code has an extra "FROM d1"

The working code is as below:

proc sql;
select
case when date lt '31DEC2006'd then date end as mydate
format=date7. ,
case when date gt '31DEC2008'd then date end as mydate
format=date9. ,
case when '01JAN2007'd <= date <= '31DEC2008'd then 'DUMMY'
end as mydate
from d1 ;
quit;

However it does give the data in 3 columns , which I was
unable to merge as the data type was different.

Any working solution using format ?

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

how sas deals with business intelligence? : Sas-bi

1017


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

1027


Mention common programming errors committed in sas ?

1078


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

881


How would you identify a macro variable?

1055


what is operational data and operational system? : Sas-di

1074


Can you execute macro within another macro? : sas-macro

954


what does the run statement do? : Sas programming

1013


name several ways to achieve efficiency in your program? : Sas programming

1004


How can you limit the variables written to output dataset in data step?

1269


what are the types of interactive display types? : Sas-bi

1058


what are the best practices to process the large data sets in sas programming? : Sas-administrator

979


Hi, If anyone has base SAS certification dumps, please share.

1819


What is the use of the %include statement?

1118


what is sas metadata repository? : Sas-bi

1076