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 (April 2011, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Fri, 1 Apr 2011 21:26:05 +0000
Reply-To:     toby dunn <tobydunn@HOTMAIL.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         toby dunn <tobydunn@HOTMAIL.COM>
Subject:      Re: Conditional processing Issue XXXX
Comments: To: dan.abner99@gmail.com
In-Reply-To:  <AANLkTi=ifQTS8jyk+iNaqtAafvbn3RrpxPoTXPJbNjuR@mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"

1.) If you are using 9.2 look up the Holiday function... 2.) If you aren't using 9.2 or want a custom holiday list... use proc format to create your own Holiday list. 3.) Or you can just do this: Holiday = VDate In ( '01JAN2009'd ......... '25DEC2009'd ) ;

Toby Dunn

"I'm a hell bent 100% Texan til I die"

"Don't touch my Willie, I don't know you that well"

> Date: Fri, 1 Apr 2011 17:12:01 -0400 > From: dan.abner99@GMAIL.COM > Subject: Conditional processing Issue XXXX > To: SAS-L@LISTSERV.UGA.EDU > > Hello all, > > I have a DATA step conditional processing question that I feel like I should > know the answer to, but I guess I don't: > > I have 1 data set of SAS dates (see below) and I want to compare date values > in a data set with 200,000 records using a single IF/THEN statement. > Essentially: > > DATA OTHER2; > SET OTHER; > IF VDATE IN(any of the dates in the FED data set) THEN HOLIDAY = 1; > ELSE HOLIDAY = 0; > RUN; > > What is the most efficient way to do this? I can easily conceptualize a > macro to do it, but it seems like a lot of work for something that should be > relatively easy (or easier...). > > > > * > > DATA* FED; > > INFORMAT HDATE DATE9.; > > INPUT HDATE; > > FORMAT HDATE MMDDYY10.; > > DATALINES; > > 01JAN2009 > > 19JAN2009 > > 16FEB2009 > > 25MAY2009 > > 03JUL2009 > > 04JUL2009 > > 07SEP2009 > > 12OCT2009 > > 11NOV2009 > > 26NOV2009 > > 25DEC2009 > > ;


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