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 (January 2003, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Fri, 3 Jan 2003 10:51:45 -0500
Reply-To:   diskin.dennis@KENDLE.COM
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   diskin.dennis@KENDLE.COM
Subject:   Re: Help with creating global macro variables
Comments:   To: Shukla Kshirsagar <shuklak@HOTMAIL.COM>
Content-type:   text/plain; charset=us-ascii

Shukla,

You can't bulid a macro statement this way - the %global without an ending ; creates problems. There are several ways to approach this. Simplest is to just generate many %global statements : (I assume you want to global variables S1p1, S2p2....

%macro test; %local y; %do y=1 %to &numcards; %global Slp&y; %end; %mend test; %test;

If you don't like the idea of all these %global statements, you can build another macro variable containing all the variable names you want to global:

%macro test; %local y names; %do y=1 %to &numcards; %let names = &names S1p&y; %end; %global &names; %mend test; %test;

HTH, Dennis Diskin

From: Shukla Kshirsagar <shuklak@HOTMAIL.COM>@LISTSERV.UGA.EDU> on 01/03/2003 10:24 AM

Please respond to Shukla Kshirsagar <shuklak@HOTMAIL.COM>

Sent by: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>

To: SAS-L@LISTSERV.UGA.EDU cc:

Subject: Help with creating global macro variables

Hello everybody,

I need some help with creating some global macro variables. I am using the following code, and I get attached error

Code: %macro test; %global %do y=1 %to &numcards; &&Slp&y; %end; ;;; %mend test; %test;

Error:

Macro keyword DO appears as text. A semicolon or other delimiter may be missing. 5699 &&Slp&y; 5700 %end; ERROR: There is no matching %DO statement for the %END. This statement will be ignored.

Any suggestions? Thanks for your help on this and all other questions I haved posed to the group.

Shukla


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