<?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 Copy macrovar from one server to another (sasapp &amp;lt;-&amp;gt; local) in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Copy-macrovar-from-one-server-to-another-sasapp-lt-gt-local/m-p/645989#M35985</link>
    <description>&lt;P&gt;In EG i can per program choose either Local (windows machine with SAS EG) or SASapp (unix server with SAS running) to run the sas code.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can use File Copy task to copy a file between the two.&amp;nbsp;But then I need to "hardcode" the same path in TWO programs (one running on SASApp and one running on local).&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If the project is shared between users i must make sure all users have access to that folder to transfer a file SASapp &amp;lt;-&amp;gt; local. To get around this i want it to be dynamic.&amp;nbsp;Ideally i would like to copy a dataset between SASapp WORK and Local WORK, (ie&amp;nbsp;%sysfunc(pathname(work,L)) evaluated on respective machine). But then SASApp need to know the path to WORK on the Local machine.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can i set a macro variable on SASApp and then transfer that value to the local session somehow?&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 07 May 2020 18:17:23 GMT</pubDate>
    <dc:creator>invalid</dc:creator>
    <dc:date>2020-05-07T18:17:23Z</dc:date>
    <item>
      <title>Copy macrovar from one server to another (sasapp &lt;-&gt; local)</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Copy-macrovar-from-one-server-to-another-sasapp-lt-gt-local/m-p/645989#M35985</link>
      <description>&lt;P&gt;In EG i can per program choose either Local (windows machine with SAS EG) or SASapp (unix server with SAS running) to run the sas code.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can use File Copy task to copy a file between the two.&amp;nbsp;But then I need to "hardcode" the same path in TWO programs (one running on SASApp and one running on local).&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If the project is shared between users i must make sure all users have access to that folder to transfer a file SASapp &amp;lt;-&amp;gt; local. To get around this i want it to be dynamic.&amp;nbsp;Ideally i would like to copy a dataset between SASapp WORK and Local WORK, (ie&amp;nbsp;%sysfunc(pathname(work,L)) evaluated on respective machine). But then SASApp need to know the path to WORK on the Local machine.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can i set a macro variable on SASApp and then transfer that value to the local session somehow?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 07 May 2020 18:17:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Copy-macrovar-from-one-server-to-another-sasapp-lt-gt-local/m-p/645989#M35985</guid>
      <dc:creator>invalid</dc:creator>
      <dc:date>2020-05-07T18:17:23Z</dc:date>
    </item>
    <item>
      <title>Re: Copy macrovar from one server to another (sasapp &lt;-&gt; local)</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Copy-macrovar-from-one-server-to-another-sasapp-lt-gt-local/m-p/645994#M35986</link>
      <description>A macro-variable is bound to the session, a session running on a server is, most likely, not able to access local directories. So this won't work.</description>
      <pubDate>Thu, 07 May 2020 18:42:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Copy-macrovar-from-one-server-to-another-sasapp-lt-gt-local/m-p/645994#M35986</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2020-05-07T18:42:42Z</dc:date>
    </item>
    <item>
      <title>Re: Copy macrovar from one server to another (sasapp &lt;-&gt; local)</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Copy-macrovar-from-one-server-to-another-sasapp-lt-gt-local/m-p/646006#M35987</link>
      <description>&lt;P&gt;If you are copying data sets, look at the Upload SAS Data Sets and Download SAS Data Sets tasks.&amp;nbsp; These can copy SAS data set files from a remote SAS library to a local PC folder, or vice versa.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If these are just general files, I can't think of a clean way of doing what you want (copy macro values from local session to remote).&amp;nbsp; I can think of one very messy way though.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;On Local SAS, run a SAS program that writes out current macro var values of interest to a local file (maybe even as a program, with %LET statements).&lt;/LI&gt;
&lt;LI&gt;Use Copy Files task to transfer that file to your remote SAS session (SASApp).&lt;/LI&gt;
&lt;LI&gt;On SASApp, run a program to %include the file you just copied.&amp;nbsp; Now you have these macro variables in your session.&lt;/LI&gt;
&lt;/UL&gt;</description>
      <pubDate>Thu, 07 May 2020 19:04:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Copy-macrovar-from-one-server-to-another-sasapp-lt-gt-local/m-p/646006#M35987</guid>
      <dc:creator>ChrisHemedinger</dc:creator>
      <dc:date>2020-05-07T19:04:41Z</dc:date>
    </item>
    <item>
      <title>Re: Copy macrovar from one server to another (sasapp &lt;-&gt; local)</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Copy-macrovar-from-one-server-to-another-sasapp-lt-gt-local/m-p/646008#M35988</link>
      <description>&lt;P&gt;Have you tried SYSRPUT or SYSLPUT?&lt;/P&gt;
&lt;P&gt;SYSLPUT looks appropriate in this case:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://documentation.sas.com/?docsetId=mcrolref&amp;amp;docsetTarget=p13mg8ttnegfzxn15lz4aky4d3p5.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en"&gt;https://documentation.sas.com/?docsetId=mcrolref&amp;amp;docsetTarget=p13mg8ttnegfzxn15lz4aky4d3p5.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can choose which session to pass the macro variable to, if you have multiple open using the REMOTE session ID and REMOTE option.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/177512"&gt;@invalid&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;In EG i can per program choose either Local (windows machine with SAS EG) or SASapp (unix server with SAS running) to run the sas code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I can use File Copy task to copy a file between the two.&amp;nbsp;But then I need to "hardcode" the same path in TWO programs (one running on SASApp and one running on local).&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If the project is shared between users i must make sure all users have access to that folder to transfer a file SASapp &amp;lt;-&amp;gt; local. To get around this i want it to be dynamic.&amp;nbsp;Ideally i would like to copy a dataset between SASapp WORK and Local WORK, (ie&amp;nbsp;%sysfunc(pathname(work,L)) evaluated on respective machine). But then SASApp need to know the path to WORK on the Local machine.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can i set a macro variable on SASApp and then transfer that value to the local session somehow?&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 07 May 2020 19:05:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Copy-macrovar-from-one-server-to-another-sasapp-lt-gt-local/m-p/646008#M35988</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2020-05-07T19:05:58Z</dc:date>
    </item>
    <item>
      <title>Re: Copy macrovar from one server to another (sasapp &lt;-&gt; local)</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Copy-macrovar-from-one-server-to-another-sasapp-lt-gt-local/m-p/646023#M35989</link>
      <description>I like Chris's idea, but I think I would transfer them with a SAS data set.  You've got dictionary.macros, which holds all of the macro variables. I would think you could use PROC SQL to create a dataset from that, then push that dataset to the other SAS session, and then read the data set in a DATA step and use CALL SYMPUTX to re-generate the macro variables.  One thing to keep in mind is that a macro variable with length &amp;gt;200 will have multiple records in dictionary.macros.  &lt;BR /&gt;&lt;BR /&gt;Here's a similar  example of saving and restoring macro vars (which wouldn't actually handle long values, but could be adapted for your need): &lt;A href="https://support.sas.com/kb/46/300.html" target="_blank"&gt;https://support.sas.com/kb/46/300.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;If you do it a lot, you can imagine writing  macros %SaveMacroVars(out=/*output dataset name*/,mvars=/*list of macro vars to save*/) and %RestoreMacroVars(data=/*name of dataset previously created by %SaveMacroVars*/).</description>
      <pubDate>Thu, 07 May 2020 20:01:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Copy-macrovar-from-one-server-to-another-sasapp-lt-gt-local/m-p/646023#M35989</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2020-05-07T20:01:59Z</dc:date>
    </item>
    <item>
      <title>Re: Copy macrovar from one server to another (sasapp &lt;-&gt; local)</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Copy-macrovar-from-one-server-to-another-sasapp-lt-gt-local/m-p/646027#M35990</link>
      <description>&lt;P&gt;SYSRPUT and SYSLPUT apply to SAS/CONNECT -- when you have two SAS sessions talking directly to each other.&amp;nbsp; That's SAS &amp;lt;--&amp;gt; SAS.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But with your typical EG setup, you don't have SAS/CONNECT in the middle.&amp;nbsp; It's EG connecting to your local SAS, and EG connecting to your remote SAS. EG uses SAS Integration Technologies for this work.&amp;nbsp; SAS Integration Technologies supports [any client]&amp;lt;--&amp;gt;SAS, where [any client] might be EG, SAS Add-In for MS Office, SAS DI Studio, etc.&lt;/P&gt;</description>
      <pubDate>Thu, 07 May 2020 20:15:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Copy-macrovar-from-one-server-to-another-sasapp-lt-gt-local/m-p/646027#M35990</guid>
      <dc:creator>ChrisHemedinger</dc:creator>
      <dc:date>2020-05-07T20:15:17Z</dc:date>
    </item>
    <item>
      <title>Re: Copy macrovar from one server to another (sasapp &lt;-&gt; local)</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Copy-macrovar-from-one-server-to-another-sasapp-lt-gt-local/m-p/646028#M35991</link>
      <description>&lt;P&gt;I think&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/177512"&gt;@invalid&lt;/a&gt;&amp;nbsp;was looking to grab just the one value (path to WORK).&amp;nbsp; But if I follow&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/19879"&gt;@Quentin&lt;/a&gt;&amp;nbsp;down the path of over-engineering, then you could just use the Download Data Set task to "download" SASHELP.VMACRO to a sas7bdat, then use Upload SAS Data Set to copy to any library on your remote server.&lt;/P&gt;</description>
      <pubDate>Thu, 07 May 2020 20:19:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Copy-macrovar-from-one-server-to-another-sasapp-lt-gt-local/m-p/646028#M35991</guid>
      <dc:creator>ChrisHemedinger</dc:creator>
      <dc:date>2020-05-07T20:19:45Z</dc:date>
    </item>
    <item>
      <title>Re: Copy macrovar from one server to another (sasapp &lt;-&gt; local)</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Copy-macrovar-from-one-server-to-another-sasapp-lt-gt-local/m-p/647417#M36015</link>
      <description>&lt;P&gt;Thanks all for the input.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If the code fails i don't want large file to be orphaned in the users personal folder. That is why i want to transfer it to work directly.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It seems the best solution is:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;On local write macrovars with path to Local work to file&lt;/LI&gt;&lt;LI&gt;Transfer file to SASapp (make sure it's to somewhere where all users have access, ie a personal folder)&lt;/LI&gt;&lt;LI&gt;Read in file with macrovar on SASapp&lt;/LI&gt;&lt;LI&gt;Remove file on SASapp to clean up their personal folder&lt;/LI&gt;&lt;LI&gt;Transfer large data file from SASapp to Local PC work&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 May 2020 11:34:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Copy-macrovar-from-one-server-to-another-sasapp-lt-gt-local/m-p/647417#M36015</guid>
      <dc:creator>invalid</dc:creator>
      <dc:date>2020-05-13T11:34:59Z</dc:date>
    </item>
  </channel>
</rss>

