BookmarkSubscribeRSS Feed
Filipvdr
Pyrite | Level 9

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. 

7 REPLIES 7
Patrick
Opal | Level 21

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.

Filipvdr
Pyrite | Level 9

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? 

Patrick
Opal | Level 21

@Filipvdr

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.

Criptic
Lapis Lazuli | Level 10

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

Criptic
Lapis Lazuli | Level 10

@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!

Kurt_Bremser
Super User

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.

Filipvdr
Pyrite | Level 9

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.

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

Creating Custom Steps in SAS Studio

Check out this tutorial series to learn how to build your own steps in SAS Studio.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 7 replies
  • 1438 views
  • 0 likes
  • 4 in conversation