<?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: Stored Process is unavoidably returning dataset to EG [Library on server SASApp not found] in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Stored-Process-is-unavoidably-returning-dataset-to-EG-Library-on/m-p/714556#M38023</link>
    <description>&lt;P&gt;EG will attempt to add any data set that it detects was created when your code runs. If EG receives a "data created" event from the SAS session&amp;nbsp;&lt;STRONG&gt;and&lt;/STRONG&gt; the data exists when the code finishes, EG will gather these and add them as output data nodes in your flow.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;A simple approach to avoid this, if possible, is to unassign the library at the end of the code item.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname USERHOME clear;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Your data files remain, but EG won't find them to add into the flow.&lt;/P&gt;</description>
    <pubDate>Wed, 27 Jan 2021 13:09:44 GMT</pubDate>
    <dc:creator>ChrisHemedinger</dc:creator>
    <dc:date>2021-01-27T13:09:44Z</dc:date>
    <item>
      <title>Stored Process is unavoidably returning dataset to EG [Library on server SASApp not found]</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Stored-Process-is-unavoidably-returning-dataset-to-EG-Library-on/m-p/714433#M38016</link>
      <description>&lt;P&gt;&lt;FONT size="2"&gt;Hi folks!&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;I started working with SAS Enterprise Guide about 5 months ago and it's been a fun learning experience. I am trying to build a Stored Process to facilitate the life of my teammates when running queries. I know that Stored Processes seem to be mostly associated with web applications and whatnot, but that's not what I'm looking for. I just want to leverage their interfacing capabilities and use those hierarchical cool prompts.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;&lt;FONT size="2"&gt;&lt;STRONG&gt;&lt;EM&gt;TOO LONG DIDN'T READ&lt;/EM&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&lt;EM&gt;M&lt;/EM&gt;y stored process returns a dataset to my process flow, but that dataset is defined on a libname&amp;nbsp;unknown to EG. I want suppress that output, force the stored process not to return it.&amp;nbsp;I don't want the PROMPT_DATA dataset appearing in the Process Flow.&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;FONT size="2"&gt;&lt;STRONG&gt;The long version:&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;The problem I'm facing is related to the Stored Process output. However, let me describe the overall approach I'm taking.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&lt;STRONG&gt;The Stored Process Side&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;FONT size="2"&gt;My stored process "Query Prompt" runs first; the user enters various fields (mostly texts and dates) and hit Run.&lt;/FONT&gt;&lt;/LI&gt;&lt;LI&gt;&lt;FONT size="2"&gt;The stored process collects all those internal macro variables and builds a dataset called &lt;STRONG&gt;Prompt_Data&lt;/STRONG&gt;.&lt;/FONT&gt;&lt;/LI&gt;&lt;LI&gt;&lt;FONT size="2"&gt;Still within the Stored Process, I copy this dataset from &lt;STRONG&gt;WORK&lt;/STRONG&gt; to a permanent location (&lt;STRONG&gt;UserHome&lt;/STRONG&gt;), like shown in the snippet below.&lt;/FONT&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/* Define home location for user */
libname UserHome base "/data/home/&amp;amp;sysuserid";

proc datasets nolist nodetails;
	copy in=WORK out=UserHome memtype=data;
  	select Prompt_Data;
run;

libname UserHome clear;

dm 'log;clear;output;clear;';&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;FONT size="2"&gt;&lt;STRONG&gt;The EG Side&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;At this point, all user inputs are available as a table in the home folder,&amp;nbsp;so I can access the results in my Enterprise Guide environment. I built a SAS program called "Importing Prompts into Macro Variables", which will basically move the table&amp;nbsp;&lt;STRONG&gt;Prompt_Data &lt;/STRONG&gt;from home to WORK (now the EG work though), and define a macro variable for each entry in that table. &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;This is the portion of my process flow that relates to those two stages:&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SAS.png" style="width: 169px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/53942i8BCE8A471AEABEDE/image-dimensions/169x238?v=v2" width="169" height="238" role="button" title="SAS.png" alt="SAS.png" /&gt;&lt;/span&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;My actual&amp;nbsp;&lt;STRONG&gt;problem&lt;/STRONG&gt;: as&amp;nbsp;you can see above, my Stored Process is outputting the PROMPT_DATA table (its file name being USERHOME.PROMPT_DATA). The very first time I run the process, it all goes well.&amp;nbsp;However, let's say that I save my project and restart EG. In this scenario, the PROMPT_DATA output icon will still show up in the process flow due to my previous run. Then, if I try to run the stored process again, I will get the following error:&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SAS_error.png" style="width: 505px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/53944i2ED082E27A7A17CF/image-dimensions/505x128?v=v2" width="505" height="128" role="button" title="SAS_error.png" alt="SAS_error.png" /&gt;&lt;/span&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;USERHOME is defined within the stored process so it makes sense that EG won't know what it is, what I don't understand is why it's being returned to EG to being with. I can make it work if I manually delete PROMPT_DATA from my Process Flow, but that would be impractical. What I need is for my Stored Process to NOT output that in the first place! I've been looking for a solution to this for a while now and decided to give it a try with the community. I know my post is way too long, but I would rather over than underexplaining this.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;Thank you in advance for any help, it will be much appreciated!&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;Arthur&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Jan 2021 13:23:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Stored-Process-is-unavoidably-returning-dataset-to-EG-Library-on/m-p/714433#M38016</guid>
      <dc:creator>arthurcarj</dc:creator>
      <dc:date>2021-01-27T13:23:54Z</dc:date>
    </item>
    <item>
      <title>Re: Stored Process is unavoidably returning dataset to EG [Library on server SASApp not found]</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Stored-Process-is-unavoidably-returning-dataset-to-EG-Library-on/m-p/714556#M38023</link>
      <description>&lt;P&gt;EG will attempt to add any data set that it detects was created when your code runs. If EG receives a "data created" event from the SAS session&amp;nbsp;&lt;STRONG&gt;and&lt;/STRONG&gt; the data exists when the code finishes, EG will gather these and add them as output data nodes in your flow.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;A simple approach to avoid this, if possible, is to unassign the library at the end of the code item.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname USERHOME clear;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Your data files remain, but EG won't find them to add into the flow.&lt;/P&gt;</description>
      <pubDate>Wed, 27 Jan 2021 13:09:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Stored-Process-is-unavoidably-returning-dataset-to-EG-Library-on/m-p/714556#M38023</guid>
      <dc:creator>ChrisHemedinger</dc:creator>
      <dc:date>2021-01-27T13:09:44Z</dc:date>
    </item>
    <item>
      <title>Re: Stored Process is unavoidably returning dataset to EG [Library on server SASApp not found]</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Stored-Process-is-unavoidably-returning-dataset-to-EG-Library-on/m-p/714567#M38024</link>
      <description>&lt;P&gt;&lt;FONT size="2"&gt;Hi Chris, thank you very much for your reply! I forgot to include that in my question, but unfortunately that line is already in my code! I will edit my question to reflect that, sorry for if that was misleading.&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;Given the condition "the data exists when the code finishes", do you mean in the work library or anywhere? I could delete the data from the session work (or do a move instead of a copy), but it would still exist in the user home (external to the session).&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Jan 2021 20:36:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Stored-Process-is-unavoidably-returning-dataset-to-EG-Library-on/m-p/714567#M38024</guid>
      <dc:creator>arthurcarj</dc:creator>
      <dc:date>2021-01-28T20:36:05Z</dc:date>
    </item>
    <item>
      <title>Re: Stored Process is unavoidably returning dataset to EG [Library on server SASApp not found]</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Stored-Process-is-unavoidably-returning-dataset-to-EG-Library-on/m-p/715108#M38038</link>
      <description>&lt;P&gt;&lt;FONT size="2"&gt;Okay, I've found a workaround to this problem and thought of sharing here for closure and if someone goes through the same issue. &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;Since clearing the libname wasn't working, I decided not to use it altogether, and to replace any mention to UserHome for something else. Depending on what you're doing, I guess it might be hard to get rid of libname, but for my case it was doable.&amp;nbsp;&lt;/FONT&gt;&lt;FONT size="2"&gt;I found out that you can use actual paths in certain commands, so that's how I was able to solve this issue. After getting rid of using libname, the code became the following&lt;/FONT&gt;&lt;FONT size="2"&gt;:&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;proc sql;
create table "/data/home/&amp;amp;sysuserid/Prompt_Data" as
    select 	trim(Prompt_Input) as Prompt_Input,
			trim(Macro_Variable) as Macro_Variable,
			trim(Value) as Macro_Value	
    from Prompts
;quit;

/* Print to report */
title "Table - Prompt variables";
proc print data="/data/home/&amp;amp;sysuserid/Prompt_Data"; run;&lt;/PRE&gt;</description>
      <pubDate>Thu, 28 Jan 2021 20:34:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Stored-Process-is-unavoidably-returning-dataset-to-EG-Library-on/m-p/715108#M38038</guid>
      <dc:creator>arthurcarj</dc:creator>
      <dc:date>2021-01-28T20:34:19Z</dc:date>
    </item>
  </channel>
</rss>

