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 (January 2006, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Tue, 24 Jan 2006 12:32:09 -0600
Reply-To:   Jiann-Shiun Huang <Jiann-Shiun.Huang@AMERUS.COM>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   Jiann-Shiun Huang <Jiann-Shiun.Huang@AMERUS.COM>
Subject:   Re: Using function to assign value to macro variable
Comments:   To: excel_hari@YAHOO.COM
Content-Type:   text/plain; charset=US-ASCII

Hari:

I think you should put % before the macro translate, or the statement should be:

%let FinalFileEndingName = %translate(&word,"_",".");

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

>>> Hari <excel_hari@YAHOO.COM> 1/24/2006 12:13:12 PM >>> Hi,

I want to use Translate function to convert some of the "illegal characters" to good one.

I have a macro variable &word which might have a value "US.2M" (name of a market). I want to assign this value to a particular data file (which has data only for US.2M market).

Since periods in a name cause problem, so I would like to create a new macro variable called FileEndingName in which I have taken care of problematic characters and then use this new macro variable as part of my new data set name.

I tried something like

%let FinalFileEndingName = translate(&word,"_",".");

But when I PUT the variable FinalFileEndingName to Log using %put &FinalFileEndingName;

I get -- translate(US.2M,"-",".") --

In the above case it is not treating TRANSLATE as a function but rather as a literal text?

Please suggest ways to overcome my problem.

Regards, Hai India


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