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:         Fri, 25 May 2007 09:58:39 -0700
Reply-To:     junkmail115@GMAIL.COM
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         junkmail115@GMAIL.COM
Organization: http://groups.google.com
Subject:      Re: How can I make a Set Statement with an "Iterative Read" of
Comments: To: sas-l@uga.edu
In-Reply-To:  <200705250510.l4P4CRXm001082@mailgw.cc.uga.edu>
Content-Type: text/plain; charset="us-ascii"

On May 25, 12:10 am, ya.hu...@AMYLIN.COM (Ya Huang) wrote: > This should do it: > > data temp ; set inset (firstobs=&n obs=&n) ; > > On Thu, 24 May 2007 19:29:40 -0700, junkmail...@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;

Thank you, Ya. This worked wonderfully. I knew there probably was a very quick shortcut.


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