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-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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