<?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: STP output to work area in EG session in Developers</title>
    <link>https://communities.sas.com/t5/Developers/STP-output-to-work-area-in-EG-session/m-p/332103#M5223</link>
    <description>&lt;P&gt;Hi&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Have a look at Proc STP this allows you to call a Stored Process, run the code and return the data to the calling environment.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Doc is available here &lt;A href="http://support.sas.com/documentation/cdl/en/stpug/68399/HTML/default/viewer.htm#p0p6ncj6i4s8w5n1a8jxhfkurpl1.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/stpug/68399/HTML/default/viewer.htm#p0p6ncj6i4s8w5n1a8jxhfkurpl1.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please note:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;the Stored Process should not use the %stpbegin and %stpend macro if you are not creating any output in your stp, but rather just tables.&lt;/LI&gt;
&lt;LI&gt;The code is not actually run on the Stored Process Server, but rather the same process that runs your code&lt;/LI&gt;
&lt;LI&gt;the name given in the OUTPUTDATA statement like &amp;nbsp; &lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;outputdata&amp;nbsp; sugus_mvar=work.stp_mvars;&lt;/FONT&gt;&lt;/STRONG&gt; is avialable within the Stored Process code as macro variable _TARGET_SUGUS_MVAR&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;Here is the code of the Stored Process:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let carMake = %lowcase(&amp;amp;carMake);
data &amp;amp;_TARGET_myCars;
  set sashelp.cars;
  where lowcase(make) = "&amp;amp;carMake";
run;

proc sql;
  create table &amp;amp;_target_sugus_mvar as
  select
    *
  from
    dictionary.macros
  order by
    scope
    , name
    , offset
  ;
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Here the code using Proc STP&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc stp
  program='/someFolder/STP/createData'
;
  list;
  inputparam carMake="Audi";
  outputdata  myCars=work.stp_data;
  outputdata  sugus_mvar=work.stp_mvars;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Bruno&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 13 Feb 2017 09:24:57 GMT</pubDate>
    <dc:creator>BrunoMueller</dc:creator>
    <dc:date>2017-02-13T09:24:57Z</dc:date>
    <item>
      <title>STP output to work area in EG session</title>
      <link>https://communities.sas.com/t5/Developers/STP-output-to-work-area-in-EG-session/m-p/332088#M5221</link>
      <description>&lt;P&gt;Hi!&lt;BR /&gt;&lt;BR /&gt;Is there a solution to where I output my data from a generated STP to a temporary area, reached within my EG session from where I execute my STP? I have a situation where I generate a lot of tables to a permanent library but depending who is running the STP, the tables are different. As for now, I've created a suffix to each table (&amp;amp;sysuserid.) as a guide which tables that were generated by certain user (before the tables are saved, all existing tables with user suffix is deleted).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There would be much nicer if the results from the STP could be accessed by a temporary library OR, in some way, outputted to my work area in the EG session. Could an approach like this work? (&amp;amp;&lt;SPAN&gt;SASWORKLOCATION is from EG session)&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Data&lt;/STRONG&gt; QC_DeleteMe ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set sashelp.class ;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Run&lt;/STRONG&gt; ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%let tmpHost = "MY &amp;nbsp;SERVER" 7554 ;&lt;/P&gt;&lt;P&gt;signon tmpHost AUTHDOMAIN="auth" ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %syslput SASWORKLOCATION=&amp;amp;SASWORKLOCATION. ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; rsubmit ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; libname _QC "&amp;amp;SASWORKLOCATION." ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt;Proc&lt;/STRONG&gt; &lt;STRONG&gt;Download&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Data=work.QC_DeleteMe&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Out=_QC.QC_DeleteMe ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt;Run&lt;/STRONG&gt; ;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; endrsubmit ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;signoff ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there any "neat" way to solve this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Claes&lt;/P&gt;</description>
      <pubDate>Mon, 13 Feb 2017 07:33:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/STP-output-to-work-area-in-EG-session/m-p/332088#M5221</guid>
      <dc:creator>Clash</dc:creator>
      <dc:date>2017-02-13T07:33:54Z</dc:date>
    </item>
    <item>
      <title>Re: STP output to work area in EG session</title>
      <link>https://communities.sas.com/t5/Developers/STP-output-to-work-area-in-EG-session/m-p/332094#M5222</link>
      <description>&lt;P&gt;Hmm. That sounds interesting.&lt;/P&gt;
&lt;P&gt;Maybe &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/4"&gt;@ChrisHemedinger&lt;/a&gt; could create a custom task that retrieves the value of a macro variable from a workspace server session and sets it as a prompt value for a task that runs on another environment (ie a STP).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But keep in mind that WORK locations are writable (even accessible) only by the owning user; since STPs often run on a pooled server with user sassrv, they would not be able to write into your WORK. Only STP's configured to run on a workspace server would be able to do this, IMO.&lt;/P&gt;</description>
      <pubDate>Mon, 13 Feb 2017 08:44:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/STP-output-to-work-area-in-EG-session/m-p/332094#M5222</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-02-13T08:44:17Z</dc:date>
    </item>
    <item>
      <title>Re: STP output to work area in EG session</title>
      <link>https://communities.sas.com/t5/Developers/STP-output-to-work-area-in-EG-session/m-p/332103#M5223</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Have a look at Proc STP this allows you to call a Stored Process, run the code and return the data to the calling environment.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Doc is available here &lt;A href="http://support.sas.com/documentation/cdl/en/stpug/68399/HTML/default/viewer.htm#p0p6ncj6i4s8w5n1a8jxhfkurpl1.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/stpug/68399/HTML/default/viewer.htm#p0p6ncj6i4s8w5n1a8jxhfkurpl1.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please note:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;the Stored Process should not use the %stpbegin and %stpend macro if you are not creating any output in your stp, but rather just tables.&lt;/LI&gt;
&lt;LI&gt;The code is not actually run on the Stored Process Server, but rather the same process that runs your code&lt;/LI&gt;
&lt;LI&gt;the name given in the OUTPUTDATA statement like &amp;nbsp; &lt;STRONG&gt;&lt;FONT face="courier new,courier"&gt;outputdata&amp;nbsp; sugus_mvar=work.stp_mvars;&lt;/FONT&gt;&lt;/STRONG&gt; is avialable within the Stored Process code as macro variable _TARGET_SUGUS_MVAR&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;Here is the code of the Stored Process:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let carMake = %lowcase(&amp;amp;carMake);
data &amp;amp;_TARGET_myCars;
  set sashelp.cars;
  where lowcase(make) = "&amp;amp;carMake";
run;

proc sql;
  create table &amp;amp;_target_sugus_mvar as
  select
    *
  from
    dictionary.macros
  order by
    scope
    , name
    , offset
  ;
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Here the code using Proc STP&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc stp
  program='/someFolder/STP/createData'
;
  list;
  inputparam carMake="Audi";
  outputdata  myCars=work.stp_data;
  outputdata  sugus_mvar=work.stp_mvars;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Bruno&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Feb 2017 09:24:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/STP-output-to-work-area-in-EG-session/m-p/332103#M5223</guid>
      <dc:creator>BrunoMueller</dc:creator>
      <dc:date>2017-02-13T09:24:57Z</dc:date>
    </item>
    <item>
      <title>Re: STP output to work area in EG session</title>
      <link>https://communities.sas.com/t5/Developers/STP-output-to-work-area-in-EG-session/m-p/332104#M5224</link>
      <description>&lt;P&gt;There's always something to learn. Or be reminded of. Great answer, &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/32"&gt;@BrunoMueller&lt;/a&gt;!&lt;/P&gt;</description>
      <pubDate>Mon, 13 Feb 2017 09:35:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/STP-output-to-work-area-in-EG-session/m-p/332104#M5224</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-02-13T09:35:35Z</dc:date>
    </item>
    <item>
      <title>Re: STP output to work area in EG session</title>
      <link>https://communities.sas.com/t5/Developers/STP-output-to-work-area-in-EG-session/m-p/332119#M5225</link>
      <description>&lt;P&gt;Hi!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your quick replies. Tried it but....I can't make it work --&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;NOTE: PROC_STP: ====== Stored Process: /BI Content/DeleteMe ======&lt;BR /&gt;NOTE: PROC_STP: ====== Metadata Listing for /BI Content/DeleteMe ======&lt;BR /&gt;NOTE: Stored Process Name: DeleteMe&lt;BR /&gt;NOTE: Description:&lt;BR /&gt;NOTE: Creation Date: 08Feb2017:13:56:08&lt;BR /&gt;NOTE: Modification Date: 13Feb2017:10:20:32&lt;BR /&gt;NOTE: Keywords:&lt;BR /&gt;NOTE: Responsible Parties:&amp;nbsp;MyUser&lt;BR /&gt;NOTE: Server Context: SASApp&lt;BR /&gt;NOTE: Stored Process code may run on any available server&lt;BR /&gt;NOTE: Execution required to be on SASApp application server only&lt;BR /&gt;NOTE: Source Code Repository: Source code stored in metadata&lt;BR /&gt;NOTE: Result Type: Packages Yes&lt;BR /&gt;NOTE: Streaming Yes&lt;BR /&gt;NOTE: Output Parameters:&lt;BR /&gt;NOTE: OutputData Sources available:&lt;BR /&gt;NOTE: Target: Data Table Table Parameter: _TARGET_myCars&lt;BR /&gt;NOTE: Label: _TARGET_myCars&lt;BR /&gt;NOTE: Target: Data Table Table Parameter: _target_sugus_mvar&lt;BR /&gt;NOTE: Label: _target_sugus_mvar&lt;BR /&gt;NOTE: Input Parameters: CARMAKE = Audi&lt;BR /&gt;NOTE: _result = STREAM&lt;BR /&gt;NOTE: _metaperson =&amp;nbsp;&lt;BR /&gt;NOTE: _metauser =&amp;nbsp;&lt;BR /&gt;NOTE: _client = PROCSTP; TKESTP; JVM 1.6.0_21; SunOS (sparc) 5.10&lt;BR /&gt;2 The SAS System 11:06 Monday, February 13, 2017&lt;/P&gt;&lt;P&gt;NOTE: PROC_STP: ====== End Metadata Listing for /BI Content/DeleteMe ======&lt;BR /&gt;NOTE: PROC_STP: ====== Stored Process: /BI Content/DeleteMe Return Status = 0 ======&lt;BR /&gt;NOTE: PROCEDURE STP used (Total process time):&lt;BR /&gt;real time 0.16 seconds&lt;BR /&gt;cpu time 0.03 seconds&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm not using the %beginstp but what about my settings "Execution Options" and "Data Sources and Targets"? Tried some different settings but none seems to get my output data in work area.... (please view the attached two files)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(I'm using EG 7.12)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;/Claes&lt;/P&gt;&lt;BR /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/13431i72A198A56186F883/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="Data Sources and targets.PNG" title="Data Sources and targets.PNG" /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/13432i67EAB5AE6CB577B5/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="Exec Options.PNG" title="Exec Options.PNG" /&gt;</description>
      <pubDate>Mon, 13 Feb 2017 10:25:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/STP-output-to-work-area-in-EG-session/m-p/332119#M5225</guid>
      <dc:creator>Clash</dc:creator>
      <dc:date>2017-02-13T10:25:43Z</dc:date>
    </item>
    <item>
      <title>Re: STP output to work area in EG session</title>
      <link>https://communities.sas.com/t5/Developers/STP-output-to-work-area-in-EG-session/m-p/332157#M5226</link>
      <description>&lt;P&gt;In my example I did not specify any data sources in the Metadata of the stored process.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Did you have a look at the datasets you specified in the OUTPUTDATA statement where they created, what is the content?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Which SAS Version are you using? The Version of EG should not matter.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Bruno&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Feb 2017 13:08:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/STP-output-to-work-area-in-EG-session/m-p/332157#M5226</guid>
      <dc:creator>BrunoMueller</dc:creator>
      <dc:date>2017-02-13T13:08:29Z</dc:date>
    </item>
    <item>
      <title>Re: STP output to work area in EG session</title>
      <link>https://communities.sas.com/t5/Developers/STP-output-to-work-area-in-EG-session/m-p/335389#M5227</link>
      <description>&lt;P&gt;Hi Bruno!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sorry for the slight delayed answer, had to sit down in a quite room before I figured what was wrong.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Big thanks for your help, really helped me!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Claes&lt;/P&gt;</description>
      <pubDate>Thu, 23 Feb 2017 19:47:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/STP-output-to-work-area-in-EG-session/m-p/335389#M5227</guid>
      <dc:creator>Clash</dc:creator>
      <dc:date>2017-02-23T19:47:32Z</dc:date>
    </item>
  </channel>
</rss>

