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 (May 2006, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Wed, 24 May 2006 16:14:55 -0400
Reply-To:     "Rickards, Clinton (GE Consumer Finance)"
              <clinton.rickards@GE.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         "Rickards, Clinton (GE Consumer Finance)"
              <clinton.rickards@GE.COM>
Subject:      Re: enterprise guide peculiarities - %str()
Comments: To: toby dunn <tobydunn@hotmail.com>
In-Reply-To:  <BAY101-F21464D229780F3923D5410DE980@phx.gbl>
Content-Type: text/plain; charset="iso-8859-1"

Toby,

You're right, you wouldn't win any prizes with that explanation but it gets the point across. Thanks...

-----Original Message----- From: toby dunn [mailto:tobydunn@hotmail.com] Sent: Wednesday, May 24, 2006 2:27 PM To: Rickards, Clinton (GE Consumer Finance); SAS-L@LISTSERV.UGA.EDU Subject: Re: enterprise guide peculiarities - %str()

Clinton ,

It gets complicated, well for me to explain in a few short sentences it does. Think about it like this %str and %nrstr quote the value at compile time. Which means that the value that is stored in the symbol tables is masked. When quoting macro vars values the characters that are quoted get transformed to a non printable characeter. All %put _User_ does is a dump from this table to the log. Hence you see the slashes as blanks (they are still nonprintable characters). The symbol tables just hold text values and rermember %put _User_ only asks for a dump of this to the log, not a dump and a full resolution of the characters in it. The macro quoting and unquoting and replacing of nonprintable characters for prinitng purposes gets done outside of the symbol tables.

%put &Test3

The value from the resolution of test3 is still quoted, so for compile and exectution time they are masked from the macro facility, but for printing purposes SAS will replace the nonprintable chars with the correct ones.

This is probably a really bad explaination I will have to work on it some more.

Toby Dunn

From: "Rickards, Clinton (GE Consumer Finance)" <clinton.rickards@GE.COM> Reply-To: "Rickards, Clinton (GE Consumer Finance)" <clinton.rickards@GE.COM> To: SAS-L@LISTSERV.UGA.EDU Subject: Re: enterprise guide peculiarities - %str() Date: Wed, 24 May 2006 13:48:51 -0400

All,

Interesting... %PUT of the individual variable works but _all_ and _user_ does not in my environment (EG 3.0 talking to 9.1.3 on Solaris). Any rational reason why not?

11 %let slashes = %str(//test/test2) ; 12 %let test3 = &slashes./test4 ; 13 %put %unquote(&slashes); //test/test2 14 %put %unquote(&test3); //test/test2/test4 15 16 %put #############; ############# 17 %put _ALL_; GLOBAL _EGUSERID 222016322 GLOBAL _EGHOSTNAME srapdm01.usc.consfin.ge.com GLOBAL _CLIENTUSERID 222016322 GLOBAL _EGUSERNAME 222016322 GLOBAL _EGSERVERNAME FraudMain GLOBAL _EGMACHINE MYUSLWSHL203604 GLOBAL _SASHOSTNAME srapdm01.usc.consfin.ge.com GLOBAL SLASHES test test2 GLOBAL _CLIENTAPP SAS Enterprise Guide GLOBAL TEST3 test test2 /test4 GLOBAL _CLIENTUSERNAME 222016322 <snip> 18 19 %put #############; ############# 20 %put _user_; GLOBAL _EGUSERID 222016322 GLOBAL _EGHOSTNAME srapdm01.usc.consfin.ge.com GLOBAL _CLIENTUSERID 222016322 GLOBAL _EGUSERNAME 222016322 GLOBAL _EGSERVERNAME FraudMain GLOBAL _EGMACHINE MYUSLWSHL203604 GLOBAL _SASHOSTNAME srapdm01.usc.consfin.ge.com GLOBAL SLASHES test test2 GLOBAL _CLIENTAPP SAS Enterprise Guide GLOBAL TEST3 test test2 /test4 GLOBAL _CLIENTUSERNAME 222016322

-----Original Message----- From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU]On Behalf Of toby dunn Sent: Wednesday, May 24, 2006 1:34 PM To: SAS-L@LISTSERV.UGA.EDU Subject: Re: enterprise guide peculiarities - %str()

Jiann ,

When you reference a the macros in a %put statement they dont need to be unquoted:

77 %let slashes = %str(//test/test2) ; 278 %let test3 = &slashes./test4 ; 279 280 %put &test3 ; //test/test2/test4 281 %put &Slashes ; //test/test2

Toby Dunn

From: Jiann-Shiun Huang <Jiann-Shiun.Huang@AMERUS.COM> Reply-To: Jiann-Shiun Huang <Jiann-Shiun.Huang@AMERUS.COM> To: SAS-L@LISTSERV.UGA.EDU Subject: Re: enterprise guide peculiarities - %str() Date: Wed, 24 May 2006 12:02:56 -0500

Hans:

Use %unquote to restore the significance of symbols as the following shows.

60 %let slashes = %str(//test/test2) ; 61 %let test3 = &slashes./test4 ; 62 %put %unquote(&slashes); //test/test2 63 %put %unquote(&test3); //test/test2/test4

J S Huang 1-515-557-3987 fax 1-515-557-2422

>>> Hans Schneider <hschneider@CMEDRESEARCH.COM> 05/24/06 11:44 AM >>> Dear Listeners,

I stumbled over an irritating macro var resolution, using EG:

%let slashes = %str(//test/test2) ; %let test3 = &slashes./test4 ;

%put _all_ ; GLOBAL SLASHES test test2 GLOBAL TEST3 test test2 /test4

Slashes are not correctly reproduced (and brackets as well ?), when the string is enclosed in %str()...

...strange...

Any ideas ?

Cheers,

Hans


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