Can a stored process in enterprise guide use the work of the user executing it?
I want the user to be able to specify a worktable to retrieve column and label information from.
I believe a stored process executes in its own environment/session so I'd say it's not possible.
You would have to pass the values in the work table as parameters to the stored process when calling it.
Hmm ok, it confirms what I was thinking.
Passing all the column names and labels as paramters which has to be entered by the user is not an option.
When we create our own custom task, It would probably solve it? But we don't have any experience with that. Any other suggestions?
Just to build on @Kurt_Bremser's suggestion "If you want to feed data to a STP, do so via user prompts or a dataset defined in SAS metadata in a permanent library"
You could create individual permanent data sets (generated names which are always unique) and then pass the libref.dsname as parameter to the stored process (ds must be accessible from stored process server).
If using metadata: You can use a macro variable in the metadata table name definition which you pass to the stored process as parameter and then use this parameter in your stored process code.
You could define a common area, like a temp lib or if your users have permanent user-libs they could save their tables there and feed these as input for the stp
@Patrick is correct, the stp has its own session => work and doesn't know about the users work.
You can of course try to identify the work of the user, it can be done but is complex (You get the userid in the stp, find all processes running, identify the process of your user and then find the corresponding work of the user (on AIX the pid is hexed and then put as part of the work-directories name) - but be aware that users open multiple EG session which complicates this matter further) So: possible? yes! Advicable? no!
No.
A stored process runs on the stored process server, which is started with a generic user-ID (usually sassrv), and has its own WORK.
The user sassrv does not have the necessary permissions to even access your WORK directory on the operating system level, much less is there any mechanism to find it from the STP.
If you want to feed data to a STP, do so via user prompts or a dataset defined in SAS metadata in a permanent library.
thanks for the quick replies!
I don't see any other options then to create my own task, to make it not too complicated for business users
Using a library which is shared for every user is securitywise not a good option here. We also don't want our business users to have to write a proc contents to generate the table.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.
Find more tutorials on the SAS Users YouTube channel.