<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Can I run a stored procedure in my current workspace session in EG? in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Can-I-run-a-stored-procedure-in-my-current-workspace-session-in/m-p/897763#M43799</link>
    <description>&lt;P&gt;Another option could be to create a custom task.&lt;/P&gt;
&lt;P&gt;It requires a small configuration of the clients though, so they can reach it/having it published to.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://documentation.sas.com/doc/en/egdoccdc/8.2/egug/n0qrmwv1ttfkz0n1loj1tjt6t5hc.htm" target="_blank"&gt;https://documentation.sas.com/doc/en/egdoccdc/8.2/egug/n0qrmwv1ttfkz0n1loj1tjt6t5hc.htm&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 09 Oct 2023 07:39:50 GMT</pubDate>
    <dc:creator>LinusH</dc:creator>
    <dc:date>2023-10-09T07:39:50Z</dc:date>
    <item>
      <title>Can I run a stored procedure in my current workspace session in EG?</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Can-I-run-a-stored-procedure-in-my-current-workspace-session-in/m-p/897555#M43790</link>
      <description>&lt;P&gt;When I use the query builder in SAS EG to write a file to CAS, the table becomes a session-scope in-memory table. When I want to promote this table to a global-scope table and save this table to disk aswell, I run the following code.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;data _null_;
	call symputx('libref',scan("&amp;amp;syslast",1,'.'));
	call symputx('tablename',scan("&amp;amp;syslast",2,'.'));
run;

%let caslibname = %sysfunc( libref_to_caslibname(&amp;amp;libref) );    /* libref_to_caslibname is a function I wrote to retrieve the caslibname from the libref  */

proc casutil incaslib="&amp;amp;caslibname" outcaslib="&amp;amp;caslibname";
	promote casdata="&amp;amp;tablename";
quit;

proc casutil incaslib="&amp;amp;caslibname" outcaslib="&amp;amp;caslibname";
	save casdata="&amp;amp;tablename";
quit;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This works great, but I want other users to easily acces this code snippet aswell. I tried making a stored procedure for this code, but the problem is that the stored procedure executes in a new workspace session. This means that&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;My &amp;amp;syslast doesn't contain the table I want to promote and save. I tried using a prompt and use &amp;amp;syslast as an input for the promt but this doesn't work (just the string '&amp;amp;syslast' is passed, instead of the value of &amp;amp;syslast).&amp;nbsp;&lt;/LI&gt;&lt;LI&gt;With a new workspace session come a new cas session, so I couldn't even promote and save the tables if I solve problem 1.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;Is it possible to run a stored procedure in the current workspace session? Or is there an alternative way to share this code snippet/program with end users?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Oct 2023 09:22:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Can-I-run-a-stored-procedure-in-my-current-workspace-session-in/m-p/897555#M43790</guid>
      <dc:creator>RobWanders1</dc:creator>
      <dc:date>2023-10-06T09:22:18Z</dc:date>
    </item>
    <item>
      <title>Re: Can I run a stored procedure in my current workspace session in EG?</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Can-I-run-a-stored-procedure-in-my-current-workspace-session-in/m-p/897568#M43791</link>
      <description>&lt;P&gt;I don't think that I can answer your specific question.&lt;/P&gt;
&lt;P&gt;But, Stored Process is a discontinued technology, and you are already working with Viya...&lt;/P&gt;
&lt;P&gt;Why don't create a macro instead?&lt;/P&gt;</description>
      <pubDate>Fri, 06 Oct 2023 10:37:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Can-I-run-a-stored-procedure-in-my-current-workspace-session-in/m-p/897568#M43791</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2023-10-06T10:37:16Z</dc:date>
    </item>
    <item>
      <title>Re: Can I run a stored procedure in my current workspace session in EG?</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Can-I-run-a-stored-procedure-in-my-current-workspace-session-in/m-p/897570#M43792</link>
      <description>&lt;P&gt;We are working with Viya for Visual Analytics only at the moment. Users are still working in EG, just the input tables for the dashboards are going to CAS. The reason I am not using a macro is because I want to keep it as simple as possible for the end-user. A stored procedure can be dragged into a flow and be attached to the output table of the query builder. Having them add a program step to the flow and manually insert the macro call might already be to much of an ask for some of them. Maybe I'm pampering them too much, if what I want is not possible I will probably make a macro instead like you say.&lt;/P&gt;&lt;P&gt;I also tried to share the program-step with other users but I couldn't find a way to do so, otherwise I would have done that instead of using a stored procedure.&lt;/P&gt;</description>
      <pubDate>Fri, 06 Oct 2023 11:10:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Can-I-run-a-stored-procedure-in-my-current-workspace-session-in/m-p/897570#M43792</guid>
      <dc:creator>RobWanders1</dc:creator>
      <dc:date>2023-10-06T11:10:55Z</dc:date>
    </item>
    <item>
      <title>Re: Can I run a stored procedure in my current workspace session in EG?</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Can-I-run-a-stored-procedure-in-my-current-workspace-session-in/m-p/897763#M43799</link>
      <description>&lt;P&gt;Another option could be to create a custom task.&lt;/P&gt;
&lt;P&gt;It requires a small configuration of the clients though, so they can reach it/having it published to.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://documentation.sas.com/doc/en/egdoccdc/8.2/egug/n0qrmwv1ttfkz0n1loj1tjt6t5hc.htm" target="_blank"&gt;https://documentation.sas.com/doc/en/egdoccdc/8.2/egug/n0qrmwv1ttfkz0n1loj1tjt6t5hc.htm&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Oct 2023 07:39:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Can-I-run-a-stored-procedure-in-my-current-workspace-session-in/m-p/897763#M43799</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2023-10-09T07:39:50Z</dc:date>
    </item>
    <item>
      <title>Re: Can I run a stored procedure in my current workspace session in EG?</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Can-I-run-a-stored-procedure-in-my-current-workspace-session-in/m-p/897769#M43800</link>
      <description>Thanks, this looks promising. I do have administrator privileges so I should be able to do the configuration, but from the documentation you linked it isn't quite clear to me how I would generate the DLL file. Both methods in the documentation require that there is already a DLL file for the task.</description>
      <pubDate>Mon, 09 Oct 2023 08:57:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Can-I-run-a-stored-procedure-in-my-current-workspace-session-in/m-p/897769#M43800</guid>
      <dc:creator>RobWanders1</dc:creator>
      <dc:date>2023-10-09T08:57:54Z</dc:date>
    </item>
    <item>
      <title>Re: Can I run a stored procedure in my current workspace session in EG?</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Can-I-run-a-stored-procedure-in-my-current-workspace-session-in/m-p/897771#M43801</link>
      <description>&lt;P&gt;May-be this blog will be helpful:&amp;nbsp;&lt;A href="https://blogs.sas.com/content/sgf/2020/02/28/jobs-stored-processes-in-viya/" target="_self"&gt;Stored processes in Viya&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Please note that this is for SAS Studio.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Using SAS EG will depend on your Viya version. At least for Viya 4 SAS EG is in the moment not supported (on the roadmap for sometime in 2024 as far as I know).&lt;/P&gt;</description>
      <pubDate>Mon, 09 Oct 2023 09:09:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Can-I-run-a-stored-procedure-in-my-current-workspace-session-in/m-p/897771#M43801</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2023-10-09T09:09:39Z</dc:date>
    </item>
    <item>
      <title>Re: Can I run a stored procedure in my current workspace session in EG?</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Can-I-run-a-stored-procedure-in-my-current-workspace-session-in/m-p/897803#M43803</link>
      <description>&lt;P&gt;Well, it seems that you need to develop some kind of .net package for this, so this might not be worth the effort.&lt;/P&gt;
&lt;P&gt;Some resources:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://support.sas.com/documentation/onlinedoc/guide/customtasks/index.htm" target="_blank"&gt;https://support.sas.com/documentation/onlinedoc/guide/customtasks/index.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://github.com/cjdinger/SasDataExample" target="_blank"&gt;https://github.com/cjdinger/SasDataExample&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;I don't have EG at my fingertips so I can't help you find a work-around for you parameter/prompt problem. But it could be worth trying contacting SAS tech support to get an indication whether this is possible or not.&lt;/P&gt;</description>
      <pubDate>Mon, 09 Oct 2023 12:14:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Can-I-run-a-stored-procedure-in-my-current-workspace-session-in/m-p/897803#M43803</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2023-10-09T12:14:16Z</dc:date>
    </item>
    <item>
      <title>Re: Can I run a stored procedure in my current workspace session in EG?</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Can-I-run-a-stored-procedure-in-my-current-workspace-session-in/m-p/897804#M43804</link>
      <description>&lt;P&gt;I have made numerous custom tasks in C# for EG. It isn't too bad. They can be used by other EG users and appear in the available tasks. They can be full-blown applications with numerous Windows, etc.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;EG has a few interfaces that have to be used. Visual Studio auto-implements them and you fill in what needs to be done. If you haven't worked with interfaces, see this&amp;nbsp; to understand them a bit. It will help when you read Chris' book:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.youtube.com/watch?v=A7qwuFnyIpM" target="_blank"&gt;(1) Interfaces in C# - What they are, how to use them, and why they are so powerful. - YouTube&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Basically, they are a contract. It allows EG to call your custom task. For example, a car may have a IVehicle interface. All vehicles must explain how to accelerate. In EG, you will have contracts like 'RunTask' that tells EG what to run when the task opens.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Oct 2023 12:27:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Can-I-run-a-stored-procedure-in-my-current-workspace-session-in/m-p/897804#M43804</guid>
      <dc:creator>AlanC</dc:creator>
      <dc:date>2023-10-09T12:27:54Z</dc:date>
    </item>
    <item>
      <title>Re: Can I run a stored procedure in my current workspace session in EG?</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Can-I-run-a-stored-procedure-in-my-current-workspace-session-in/m-p/898085#M43816</link>
      <description>&lt;P&gt;I will give it a try, thanks. Just one more question: when I look at the documentation here&amp;nbsp;&lt;A href="https://support.sas.com/documentation/onlinedoc/guide/customtasks/index.htm" target="_blank" rel="nofollow noopener noreferrer"&gt;https://support.sas.com/documentation/onlinedoc/guide/customtasks/index.htm&lt;/A&gt;&amp;nbsp;it seems to be somewhat outdated, with examples that are compatible with EG4.1 &amp;amp; later. Should these examples work just fine for EG8?&lt;/P&gt;</description>
      <pubDate>Wed, 11 Oct 2023 08:46:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Can-I-run-a-stored-procedure-in-my-current-workspace-session-in/m-p/898085#M43816</guid>
      <dc:creator>RobWanders1</dc:creator>
      <dc:date>2023-10-11T08:46:50Z</dc:date>
    </item>
    <item>
      <title>Re: Can I run a stored procedure in my current workspace session in EG?</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Can-I-run-a-stored-procedure-in-my-current-workspace-session-in/m-p/898086#M43817</link>
      <description>&lt;P&gt;I say you could try one more option.&lt;/P&gt;
&lt;P&gt;You could wrap it up in a macro in a package and make it available on the machine to other users.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Info in packages:&amp;nbsp;&lt;A href="https://github.com/yabwon/SAS_PACKAGES" target="_blank"&gt;https://github.com/yabwon/SAS_PACKAGES&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Step by step "Hello World" example:&amp;nbsp;&lt;A href="https://github.com/yabwon/SAS_PACKAGES/blob/main/SPF/Documentation/HelloWorldPackage.md" target="_blank"&gt;https://github.com/yabwon/SAS_PACKAGES/blob/main/SPF/Documentation/HelloWorldPackage.md&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Bart&lt;/P&gt;</description>
      <pubDate>Wed, 11 Oct 2023 09:01:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Can-I-run-a-stored-procedure-in-my-current-workspace-session-in/m-p/898086#M43817</guid>
      <dc:creator>yabwon</dc:creator>
      <dc:date>2023-10-11T09:01:12Z</dc:date>
    </item>
  </channel>
</rss>

