<?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: SAS 9.4 testing if Viya is available in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/SAS-9-4-testing-if-Viya-is-available/m-p/702613#M215200</link>
    <description>&lt;P&gt;A little macro magic should do the trick:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let CASSTMTERR=0;

cas casauto;

%if &amp;amp;CASSTMTERR ne 0&lt;BR /&gt;   or %index(%superq(SYSERRORTEXT),session failed) &lt;BR /&gt;  %then %do;
  /* Connnection was not successful */
  %put NOTE: No connection made.;
     /* You could also termiante this job */
     /* endsas;*/
  %end;
  %else %do;
      /* Connection successful - do the work */
      caslib _all_ assign;
      proc casutil incaslib='MYCASLIB' outcaslib='MYCASLIB';
         droptable casdata='Report_Table' quiet;
         load data=Report_Table casout='Report_Table' replace;
         promote casdata='Report_Table';
         save casdata='Report_Table';
      run;
   %end;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 30 Nov 2020 19:58:18 GMT</pubDate>
    <dc:creator>SASJedi</dc:creator>
    <dc:date>2020-11-30T19:58:18Z</dc:date>
    <item>
      <title>SAS 9.4 testing if Viya is available</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-9-4-testing-if-Viya-is-available/m-p/701775#M214917</link>
      <description>&lt;P&gt;Hi everyone,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a cloud environment with a SAS 9.4 server and also a separate SAS Viya server for running visual analytics.&lt;/P&gt;
&lt;P&gt;I want to have a process that:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Runs on the SAS 9.4 server to create the data table for my VA report.&lt;/LI&gt;
&lt;LI&gt;Sends the data across to the Viya server.&lt;/LI&gt;
&lt;LI&gt;Sends an email to alert users that the data is updated.&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is an example of the code I have so far for sending data to Viya.&lt;/P&gt;
&lt;P style="margin: 0in; margin-left: .375in; font-family: Calibri; font-size: 11.0pt;"&gt;&lt;SPAN style="font-weight: bold;"&gt;cas casauto;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="margin: 0in; margin-left: .375in; font-family: Calibri; font-size: 11.0pt;"&gt;&lt;SPAN style="font-weight: bold;"&gt;caslib _all_ assign;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="margin: 0in; margin-left: .375in; font-family: Calibri; font-size: 11.0pt;"&gt;&lt;SPAN style="font-weight: bold;"&gt;proc casutil incaslib='MYCASLIB' outcaslib='MYCASLIB';&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="margin: 0in; margin-left: .75in; font-family: Calibri; font-size: 11.0pt;"&gt;&lt;SPAN style="font-weight: bold;"&gt;droptable casdata='Report_Table' quiet;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="margin: 0in; margin-left: .75in; font-family: Calibri; font-size: 11.0pt;"&gt;&lt;SPAN style="font-weight: bold;"&gt;load data=Report_Table casout='Report_Table' replace;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="margin: 0in; margin-left: .75in; font-family: Calibri; font-size: 11.0pt;"&gt;&lt;SPAN style="font-weight: bold;"&gt;promote casdata='Report_Table';&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="margin: 0in; margin-left: .75in; font-family: Calibri; font-size: 11.0pt;"&gt;&lt;SPAN style="font-weight: bold;"&gt;save casdata='Report_Table';&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="margin: 0in; margin-left: .375in; font-family: Calibri; font-size: 11.0pt;"&gt;&lt;SPAN style="font-weight: bold;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="margin: 0in; margin-left: .375in; font-family: Calibri; font-size: 11.0pt;"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The problem I have is that the Viya server is not turned on 24/7 at the moment so the process throws errors when it's down.&lt;/P&gt;
&lt;P&gt;The long term solution will probably be that we need it up 24/7 in line with out prod SAS9.4 server however I would still want to come up with a plan for how to handle things if Viya is down for any reason.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Does anyone have any examples of code I could run to check if the viya envrionment is up before I try to send the data across?&lt;/P&gt;
&lt;P&gt;Ideally my end goal will be that if Viya is down I want the 9.4 process to send the email saying it's down rather than just the alert that the new data is available.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks in advance,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Tim&lt;/P&gt;</description>
      <pubDate>Thu, 26 Nov 2020 09:05:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-9-4-testing-if-Viya-is-available/m-p/701775#M214917</guid>
      <dc:creator>TimCampbell</dc:creator>
      <dc:date>2020-11-26T09:05:44Z</dc:date>
    </item>
    <item>
      <title>Re: SAS 9.4 testing if Viya is available</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-9-4-testing-if-Viya-is-available/m-p/702613#M215200</link>
      <description>&lt;P&gt;A little macro magic should do the trick:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let CASSTMTERR=0;

cas casauto;

%if &amp;amp;CASSTMTERR ne 0&lt;BR /&gt;   or %index(%superq(SYSERRORTEXT),session failed) &lt;BR /&gt;  %then %do;
  /* Connnection was not successful */
  %put NOTE: No connection made.;
     /* You could also termiante this job */
     /* endsas;*/
  %end;
  %else %do;
      /* Connection successful - do the work */
      caslib _all_ assign;
      proc casutil incaslib='MYCASLIB' outcaslib='MYCASLIB';
         droptable casdata='Report_Table' quiet;
         load data=Report_Table casout='Report_Table' replace;
         promote casdata='Report_Table';
         save casdata='Report_Table';
      run;
   %end;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 30 Nov 2020 19:58:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-9-4-testing-if-Viya-is-available/m-p/702613#M215200</guid>
      <dc:creator>SASJedi</dc:creator>
      <dc:date>2020-11-30T19:58:18Z</dc:date>
    </item>
  </channel>
</rss>

