LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous (more recent) messageNext (less recent) messagePrevious (more recent) in topicNext (less recent) in topicPrevious (more recent) by same authorNext (less recent) by same authorPrevious page (April 2006, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Tue, 18 Apr 2006 22:40:38 -0400
Reply-To:   Scott Bass <sas_l_739@YAHOO.COM.AU>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   Scott Bass <sas_l_739@YAHOO.COM.AU>
Subject:   Re: Command line macro to submit SAS code
Content-Type:   text/plain; charset=ISO-8859-1

Hi Toby,

Thanks...I now realize my test case was insufficient. The "real" "%foo" macro is not all macro code. Sorry for that.

Here is a more realistic test case:

%macro foo / cmd; %let sysparm=TEST; submit '%bar'; %mend;

%macro bar; data one;x=1;run; %mend;

With this test case, I need the "submit" command.

I'm finding command style macros to be "finicky". I think the end users can live with the restrictions 1) type "%foo" rather than "foo" on the command line, and 2) the program editor must be the active DMS window when you issue the "%foo" command.

Regards, Scott

On Wed, 19 Apr 2006 02:22:13 +0000, toby dunn <tobydunn@HOTMAIL.COM> wrote:

>Scott , > >This does work: > >1.) run this code > >%macro foo; > %put &sysparm; >%mend; > >%macro bar / cmd; > %let sysparm=blah; > %foo >%mend; > > >Then o the command line type %bar >hit enter and you should see 'blah' in the log window. > > > >Toby Dunn > > > > > >From: Scott Bass <sas_l_739@YAHOO.COM.AU> >Reply-To: Scott Bass <sas_l_739@YAHOO.COM.AU> >To: SAS-L@LISTSERV.UGA.EDU >Subject: Re: Command line macro to submit SAS code >Date: Tue, 18 Apr 2006 21:38:12 -0400 > >Hi Stephane, > >%bar is a command style macro. It doesn't work if you type "bar" in the >command window, which is my desired functionality. Essentially I'm trying >to develop a custom DMS command to switch between development environments >(ppn, dev, test, prod) within a single interactive SAS session. > >Regards, >Scott > >On Tue, 18 Apr 2006 13:42:07 +0200, =?iso-8859-1?b?U3TpcGhhbmU=?= Colas ><saslist@DATAMETRIC.FR> wrote: > > >Like this ? > > > >%macro foo; > > %put &sysparm; > >%mend; > > > >%macro bar / cmd; > > %let sysparm=blah; > > %foo; > >%mend; > > > >%bar; > > > > > >32 %macro foo; > >33 %put &sysparm; > >34 %mend; > >35 > >36 %macro bar / cmd; > >37 %let sysparm=blah; > >38 %foo; > >39 %mend; > >40 %bar; > >blah > > > > > >-- > >Stéphane. > > > >www.datametric.fr > > > > > > > >Selon Scott Bass <sas_l_739@YAHOO.COM.AU>: > > > >> Hi, > >> > >> Say I have a macro: > >> > >> %macro foo; > >> %put &sysparm; > >> %mend; > >> > >> I want to create a command line macro that will (re)submit this macro. >I > >> tried these: > >> > >> %macro bar / cmd; > >> %let sysparm=blah; > >> submit '%foo'; > >> %mend; > >> > >> %macro bar / cmd; > >> %let sysparm=blah; > >> submit pgm '%foo'; > >> %mend; > >> > >> %macro bar / cmd; > >> %let sysparm=blah; > >> submit '%foo' pgm; > >> %mend; > >> > >> None of them gave me exactly what I wanted. Sometimes it would work as > >> long as my active DMS window was the Program Editor, but would fail (not >do > >> anything) if the active window was Log or Output. And sometimes it >would > >> submit the current contents of the Program Editor, when all I want it to >do > >> is submit the %foo macro for execution. > >> > >> I did search the doc for some info on this but couldn't nail down the >place > >> to look. Thanks for any help you can provide. > >> > >> Regards, > >> Scott > >>


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