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 (December 2007, week 2)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Sun, 9 Dec 2007 22:48:55 -0800
Reply-To:     Tree Frog <tree.frog2@HOTMAIL.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Tree Frog <tree.frog2@HOTMAIL.COM>
Subject:      Re: Q: SAS Macro question
Comments: To:
Content-Type: text/plain; charset=ISO-8859-1

Hi Patrick

I'm afraid it's not at all clear (at least to me) what you're trying to achieve. Can you give some more context, and a clear statement of what you have and what you are hoping to get SAS to do? If you had to write it all WITHOUT macro, what would it look like, roughly?

I'm sure everyone would like to help, once we understand what the problem is!

Tree Frog

On Dec 10, 2:22 pm, Patrick <> wrote: > Hi all > > Just posting that again in the hope to get an answer. > > Can anyone of you think of a solution for the following under SAS > 9.1.3 SP4, Unix or Windows? > > What I have: > - A bunch of programs. > - I have to add some checks after certain steps (proc's or datasteps) > within this programs. > - All steps after which I have to add code are calling the same macro > in the same way. > - This macro does nothing else than generating some data set options > - > eg: data test(%SetOptions); > > What I try to achieve: > - Not to make direct changes to the script of all the programs (DI > jobs, sometimes with user written code, sometimes within loops...) > - Change the %SetOptions macro in a way that it does the job for me. > > Where I am: > - call execute() is behaving close to what I need. But as much as I > understand it, that won't be the solution. > - doubting that there is a solution at all for what I try to achieve. > > Below is a code example to illustrate what I try to do. The example > doesn't work - and I understand also why. It's just outlining the > idea. > > Any idea for a solution or info why it can't be done at all would be > highly appreciated. > > Patrick > > Example: > %macro AddSteps; > proc print data=work.test; > run; > %mend; > > %macro SetOptions; > /* some options */ > label='My DS' > /* how to call macro so that it executes after current step > boundary? */ > call execute('%AddSteps'); /* ' */ > %mend; > > data work.test(%SetOptions) ; > a=1; > output; > run;

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