Desktop productivity for business analysts and programmers

Save values from prompts in a SAS EG project

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 9
Accepted Solution

Save values from prompts in a SAS EG project

Hi all,

I have a SAS EG project where some of parameteres are defined through the prompt mask. So, if starting this project the user have to select values for these parameters, using the prompt mask. What I want is to save the selected prompt values in some file (text, html, SAS - this does'n matter) at the end of the process, so that the user would be able to see afterwards, which values he(she) selected for this particular run. Is there some easy possibility to do this?

Thanks in advance,

Denis


Accepted Solutions
Solution
‎02-26-2014 03:07 PM
Community Manager
Posts: 2,697

Re: Save values from prompts in a SAS EG project

When you define the prompt, be sure to check the box "Use prompt value throughout project".  See the screenshot:

saveprompt.png

Otherwise the prompt mechanism will clear the macro variables (like a good macro citizen...)

Chris

View solution in original post


All Replies
Grand Advisor
Posts: 17,396

Re: Save values from prompts in a SAS EG project

The prompts are stored as macro variables, so you can create a data set that contains the values and then save them out however you wish.

ie prompts = date_start date_end time_period

Data Save_Prompts;

Prompt="Date Start";

Value="&date_Start";

output;

Prompt="Date End";

Value = "&date_end";

output;

Prompt = "Time Period";

Value="Monthly";

output;

run;

Occasional Contributor
Posts: 9

Re: Save values from prompts in a SAS EG project

Thank you, but this approach doesn't work, I attempted it already. I obtain the note "Apparent symbolic reference ... not resolved". It seems that the macro variables from prompts are not global, so they are not available at the end of the process. And since I use wizard-generated queries and not programs in my process I don't know how I can declare these macro variables as global. :smileycry:

Trusted Advisor
Posts: 1,214

Re: Save values from prompts in a SAS EG project

Suggest you add:

%put _user_ ;

and take a look at the log.  It should list all of the user-defined macro vaiables, and the prompts should be there.  I'm pretty sure they are global macro variables.  But I suppose it's possible that EG is deleting them for you at some point.  So you might try adding %put _user_; at multiple points in your project.

Grand Advisor
Posts: 17,396

Re: Save values from prompts in a SAS EG project

So put that step into the process somewhere. Best way to do it anyways.

Make sure to use double quotes to get the variables to resolve.

Solution
‎02-26-2014 03:07 PM
Community Manager
Posts: 2,697

Re: Save values from prompts in a SAS EG project

When you define the prompt, be sure to check the box "Use prompt value throughout project".  See the screenshot:

saveprompt.png

Otherwise the prompt mechanism will clear the macro variables (like a good macro citizen...)

Chris

Occasional Contributor
Posts: 9

Re: Save values from prompts in a SAS EG project

Thank You, this is exactly what I looked for Smiley Happy

☑ This topic is SOLVED.

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

Discussion stats
  • 6 replies
  • 1238 views
  • 8 likes
  • 4 in conversation