LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (November 2006, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Sun, 26 Nov 2006 17:54:59 -0500
Reply-To:   Arthur Tabachneck <art297@NETSCAPE.NET>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   Arthur Tabachneck <art297@NETSCAPE.NET>
Subject:   Re: require help in the program to find holiday
Comments:   To: Peter Crawford <peter.crawford@BLUEYONDER.CO.UK>

HTH, Art ---- On Sun, 26 Nov 2006 13:07:27 -0500, Peter Crawford <peter.crawford@BLUEYONDER.CO.UK> wrote:

>isn't there a holiday file available from microsoft somewhere >???????????? > > >On Fri, 24 Nov 2006 14:27:48 -0500, Scott Barry <sbarry@SBBWORKS.COM> >wrote: > >>I use a combination of SAS-formatted date values (format: ddmmm, by using >SAS format date5. with a >>PUT function call) which are holidays every year, as well as other >date/year-specific literal values >>(trailing "D" denotes a date value) in a SAS DATA step IF THEN ELSE >expression, as shown below >>(reference U. S. holidays for illustration): >> >>%MACRO TEST_HOLIDAY(date_var=MYDATE,holiday_var=HOLIDAY); >>%* data step macro logic to assign holiday indicator Y/N ; >>IF PUT(&date_var,DATE5.) IN ('01JAN','04JUL','25DEC') OR >> &date_var IN ( >> '30MAY2005'D >> '04JUL2005'D >> '05SEP2005'D >> '24NOV2005'D >> '24DEC2005'D >> '02JAN2006'D >> '29MAY2006'D >> '04SEP2006'D >> '23NOV2006'D >> '02JAN2007'D >> '28MAY2007'D >> '03SEP2007'D >> '22NOV2007'D >> ) THEN &holiday_var='Y'; >>ELSE &holiday_var='N'; >>%MEND TEST_HOLIDAY; >>* DATA STEP CODE TO TEST HOLIDAY INDICATORY ASSIGNMENT. ; >>DATA _NULL_; >>FORMAT MY_DATE DATE9.; >>* DO LOOP FOR DATE VALUES. ; >>DO MY_DATE=MDY(1,1,YEAR(TODAY())) TO MDY(1,1,YEAR(TODAY())+1); >> %TEST_HOLIDAY(DATE_VAR=MY_DATE); >> PUT _ALL_; >>END; >>RUN; >> >> >>Sincerely, >> >>Scott Barry >>SBBWorks, Inc. >> >>gurtej wrote: >>> Dear All, >> >>> I am stuck at one problem >>> I am working on a data where i get a start date and from start date i >>> have to calulate finish date >>> the conditions are as follows >>> start date+1=finish date >>> cond >>> if start date+1 = holiday then >>> start date+2=finish date >>> but if start date+2= holiday then >>> start date+3=finish date >>> the no wil go on increasing till we get a date when there is no >>> holiday. >> >> >>> so the final ideal equation is >>> start date+no of holidays+1=finish date >> >> >>> e.g >>> start date = 14th aug >>> holiday=15ht aug >>> so finish date will be >>> start date + no of holiday (ie 1) ie 16th aug >>> but if 16th aug is also holiday then finish date will be calculated as >>> start date+no of holiday(i.e 2 for 15th and 16th aug) and will come as >>> 17th aug. >> >> >>> if you can please help me out in this matter.. > >isn't there a holiday file available from microsoft somewhere ?

Back to: Top of message | Previous page | Main SAS-L page