Presentation is loading. Please wait.

Presentation is loading. Please wait.

2012 OrlandoFlorida April 22-25, 2012 Sometimes one needs an option with unusual dates Arthur TabachneckMatthew Kastin Thornhill, OntarioLouisville, Colorado.

Similar presentations


Presentation on theme: "2012 OrlandoFlorida April 22-25, 2012 Sometimes one needs an option with unusual dates Arthur TabachneckMatthew Kastin Thornhill, OntarioLouisville, Colorado."— Presentation transcript:

1 2012 OrlandoFlorida April 22-25, 2012 Sometimes one needs an option with unusual dates Arthur TabachneckMatthew Kastin Thornhill, OntarioLouisville, Colorado Xia Ke Shan Beijing, China art297 FriedEgg KSharp

2 Sometimes one needs an option with unusual calendar dates 06APR2011 06JUL2011 06OCT2011 06JAN2011 05APR2012 beginning of fiscal year start of the 4 th quarter start of the 2 nd quarter start of the 3 rd quarter end of fiscal year

3 Wouldn’t it be nice to be able to automatically email a correct Chanukah greeting on the right days? ) ) | | | | | | | | | | |_|_|_|_|_|_|_|_| _|_ ) ) | | | | | | | | | | |_|_|_|_|_|_|_|_| _|_

4 ) ) ) | | | | | | | | | | |_|_|_|_|_|_|_|_| _|_ ) ) ) | | | | | | | | | | |_|_|_|_|_|_|_|_| _|_ Wouldn’t it be nice to be able to automatically email a correct Chanukah greeting on the right days?

5 ) ) ) ) | | | | | | | | | | |_|_|_|_|_|_|_|_| _|_ ) ) ) ) | | | | | | | | | | |_|_|_|_|_|_|_|_| _|_ Wouldn’t it be nice to be able to automatically email a correct Chanukah greeting on the right days?

6 ) ) ) ) ) | | | | | | | | | | |_|_|_|_|_|_|_|_| _|_ ) ) ) ) ) | | | | | | | | | | |_|_|_|_|_|_|_|_| _|_ Wouldn’t it be nice to be able to automatically email a correct Chanukah greeting on the right days?

7 ) ) ) ) ) | ) | | | | | | | | | |_|_|_|_|_|_|_|_| _|_ ) ) ) ) ) | ) | | | | | | | | | |_|_|_|_|_|_|_|_| _|_ Wouldn’t it be nice to be able to automatically email a correct Chanukah greeting on the right days?

8 ) ) ) ) ) | ) ) | | | | | | | | | |_|_|_|_|_|_|_|_| _|_ ) ) ) ) ) | ) ) | | | | | | | | | |_|_|_|_|_|_|_|_| _|_ Wouldn’t it be nice to be able to automatically email a correct Chanukah greeting on the right days?

9 ) ) ) ) ) | ) ) ) | | | | | | | | | |_|_|_|_|_|_|_|_| _|_ ) ) ) ) ) | ) ) ) | | | | | | | | | |_|_|_|_|_|_|_|_| _|_ Wouldn’t it be nice to be able to automatically email a correct Chanukah greeting on the right days?

10 ) ) ) ) ) | ) ) ) ) | | | | | | | | | |_|_|_|_|_|_|_|_| _|_ ) ) ) ) ) | ) ) ) ) | | | | | | | | | |_|_|_|_|_|_|_|_| _|_ Wouldn’t it be nice to be able to automatically email a correct Chanukah greeting on the right days?

11 or automatically email Chinese New Year greetings? /^\/^\ _|__| O| \/ /~ \_/ \ \____|__________/ \ \_______ \ `\ \ \ | | \ / / \ / / \\ / / _----_ \ \ / / _-~ ~-_ | | ( ( _-~ _--_ ~-_ _/ | \ ~-____-~ _-~ ~-_ ~-_-~ / ~-_ _-~ ~-_ _-~ ~--______-~ ~-___-~ _\______ /_______ ___ __\/_|___ / __|_ __/_ / _|_ | | _|__|__ / / __|__ /|\ | | | \/ | / | | /\ \|

12 the Islamic calendar the Hebrew calendar the Chinese agricultural calendar or any calendar you want? or conduct analyses of, or based on, dates from:

13 e.g., to be able to analyze effects that are functions of annual sporting event schedules?

14 Step 1: Create interval datasets data fyds fqds fmds; do begin= '06APR1900'd to '05APR2100'd; if day(begin) eq 6 then do; mbeg=month(begin); season=max(mbeg-3,(mbeg<4)*(mbeg+9)); end=intnx('month', begin, 1, 'same')-1; output fmds; if mbeg eq 4 then do; season=year(begin); end=intnx('year', begin, 1, 'same')-1; output fyds; end; if mbeg in (4,7,10,1) then do; season=max(round(mbeg/4,1),(mbeg<4)*4); end=intnx('month', begin, 3, 'same')-1; output fqds; end; format begin end date.; run;

15 Step 2: Apply the intervalds System Option options intervalds=(FiscalQuarter=FQDS FiscalMonth=FMDS FiscalYear=FYDS);

16 Step 3: Use any desired interval function(s) data want (keep=date fiscal:); set sashelp.pricedata (obs=12); format date date9.; fiscal_year=intindex( 'FiscalYear', date ); fiscal_qtr=intindex( 'FiscalQuarter', date ); fiscal_month=intindex( 'FiscalMonth', date ); next_year_start=intnx('FiscalYear',date,1,'b'); next_year_middle=intnx('FiscalYear',date,1,'m'); next_year_end=intnx('FiscalYear',date,1,'e'); format date next: date9.; run; /*Note: You can also use other interval functions*/

17 which will produce: fiscal fiscal fiscal_ next_year next_year next_year date _year _qtr month _start _middle _end 01JAN9819973906APR9805OCT9805APR99 01FEB98199741006APR9805OCT9805APR99 01MAR98199741106APR9805OCT9805APR99 01APR98199741206APR9805OCT9805APR99 01MAY9819981106APR9905OCT9905APR00 01JUN9819981206APR9905OCT9905APR00 01JUL9819981306APR9905OCT9905APR00 01AUG9819982406APR9905OCT9905APR00 01SEP9819982506APR9905OCT9905APR00 01OCT9819982606APR9905OCT9905APR00 01NOV9819983706APR9905OCT9905APR00 01DEC9819983806APR9905OCT9905APR00

18 British fiscal years the Hebrew calendar the Islamic calendar the Chinese Agricultural calendar the NCAA March Madness tournament hardest part is creating the interval datasets our paper includes code that creates datasets for: the datasets can be transferred to Google Calendar with the code in Bill Roehl’s paper, Using SAS® to Get a Date: Integrating Google Calendar’s API with SAS®

19 www.sascommunity.org/wiki/ Sometimes_One_Needs_an_Option_with_Unusual_Dates All of the code and this Powerpoint can be found at:

20 create functions using PROC FCMP import data from web sites create and use INTERVALDS datasets The code includes examples of how to: automatically create formats from data files use the hash method to create lookup tables create and send holiday email greetings write an expanded/localized Holiday function

21

22 Your comments and questions are valued and encouraged Arthur Tabachneck, Ph.D. myQNA, Inc., Thornhill, Ontario e-mail: atabachneck@gmail.com Matthew Kastin i-behavior, Inc., Louisville, Colorado email: matthew.kastin@gmail.com Xia Ke Shan Chinese Financial Electrical Company Beijing, China email: xiakeshan@yahoo.com.cn


Download ppt "2012 OrlandoFlorida April 22-25, 2012 Sometimes one needs an option with unusual dates Arthur TabachneckMatthew Kastin Thornhill, OntarioLouisville, Colorado."

Similar presentations


Ads by Google