Date: Fri, 24 Dec 1999 08:30:49 -0800
Reply-To: "Berryhill, Tim" <TWB2@PGE.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Berryhill, Tim" <TWB2@PGE.COM>
Subject: Mea Culpa: RESOLVE Will Return Values in a Macro
Content-Type: text/plain
As Keith points out, with correct quoting one can embed macro invocations in
a datastep and have the macro resolve separately for each observation. This
is scary--I do not know v6 yet, and we will go to v8 in less than a century.
Tim Berryhill - Contract Programmer and General Wizard
TWB2@PGE.COM or http://www.aartwolf.com/twb.html
Frequently at Pacific Gas & Electric Co., San Francisco
The correlation coefficient between their views and
my postings is slightly less than 0
> ----------
> From: Keith Branton[SMTP:kdb@GLOBALNET.CO.UK]
> Reply To: Keith Branton
> Sent: Friday, December 24, 1999 6:29 AM
> To: SAS-L@LISTSERV.UGA.EDU
> Subject: Re: Return Values in a Macro
>
> Although it's now obvious from the rest of the postings that Jim was
> looking
> for Roland's answer, Tim's has caused me a little concern. What on earth
> has
> happened to the RESOLVE function? In v6.07 and up it allows you to run a
> macro during data step execution, much the way Tim suggests is only
> possible
> in C/Perl.
>
> Has the RESOLVE function been removed in V7? Is it back in in V8?
>
> Keith.
>
> Berryhill, Tim <TWB2@PGE.COM> wrote in message
> news:15C9395592CFD011AD1900805FEAD7FD04E162AE@exchange02.comp.pge.com...
> > The odds are very good that you want a c or perl style user-written
> > subroutine. Unfortunately, you will have to write in c or perl to get
> one.
> > The SAS macro language is interpreted BEFORE the data step executes. It
> is
> > interpreted just once, BEFORE any observations are processed. That
> means
> > the macro can return 0 or 1, but only once per program--not different
> values
> > based on different observations.
> >
> > I must mention, your question as posted is EXACTLY the way the macro
> > language works. The macro invocation is replaced with the generated
> result,
> > which can be tested in a %if.
> >
> > Tim Berryhill - Contract Programmer and General Wizard
> > TWB2@PGE.COM or http://www.aartwolf.com/twb.html
> > Frequently at Pacific Gas & Electric Co., San Francisco
> > The correlation coefficient between their views and
> > my postings is slightly less than 0
> >
> > > ----------
> > > From: jmwildenthal@MY-DEJA.COM[SMTP:jmwildenthal@MY-DEJA.COM]
> > > Reply To: jmwildenthal@MY-DEJA.COM
> > > Sent: Tuesday, December 21, 1999 12:16 PM
> > > To: SAS-L@LISTSERV.UGA.EDU
> > > Subject: Return Values in a Macro
> > >
> > > I'd like to execute a macro and have it return a value through the
> > > invocation name. Something like
> > >
> > > %IF %mymacro(parms) EQ 0 %THEN ... ;
> > >
> > > I haven't found this in _The Little SAS Book_ or in the Online Docs.
> > > Any suggestions/comments?
> > >
> > > Currently running V7 under NT4 SP4, will be running v8 soon...
> > >
> > >
> > > Sent via Deja.com http://www.deja.com/
> > > Before you buy.
> > >
>
|