BookmarkSubscribeRSS Feed
SGB
Obsidian | Level 7 SGB
Obsidian | Level 7

Hi SAS-perts!

I have successfully created an UI using SAS Stored Processes in EG environment - Involving creating session, passing macro variables within a session, creating custom HTML forms, updating the form with user inputs, drill down reports-etc.

Thanks for the inputs from the SAS community as and when required. (Thanks to FriedEgg,  Filipvdr, milts, ballardw, NN, Juan Luis Sánchez Hernández.. Sorry If I missed anybody who helped me..Ofcourse SAS TechSupport)

My current problem is -

I have special characters in macro variable values. Initially I have suppressed '&' and apostrophe.

It is passing the 'comma' character properly. When I pass AAAA, INC - it is passing correctly.

But I realized that it is not passing the '+'.  When I pass 'days +3' and it ends up showing 'days 3'.

I m not sure what other special characters it will not pass!

Eventually I dont want to suppress any of the special characters and want to display them as such.

Examples.    The variable has the following values.. which is being passes as _name.

                         Wal&Mart

                        Wal-Mart

                        Wal'mart

                        Wal,Mart

Any help is appreciated!

3 REPLIES 3
lacrefa
Calcite | Level 5

Dear

did your read documentation about the function and call routine HTMLENCODE:

Encodes characters using HTML character entity references, and returns the encoded string.

Regards

SGB
Obsidian | Level 7 SGB
Obsidian | Level 7


Hi lacrefa

Thanks for your reply.

After posting this, I learnt that using URLENCODE is the one that I would need.

Thanks again!

DonH
Lapis Lazuli | Level 10

If you are creating stored process server sessions, the other option is to take advantage of the SAVE_ convention for saving macro variables from one request to the next one. This only works if you are using sessions. Basically what the server does is at the end of the request, it saves all the macro variables whose name begin with SAVE_ (not case-sensitive) and then when a new request reconnects to the session, it loads the macro variables back so they are available. This is a nice way to save state without having to embed values in the URL as name/value pairs.

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 1466 views
  • 3 likes
  • 3 in conversation