|Date: ||Thu, 25 Jun 2009 18:35:41 -0400|
|Reply-To: ||Arthur Tabachneck <art297@NETSCAPE.NET>|
|Sender: ||"SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>|
|From: ||Arthur Tabachneck <art297@NETSCAPE.NET>|
|Subject: ||Re: Do Loop Macro|
A couple of problems:
First, I think you want to include the macro variable &i in your do loop.
I.e., %do %until (&i.=1);
Second, I think you want to either pass in the macro variable &today when
you call the macro, or you want to use the system 'today' function, as well
as use let to change the value of the macro variable &i. E.g.:
if process_date = today() then do;
%let i = 1;
On Thu, 25 Jun 2009 14:46:15 -0700, Paul Lambson <paullambson@GMAIL.COM>
>I have in the past worked with do loop macros. Now I am trying to
>recreate one by memory, it's not working very well. There are a few
>things I need help with.
>My IF statement needs to declare i = to 0 or 1 on a macro level?
>and I need to put a sleep statement in there before it loops again.
>As always, thanks for any help.
>%do %until (i=1);
>connect to odbc (dsn=PostgreSQL30 user=bgadmin password=jad#jax*Ku);
>create table testdatabase as
>select * from connection to odbc
>(select max(process_date_id) as process_date
>if process_date = &today then i = 1; else i = 0;