BookmarkSubscribeRSS Feed
ScottBass
Rhodochrosite | Level 12

SAS 9.3 on Windows

 

Hi,

 

I have a test stored process with these options:

 

SAS Code:  

proc print data=sashelp.class;run;

run;

 

%put _all_;

 

Execution Options:

Default server (Workspace server only also works)

Allow execution on other application servers (so source code in metadata)

Result capabilities: Package (only)

 

This stored process has other prompts, and is only called from EG.

 

Is there a way to pass the &_CLIENTPROJECTNAME (i.e. the name of the *saved* EG project) to this stored process?  I tried a hidden prompt, didn't work.

 

Thanks...

 


Please post your question as a self-contained data step in the form of "have" (source) and "want" (desired results).
I won't contribute to your post if I can't cut-and-paste your syntactically correct code into SAS.
3 REPLIES 3
mbuchecker
Quartz | Level 8

Hi ScottBass, 

Can you provide more info? Like, where are you using that macro variable in your stored process and for what purpose? If the value is null (user hasn't saved the EG project) you may be seeing things correctly.

Michelle
ScottBass
Rhodochrosite | Level 12

Hi Michelle,

 

I'm building a crude UI for my EG project using stored processes.

 

1) The prompt manager built into EG does not meet my needs; it does not have all the prompting capabilities available in stored processes.

 

2) My stored process must run under either the Default server or Workspace server only; if it runs under the stored process server there are access problems with certain directories due to NTFS permissions (that will not change).  With either selection, the stored process runs under the credentials of the logged in user, but in a different workspace server session than the EG project.  IOW, if the stored process creates the macro variable foo, &foo is not available in later processing in the EG project (at least not without some work - see below).

 

3) Based on the selections the user makes from the UI, different logic branches are selected in the EG project.

 

4) The workspace servers spawned by the stored process are transient, existing only for the duration of the stored process.  In this respect, they are "stateless", somewhat analogous to browser/server interactions.

 

5) To get my processing to work, I'm creating a parameters dataset, saving the values that the user has selected from the stored process prompts.  I think of the parameters dataset as somewhat analogous to cookies in the browser.

 

6) I've got this working OK for a single project.  However, my initial design was flawed, in that the user might work on multiple projects at one time.  I don't want the parameters selected from one project to override the selections from another project.  So, I need a key for the parameters dataset.  Client project name would be a good key.  Somewhat analogous to different cookies for different websites, even if coincidentally those cookies contain similar information.

 

So, I need to pass the CLIENTPROJECTNAME to the stored process, so that the stored process can store this in the parameters dataset.  It's unfortunate that a stored process called from EG doesn't automatically know the project name that called it (although _CLIENTNAME=SAS Enterprise Guide).  I did a %put _all_ from my stored process code but didn't see anything that would help in this scenario.

 

If the prompting built in to EG supports:  selection-dependent groups, shared storage of a group of prompts as a unit, the ability to store the source code in a central location (preferably metadata server but will accept an external file), changing the shared prompts changes the prompts in all projects that reference those prompts (IOW central storage of prompts and supporting code), etc, etc, then I'll happily change to EG prompting.  

 

But from what I can see, EG prompting is the poor cousin to the prompting available in stored processes.  So I'm having to jump through hoops to get EG to display acceptable prompting for my needs.

 


Please post your question as a self-contained data step in the form of "have" (source) and "want" (desired results).
I won't contribute to your post if I can't cut-and-paste your syntactically correct code into SAS.
mbuchecker
Quartz | Level 8

Thanks for elaborating. That is tough. I was thinking SYSJOBID would help but that seems to be the process id from the workspace server and is getting reset with every submission. I still don't think &_CLIENTPROJECTNAME is going to work if the user opens multiple EG sessions without saving the project, you'll have a value of null in every case. I cannot think of a way to uniquely identify an EG session.

Michelle

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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
  • 775 views
  • 0 likes
  • 2 in conversation