BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
kuro_kuro
Calcite | Level 5

I have a problem with the predefined macros. I create a stored process that contain predefined macros (_USERNAME). I want to get username from the user. Here is my code :

    %global _USERNAME usernames;

     libname test "*(libref location)";

     %stpbegin;

     DATA test.UsernameData;

          username="&_USERNAME";

     RUN;

     DATA _NULL_;

          SET test.UsernameData;

           call symput("usernames",username);

     RUN;

     %stpend;

When I access it by using SASStoredProcess/do , the stored process is working. Then I try to make a report by using web report studio. First, I create information map and import the stored process to it. Then I create new data item, that will stored the usernames from test.UsernameData. 

I create new web report studio and using the information that I just created. I try to show whether web report studio show the its username or not like in SASStoredProcess/do. The result is empty string.

Is it the macros is not working in web report studio?

Hopefully, anyone could help me to solve the problem. Thank You.

1 ACCEPTED SOLUTION

Accepted Solutions
NN
Quartz | Level 8 NN
Quartz | Level 8

Hi,

Sorry i donot have an answer specific to ur question. nor can i test in web report...... but in our framework i usually use the _metauser macro...

will that help?

Secondly i feel you are trying to view the hits on your reports .. you should have a look at this sasnote http://support.sas.com/kb/39/510.html

View solution in original post

2 REPLIES 2
NN
Quartz | Level 8 NN
Quartz | Level 8

Hi,

Sorry i donot have an answer specific to ur question. nor can i test in web report...... but in our framework i usually use the _metauser macro...

will that help?

Secondly i feel you are trying to view the hits on your reports .. you should have a look at this sasnote http://support.sas.com/kb/39/510.html

kuro_kuro
Calcite | Level 5

Hi, thanks for reply,,

I have tried and it is worked. I chane the _username macro into _metauser macro. Thank You.

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
  • 2 replies
  • 1033 views
  • 2 likes
  • 2 in conversation