<?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: Code to identify platform in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Code-to-identify-platform/m-p/729386#M226956</link>
    <description>&lt;P&gt;share it with us if you can.&amp;nbsp; code and error log.&amp;nbsp; the problem sounds interesting.&lt;/P&gt;</description>
    <pubDate>Fri, 26 Mar 2021 14:12:02 GMT</pubDate>
    <dc:creator>PhilC</dc:creator>
    <dc:date>2021-03-26T14:12:02Z</dc:date>
    <item>
      <title>Code to identify platform</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Code-to-identify-platform/m-p/711183#M219028</link>
      <description>&lt;P&gt;Is there code that SAS can use to identify whether it's being run on SAS EG or Base SAS.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Basically, I want to create an condition that says if the user is using Base SAS then run "Code A'. If the user is running SAS EG then run "Code B"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Jan 2021 16:31:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Code-to-identify-platform/m-p/711183#M219028</guid>
      <dc:creator>NickK</dc:creator>
      <dc:date>2021-01-13T16:31:10Z</dc:date>
    </item>
    <item>
      <title>Re: Code to identify platform</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Code-to-identify-platform/m-p/711196#M219035</link>
      <description>&lt;P&gt;When you run SAS EG the code runs on a server.&lt;/P&gt;
&lt;P&gt;You can check &amp;amp;SYSHOSTNAME&lt;SPAN&gt;&amp;nbsp;macro variable for the host name.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Jan 2021 16:47:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Code-to-identify-platform/m-p/711196#M219035</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2021-01-13T16:47:43Z</dc:date>
    </item>
    <item>
      <title>Re: Code to identify platform</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Code-to-identify-platform/m-p/711224#M219054</link>
      <description>&lt;P&gt;And when I check the value of the &amp;amp;syshostname value on my SAS Display Manager (Base) the result looks like:&lt;BR /&gt;&lt;BR /&gt;205 %put &amp;amp;syshostname;&lt;BR /&gt;DESKTOP-C36D7SF&lt;/P&gt;
&lt;P&gt;I suspect the C36D7SF might change from install to install but the DESKTOP is likely to be sufficient.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Jan 2021 17:41:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Code-to-identify-platform/m-p/711224#M219054</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-01-13T17:41:33Z</dc:date>
    </item>
    <item>
      <title>Re: Code to identify platform</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Code-to-identify-platform/m-p/711238#M219061</link>
      <description>&lt;P&gt;I've always wanted a shortcut for this.&amp;nbsp; I've never found one.&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Enterprise Guide will generate a series of "_CLIENT" macros variables.&amp;nbsp; You can test for their existence.&amp;nbsp; Base SAS will not create them automatically.&lt;/LI&gt;
&lt;LI&gt;If Base SAS batch mode is running, and idealy, if one has not directed the log to another file, then there will be two file references in DICTIONARY.EXTFILES with the same path and filename, with one difference.&amp;nbsp; One will be the program with the extension ".sas" and the other, the log, with ".log".&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;CAVEAT: this is too much art than science, it's not fool proof, I admit.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Jan 2021 18:07:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Code-to-identify-platform/m-p/711238#M219061</guid>
      <dc:creator>PhilC</dc:creator>
      <dc:date>2021-01-13T18:07:09Z</dc:date>
    </item>
    <item>
      <title>Re: Code to identify platform</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Code-to-identify-platform/m-p/711255#M219073</link>
      <description>&lt;P&gt;Run the command&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%put _all_;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;in both environments and check what macro variables exist.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For SAS/Studio you will see macro variables like these that you can check.&lt;/P&gt;
&lt;PRE&gt; GLOBAL _CLIENTAPP 'SAS Studio'
 GLOBAL _CLIENTAPPABREV Studio

 GLOBAL _EXECENV SASStudio&lt;/PRE&gt;
&lt;P&gt;I have used _CLIENTAPP in the past with EG.&lt;/P&gt;
&lt;P&gt;So something like this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%global _clientapp ;
%if %length(&amp;amp;_clientapp) %then %do;
* Running under EG or STUDIO ;
%end;
%else %do;
* NOT running under EG or STUDIO ;
%end;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 13 Jan 2021 19:20:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Code-to-identify-platform/m-p/711255#M219073</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-01-13T19:20:00Z</dc:date>
    </item>
    <item>
      <title>Re: Code to identify platform</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Code-to-identify-platform/m-p/711260#M219076</link>
      <description>&lt;P&gt;What's the reason for running different code for EG users versus Base SAS users? There are other ways to set up different SAS environments for groups of users.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Jan 2021 19:35:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Code-to-identify-platform/m-p/711260#M219076</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2021-01-13T19:35:23Z</dc:date>
    </item>
    <item>
      <title>Re: Code to identify platform</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Code-to-identify-platform/m-p/711369#M219135</link>
      <description>&lt;P&gt;The variable _MetaUser could be used, too. It only exists if a connection to a metadata server is active, but i am not sure whether that variable exists when using a local sas installation with Enterprise Guide.&lt;/P&gt;
&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13976"&gt;@SASKiwi&lt;/a&gt; One reason to run different code depending on the executing environment is calling proc printto only if a program runs as stored process and not while it is executed in Enterprise Guide.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Jan 2021 08:37:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Code-to-identify-platform/m-p/711369#M219135</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2021-01-14T08:37:34Z</dc:date>
    </item>
    <item>
      <title>Re: Code to identify platform</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Code-to-identify-platform/m-p/729383#M226954</link>
      <description>Some users prefer to use EG, some base SAS. I have a script that send program info to an SQL database. The code works in EG but not in Base SAS</description>
      <pubDate>Fri, 26 Mar 2021 14:05:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Code-to-identify-platform/m-p/729383#M226954</guid>
      <dc:creator>NickK</dc:creator>
      <dc:date>2021-03-26T14:05:11Z</dc:date>
    </item>
    <item>
      <title>Re: Code to identify platform</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Code-to-identify-platform/m-p/729386#M226956</link>
      <description>&lt;P&gt;share it with us if you can.&amp;nbsp; code and error log.&amp;nbsp; the problem sounds interesting.&lt;/P&gt;</description>
      <pubDate>Fri, 26 Mar 2021 14:12:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Code-to-identify-platform/m-p/729386#M226956</guid>
      <dc:creator>PhilC</dc:creator>
      <dc:date>2021-03-26T14:12:02Z</dc:date>
    </item>
  </channel>
</rss>

