Stored Process with macro variables in parameters: problem with quotes

Accepted Solution Solved
Reply
Contributor
Posts: 22
Accepted Solution

Stored Process with macro variables in parameters: problem with quotes

Hello, guys.

I'm a noob in SAS. I searched in the Internet and forum and didn't find answer on my question.

I have some troubles with code and stored process.

I try to redirect process with parameters and have something like that:

%let prm = 5;

%let aaz = 50;

DATA _null_;

file _webout;

     put '<html>';
     put ' <div>';

     put 'a href="../SASStoredProcess/do?_program=%2FFolder%2Ff_sp&prm='&prm'&aaz='&aaz' ">Back</a>';

     put ' </div>';

     put '</html>';

run;

And it doesn't work of course because of quotes near '&prm' and '&aaz'.

ERROR 200-322: The symbol is not recognized and will be ignored. (c)

How calling SP with macro variables in parameters?


Accepted Solutions
Solution
‎07-18-2014 10:06 AM
Super User
Super User
Posts: 6,499

Re: Stored Process with macro variables in parameters: problem with commas

Not sure what commas have to do with it.  Your program is quoting incorrectly.  It is also missing the < as the beginning of the A tag.

%let prm = 5;

%let aaz = 50;

DATA _null_;

*file _webout;

     put '<html>';

     put ' <div>';

     put '<a href="../SASStoredProcess/do?_program=%2FFolder%2Ff_sp'

         '&prm=' "&prm"

         '&aaz=' "&aaz"

         '">Back</a>'

  ;

     put ' </div>';

     put '</html>';

run;


<html>

<div>

<a href="../SASStoredProcess/do?_program=%2FFolder%2Ff_sp&prm=5&aaz=50">Back</a>

</div>

</html>

View solution in original post


All Replies
Solution
‎07-18-2014 10:06 AM
Super User
Super User
Posts: 6,499

Re: Stored Process with macro variables in parameters: problem with commas

Not sure what commas have to do with it.  Your program is quoting incorrectly.  It is also missing the < as the beginning of the A tag.

%let prm = 5;

%let aaz = 50;

DATA _null_;

*file _webout;

     put '<html>';

     put ' <div>';

     put '<a href="../SASStoredProcess/do?_program=%2FFolder%2Ff_sp'

         '&prm=' "&prm"

         '&aaz=' "&aaz"

         '">Back</a>'

  ;

     put ' </div>';

     put '</html>';

run;


<html>

<div>

<a href="../SASStoredProcess/do?_program=%2FFolder%2Ff_sp&prm=5&aaz=50">Back</a>

</div>

</html>

Contributor
Posts: 22

Re: Stored Process with macro variables in parameters: problem with commas

Of course I meant 'quotes' not 'commas', sorry. It was the end of my working day.

Thank you for your correction, I'll try this code in Monday and will tell about it.

Contributor
Posts: 22

Re: Stored Process with macro variables in parameters: problem with commas

Thank you so much, all work. You saved my life.

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 3 replies
  • 186 views
  • 0 likes
  • 2 in conversation