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 (May 2007, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Thu, 24 May 2007 22:44:35 -0700
Reply-To:     David L Cassell <davidlcassell@MSN.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         David L Cassell <davidlcassell@MSN.COM>
Subject:      Re: How can I make a Set Statement with an "Iterative Read" of
              FIRSTOBS
In-Reply-To:  <1180060180.259638.16280@q75g2000hsh.googlegroups.com>
Content-Type: text/plain; format=flowed

junkmail115@GMAIL.COM wrote: > >Greetings (again), I've been busting my brain over this one. There is >probably a very easy fix. How can I read in the first observation from >the "INSET" dataset on the first iteration of the %DO loop and the >second observation on the second ineration and so on? > >Many Thanks. > >%macro process (it=); >%do n=1 %to &it; >data temp ; set inset (firstobs=???) ; > >if flag_combo='Y' and flag_freq='Y' then do; > call >symput("prodcategory", category); > call symput("pricepoint", >pricepoint); > call >symput("categorypricepoint", categ_pricepoint); >end; >data logit.upholstery_regression; set test_set; > > if >category = "&prodcategory" and pricepoint = "&pricepoint" >then > >&categorypricepoint = 1; else &categorypricepoint = 0; > > >%end; >%mend process; > >data %process (it=4);run;

IIRC, you have 1.6 millions records. So you really don't want a macro loop that will slow things down even more.

I am just not sure what you're after based on your code, but it looks like you would be better off carefully explaining what you really want to do, and why.

It looks like you might be a lot better off with a hash in a data step, or perhaps a SQL solution.

HTH, David -- David L. Cassell mathematical statistician Design Pathways 3115 NW Norwood Pl. Corvallis OR 97330

_________________________________________________________________ Catch suspicious messages before you open them—with Windows Live Hotmail. http://imagine-windowslive.com/hotmail/?locale=en-us&ocid=TXT_TAGHM_migration_HM_mini_protection_0507


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