<?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 Pass libref from Stored Process to EG session in Developers</title>
    <link>https://communities.sas.com/t5/Developers/Pass-libref-from-Stored-Process-to-EG-session/m-p/100616#M3691</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;Hi all&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Using SAS EG with SAS9.3 under Windows Server is there any way to run a stored process out of EG which defines a library (a libname statement) and then have this libref available in the EG session?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In real life:&lt;/P&gt;&lt;P&gt;I want to implement a process for SAS Forecast Studio users where I need to give the users an option to re-direct a library (libref) to another folder. This will allow the users to create forecasts on versions of the same tables with different data for "what-if" analysis (scenario planning).&lt;/P&gt;&lt;P&gt;In my understanding both SAS Forecast Studio and EG spawn their sessions via object spawner so I would assume if there is a solution in EG I can use the same approach for Forecast Studio. In Forecast Studio the only way to execute user written SAS code is via a stored process.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have some ideas how I could solve the problem differently (like defining the libref in the autoexec based on some table entry or existence of a token file) so I'm not after alternative solutions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is it possible to somehow "connect" the 2 sessions? Any ideas greatly appreciated. - Or you just confirm my "fear" that this can't be done and I must be looking for another approach.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Patrick &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 08 Apr 2013 10:31:48 GMT</pubDate>
    <dc:creator>Patrick</dc:creator>
    <dc:date>2013-04-08T10:31:48Z</dc:date>
    <item>
      <title>Pass libref from Stored Process to EG session</title>
      <link>https://communities.sas.com/t5/Developers/Pass-libref-from-Stored-Process-to-EG-session/m-p/100616#M3691</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;Hi all&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Using SAS EG with SAS9.3 under Windows Server is there any way to run a stored process out of EG which defines a library (a libname statement) and then have this libref available in the EG session?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In real life:&lt;/P&gt;&lt;P&gt;I want to implement a process for SAS Forecast Studio users where I need to give the users an option to re-direct a library (libref) to another folder. This will allow the users to create forecasts on versions of the same tables with different data for "what-if" analysis (scenario planning).&lt;/P&gt;&lt;P&gt;In my understanding both SAS Forecast Studio and EG spawn their sessions via object spawner so I would assume if there is a solution in EG I can use the same approach for Forecast Studio. In Forecast Studio the only way to execute user written SAS code is via a stored process.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have some ideas how I could solve the problem differently (like defining the libref in the autoexec based on some table entry or existence of a token file) so I'm not after alternative solutions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is it possible to somehow "connect" the 2 sessions? Any ideas greatly appreciated. - Or you just confirm my "fear" that this can't be done and I must be looking for another approach.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Patrick &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Apr 2013 10:31:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/Pass-libref-from-Stored-Process-to-EG-session/m-p/100616#M3691</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2013-04-08T10:31:48Z</dc:date>
    </item>
    <item>
      <title>Re: Pass libref from Stored Process to EG session</title>
      <link>https://communities.sas.com/t5/Developers/Pass-libref-from-Stored-Process-to-EG-session/m-p/100617#M3692</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I don't have code any for this, but you could specify a libref by reading the path from a text file (that has your libref path).&amp;nbsp; Since you can read in the file from EG and from the server, you should be able to create your libref in both places.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; If you need more than that, I can look at getting you a code sample.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Apr 2013 20:38:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/Pass-libref-from-Stored-Process-to-EG-session/m-p/100617#M3692</guid>
      <dc:creator>BenB</dc:creator>
      <dc:date>2013-04-08T20:38:47Z</dc:date>
    </item>
    <item>
      <title>Re: Pass libref from Stored Process to EG session</title>
      <link>https://communities.sas.com/t5/Developers/Pass-libref-from-Stored-Process-to-EG-session/m-p/100618#M3693</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ben&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The challenge I'm facing is that I need to define the libref as part of a stored process but that I then need this new libref available in the session used to submit this stored process.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example using EG assume I'm having a stored process with the following code:&lt;/P&gt;&lt;P&gt;libname test (sashelp);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I would like to do is to execute this stored process via EG and then have the libref "test" available in my EG session.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Patrick&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Apr 2013 20:58:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/Pass-libref-from-Stored-Process-to-EG-session/m-p/100618#M3693</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2013-04-08T20:58:57Z</dc:date>
    </item>
    <item>
      <title>Re: Pass libref from Stored Process to EG session</title>
      <link>https://communities.sas.com/t5/Developers/Pass-libref-from-Stored-Process-to-EG-session/m-p/100619#M3694</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I believe this approach will work (this is for Unix but should work similarly for Windows).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Store the path of your desired libref in a file that is accessible from EG and from your SAS Server.&lt;OL&gt;&lt;LI&gt;For example, myilb.txt contains "/folder/desired path/"&lt;/LI&gt;&lt;/OL&gt;&lt;/LI&gt;&lt;LI&gt;Read in the file contents using a data step (infile)&lt;/LI&gt;&lt;LI&gt;Store the results of the file in a macro variable&lt;OL&gt;&lt;LI&gt;For example, call symput('libvar',file_txt);&lt;/LI&gt;&lt;/OL&gt;&lt;/LI&gt;&lt;LI&gt;Reference the library using the macro variable&lt;OL&gt;&lt;LI&gt;&amp;amp;libvar..some_dataset&lt;/LI&gt;&lt;/OL&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hopefully this helps.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Apr 2013 12:46:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/Pass-libref-from-Stored-Process-to-EG-session/m-p/100619#M3694</guid>
      <dc:creator>BenB</dc:creator>
      <dc:date>2013-04-09T12:46:42Z</dc:date>
    </item>
    <item>
      <title>Re: Pass libref from Stored Process to EG session</title>
      <link>https://communities.sas.com/t5/Developers/Pass-libref-from-Stored-Process-to-EG-session/m-p/100620#M3695</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ben&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sorry but I believe you're missing the point here. A SAS Stored Process runs in it's own session so whatever I'm doing there doesn't alter the parent session from where I kick off the stored process - but that's what I'm after: A way to define a libref in a stored process which then is available within the parent session (so an EG session for example). I can't run any additional code in the parent session as Forecast Studio only allows me to run custom code as stored process (except for start-up/shut-down code - but that's not in the place in the process where I need the libname executed).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So what I'm after is to give Forecast Studio users a possibility to point a libref to another folder (within Forecast Studio a prompt where they can choose the folder and then executing a libname using this path).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Patrick &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Apr 2013 00:23:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/Pass-libref-from-Stored-Process-to-EG-session/m-p/100620#M3695</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2013-04-10T00:23:53Z</dc:date>
    </item>
    <item>
      <title>Re: Pass libref from Stored Process to EG session</title>
      <link>https://communities.sas.com/t5/Developers/Pass-libref-from-Stored-Process-to-EG-session/m-p/100621#M3696</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This just to share the approach I'm now taking:&lt;/P&gt;&lt;P&gt;- There will be a stored process in Forecast Studio which allows to create "simulation" data sets stored in user specific locations (folders will be created by the stored process).&lt;/P&gt;&lt;P&gt;- There will be some logic in the autoexec which scans the user specific locations and assigns libraries if simulation data sets have been created.&lt;/P&gt;&lt;P&gt;- These user specific libraries will be available both in SAS EG and SAS Forecast Studio (after re-connecting to the server and so re-executing the autoexec).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;...and sorry to mark my own post as the correct answer. I just want to indicate that this thread doesn't need any further contributions as I found a way of how to solve the problem.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 14 Apr 2013 10:47:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/Pass-libref-from-Stored-Process-to-EG-session/m-p/100621#M3696</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2013-04-14T10:47:48Z</dc:date>
    </item>
  </channel>
</rss>

