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 (July 2007, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Thu, 26 Jul 2007 10:03:26 -0700
Reply-To:     kat j <axnjxntx@YAHOO.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         kat j <axnjxntx@YAHOO.COM>
Subject:      Re: Create macro variable to refer to program name - for multiple
              programs
Comments: To: toby dunn <tobydunn@hotmail.com>
Content-Type: text/plain; charset=us-ascii

The include name has the full file name -- no macro variables / references in it.

----- Original Message ---- From: toby dunn <tobydunn@hotmail.com> To: axnjxntx@YAHOO.COM; SAS-L@LISTSERV.UGA.EDU Sent: Thursday, July 26, 2007 11:11:13 AM Subject: RE: Create macro variable to refer to program name - for multiple programs

Kat ,

Hmmm well basically it shold be the same as you have only incliuded the code form the %included file in your second program. Thus, you are only running one program.

What does your %Include look like, is it the full path with the file name or a fielname and you refernece the filename alias and file you want included?

Toby Dunn

If anything simply cannot go wrong, it will anyway. Murphys Law #2.

The buddy system is essential to your survival; it gives the enemy somebody else to shoot at. Murphys Law #

Tell a man there are 300 billion stars in the universe and he'll believe you. Tell him a bench has wet paint on it and he'll have to touch to be sure. Murphys Law #9

From: kat j <axnjxntx@YAHOO.COM> Reply-To: kat j <axnjxntx@YAHOO.COM> To: SAS-L@LISTSERV.UGA.EDU Subject: Create macro variable to refer to program name - for multiple programs Date: Thu, 26 Jul 2007 07:58:35 -0700

Morning all...

I am trying to create a macro variable that will contain the path & name of the program. I tend to use this macro in my output, so I know what program to refer to, if need be.

I basically know how to do this -- %let fname=%sysget(sas_execfilepath) -- however, I have a question about creating more than one macro variable to refer to different programs.

I have one program (program #1) that I use to create (& manipulate) the data, and a second program (program #2) that does the runs (cross tabs, models, etc). I've got it set up right now so that program #2 calls program #1 with an %include statement.

What I want is macro variables that refer to each program, separately. In program #1, I have this statement: %let fname=%sysget(SAS_EXECFILEPATH);

In program #2, I have this statement: %let fname2=%sysget(SAS_EXECFILEPATH);

HOWEVER, when I look at the information stored in both of these variables, they both have the path & program name for program #2.

I even tried this in program #1: %let fname=&path\%sysget(SAS_EXECFILENAME);

But once I run program #2, the value of &fname refers to the name of program #2.

How can I create 2 separate variables that refer to each program, while calling/running program #1 from an %include statement in program #2?

Thanks. -Kat

____________________________________________________________________________________ Boardwalk for $500? In 2007? Ha! Play Monopoly Here and Now (it's updated for today's economy) at Yahoo! Games. http://get.games.yahoo.com/proddesc?gamekey=monopolyherenow

_________________________________________________________________ Local listings, incredible imagery, and driving directions - all in one place! http://maps.live.com/?wip=69&FORM=MGAC01

____________________________________________________________________________________ Be a better Globetrotter. Get better travel answers from someone who knows. Yahoo! Answers - Check it out. http://answers.yahoo.com/dir/?link=list&sid=396545469


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