f



SAS Intrnet question, passing macro variables to SAS.

I got a problem when I tried to pass a variable from URL to SAS.
Part of the URL are listed below. When I was trying to pass the macro
variable "citystate" to SAS, it doesn't work. The annoying part is the
"%str". Does anybody has the experience how to pass a variable with
"%str(something)" from URL to SAS? How shall I modify the URL below to
make it work?

Any answers/suggestions are highly appreciated!

Thanks,

Jia Lan

http://www.mysite.com/cgi-bin/broker?_SERVICE=default&_PROGRAM=mysas.sas
&libdata=test&citystate=%str('Birmingham, AL','Dothan, AL','Huntsville,
AL')

0
jia.lan (9)
1/27/2005 6:37:06 PM
comp.soft-sys.sas 142828 articles. 3 followers. Post Follow

1 Replies
749 Views

Similar Articles

[PageSpeed] 18

Hello Jia and other SAS-L Friends,

I'm not sure I know the answer but I have some ideas. However, first, I
have a question.  Are you building the URL outside of an HTML form?  If you
are, the following link on the SAS web site might interest you:

http://support.sas.com/faq/039/FAQ03925.html

You might also want to look at the following link:

http://support.sas.com/rnd/web/intrnet/dispatch82/input.html

Look at the section titled "Specifying Name/Value Pairs in a URL".

Most likely, the ampersands might be playing a role.  SAS/IntrNet strips
off "unsafe characters" unless you tell it not to do so.  Please see:

http://support.sas.com/rnd/web/intrnet/dispatch82/srvusaf.html

Part of that link states:

The APPSRV_UNSAFE function returns the complete, original value of an input
name/value pair. Normally unsafe characters (see the UNSAFE option) are
stripped from input values before creating the input macro variables. This
is done so that macro variables may be freely used in a application program
without any unwanted SAS macro language processing. In some cases, such as
processing free-format input text, you may want to retrieve the complete,
original value using the APPSRV_UNSAFE function.

HTH.

Michael "Mad Doggy" Davis

At 10:37 AM 1/27/2005 -0800, jia.lan@GMAIL.COM wrote:
>I got a problem when I tried to pass a variable from URL to SAS.
>Part of the URL are listed below. When I was trying to pass the macro
>variable "citystate" to SAS, it doesn't work. The annoying part is the
>"%str". Does anybody has the experience how to pass a variable with
>"%str(something)" from URL to SAS? How shall I modify the URL below to
>make it work?
>
>Any answers/suggestions are highly appreciated!
>
>Thanks,
>
>Jia Lan
>
>http://www.mysite.com/cgi-bin/broker?_SERVICE=default&_PROGRAM=mysas.sas
>&libdata=test&citystate=%str('Birmingham, AL','Dothan, AL','Huntsville,
>AL')

Michael L. Davis
Ambler  PA
E-Mail:  michael@bassettconsulting.com
Web:  http://www.bassettconsulting.com
0
michael193 (218)
1/27/2005 11:42:46 PM
Reply: