Your SAS programs, embedded in web apps and elsewhere

Can a Stored Process pull prompt values from an egp

Accepted Solution Solved
Reply
New Contributor
Posts: 2
Accepted Solution

Can a Stored Process pull prompt values from an egp

[ Edited ]

We are running SAS Enterprise Guide version 7.100.0.1966.  We have a Stored Process that we're adding to an existing Enterprise Guide Project.  The Stored Process needs to access prompt values that exist in the EGP.  We've made various attempts (such as getting the value from SASHELP.VMACRO), but the values just aren't coming through.  Can anyone provide some code examples of how this can be done?

Also, the host EGP produces one output table called FINALOUTPUT.  That table is the primary data source for our Stored Process.  However, we are also getting the following error:  "WORK.FINALOUTPUT.DATA does not exist".  That table does indeed exist, but the Stored Process somehow isn't "seeing" it.

Any help would be greatly appreciated.  Thanks!


Accepted Solutions
Solution
‎01-18-2017 04:11 PM
SAS Employee
Posts: 118

Re: Can a Stored Process pull prompt values from an egp

Posted in reply to ScottSchaeffer

Hi Scott,

 

My 2 cents...

 

From SAS Enterprise Guide (EG), you won't be able to add prompts to an existing Stored Process.

(If the Stored Process is created from the EG session, you can link prompt to the SAS Program prior to the Stored Process creation)

 

The way you can add prompts to an existing Stored Process is to use the SAS Management Console.

From the Folders tab, you need to navigate to the location of the Stored Process and go to its Properties.

Then, the Parameters tab is what you're looking for.

Parameters.JPG

 

The name defined for the prompt will have to be referenced in your code as a macro-variable.

For instance if you create a text prompt on MAKE, this is what the code would look like (take off quotes if it's a numeric value)

proc print data=sashelp.cars;
where Make="&Make.";
run;

If you don't need to get a prompt when running the Stored Process and retrieve an existing value, you simply have to use the above code and reference the prompt as a macro-variable.

 

 

Regarding the error message you get, "WORK.FINALOUTPUT.DATA does not exist", is your Stored Process defined to use the Stored Process Server?

As SAS Enterprise Guide uses a Workspace Server, its WORK library is unknown to the one used by the Stored Process Server, they are 2 separate SAS sessions.

I'm thinking of 2 options for you:

  - Instead of creating the FINALOUTPUT dataset into the temporary WORK library, use a permanent one. it will need to be accessible to both Workspace and Stored Process Servers.

  - Change the definition of your Stored Process, using the SAS Management Console from the Execution tab of the Stored Process properties (and use Workspace server only, if applicable)

 

 

Hope that helps, enjoy!!!

 

Cheers,
Damo

View solution in original post


All Replies
Solution
‎01-18-2017 04:11 PM
SAS Employee
Posts: 118

Re: Can a Stored Process pull prompt values from an egp

Posted in reply to ScottSchaeffer

Hi Scott,

 

My 2 cents...

 

From SAS Enterprise Guide (EG), you won't be able to add prompts to an existing Stored Process.

(If the Stored Process is created from the EG session, you can link prompt to the SAS Program prior to the Stored Process creation)

 

The way you can add prompts to an existing Stored Process is to use the SAS Management Console.

From the Folders tab, you need to navigate to the location of the Stored Process and go to its Properties.

Then, the Parameters tab is what you're looking for.

Parameters.JPG

 

The name defined for the prompt will have to be referenced in your code as a macro-variable.

For instance if you create a text prompt on MAKE, this is what the code would look like (take off quotes if it's a numeric value)

proc print data=sashelp.cars;
where Make="&Make.";
run;

If you don't need to get a prompt when running the Stored Process and retrieve an existing value, you simply have to use the above code and reference the prompt as a macro-variable.

 

 

Regarding the error message you get, "WORK.FINALOUTPUT.DATA does not exist", is your Stored Process defined to use the Stored Process Server?

As SAS Enterprise Guide uses a Workspace Server, its WORK library is unknown to the one used by the Stored Process Server, they are 2 separate SAS sessions.

I'm thinking of 2 options for you:

  - Instead of creating the FINALOUTPUT dataset into the temporary WORK library, use a permanent one. it will need to be accessible to both Workspace and Stored Process Servers.

  - Change the definition of your Stored Process, using the SAS Management Console from the Execution tab of the Stored Process properties (and use Workspace server only, if applicable)

 

 

Hope that helps, enjoy!!!

 

Cheers,
Damo

New Contributor
Posts: 2

Re: Can a Stored Process pull prompt values from an egp

Thanks, @Damo.  This helps.

☑ This topic is solved.

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

Discussion stats
  • 2 replies
  • 163 views
  • 1 like
  • 2 in conversation