<?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: Checking Authentication in SAS in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Checking-Authentication-in-SAS/m-p/263800#M51647</link>
    <description>&lt;P&gt;An alternative to&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser﻿&lt;/a&gt;'s approach could be using macro and using the RLINK function (untested):&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro repeat_signon ( remote = &amp;amp;remote
                      ,repeat = 3);
%let rc = 0;
%let I = 0;
%do %until(&amp;amp;I = &amp;amp;repeat or &amp;amp;rc ne 0);
%let I = %eval(&amp;amp;I+1);
signon remote=&amp;amp;remote cscript='C:\Script\tcpunix93.scr';

data _null_;
  remote_session = optgetc(“&amp;amp;remote”);
  Msg = sysmsg();
  put msg =  remote_session =;
  rc=rlink(remote_session);
  if rc = 0 then put 'No link exists.';
  else put 'A link exists.';
  call symputx(‘rc’, put(rc,2.));
run;
%end;
%mend repeat_signon;

%repeat_signon (remote =%str(lwstv21.__8015));
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 14 Apr 2016 09:19:49 GMT</pubDate>
    <dc:creator>SASKiwi</dc:creator>
    <dc:date>2016-04-14T09:19:49Z</dc:date>
    <item>
      <title>Checking Authentication in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Checking-Authentication-in-SAS/m-p/263792#M51645</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am authenticating to the UNIX server using the below statements:-&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc printto log='C:\Temp\sastest.log' new;
run;
%let remote=lwstv21.__8015; signon remote=&amp;amp;remote cscript='C:\Script\tcpunix93.scr';
data _null_;
time_slept=sleep(20,1); 
tday=today();
current=time();
put 'Execution time : ' current=time. tday date9. ;
run;
signoff;
proc printto;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;My userid and password details are already in the tcpunix93.scr file and this script has been automated.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But I need to make some changes in the code such that if the signon fails it retries signing on 2 more times . I dont want to read the log file everytime since it will bring much overhead to the code. Please suggest me a way to achieve this requirement.Thanks!&lt;/P&gt;</description>
      <pubDate>Thu, 14 Apr 2016 08:33:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Checking-Authentication-in-SAS/m-p/263792#M51645</guid>
      <dc:creator>Aditi24</dc:creator>
      <dc:date>2016-04-14T08:33:33Z</dc:date>
    </item>
    <item>
      <title>Re: Checking Authentication in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Checking-Authentication-in-SAS/m-p/263798#M51646</link>
      <description>&lt;P&gt;The best place to do this is the .scr file that controls the logon process (C:\Script\tcpunix93.scr in your case). The syntax for this file is described in the SAS/CONNECT documentation.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You will have to manually replay the logon process with &lt;FONT face="courier new,courier"&gt;telnet&lt;/FONT&gt; so you can see the responses you get from the remote server; you can then code corresponding reactions into the .scr file.&lt;/P&gt;
&lt;P&gt;I did that to catch the "password expired" message delivered by AIX and consequently prompt the user for a new password.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Apr 2016 09:05:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Checking-Authentication-in-SAS/m-p/263798#M51646</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2016-04-14T09:05:55Z</dc:date>
    </item>
    <item>
      <title>Re: Checking Authentication in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Checking-Authentication-in-SAS/m-p/263800#M51647</link>
      <description>&lt;P&gt;An alternative to&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser﻿&lt;/a&gt;'s approach could be using macro and using the RLINK function (untested):&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro repeat_signon ( remote = &amp;amp;remote
                      ,repeat = 3);
%let rc = 0;
%let I = 0;
%do %until(&amp;amp;I = &amp;amp;repeat or &amp;amp;rc ne 0);
%let I = %eval(&amp;amp;I+1);
signon remote=&amp;amp;remote cscript='C:\Script\tcpunix93.scr';

data _null_;
  remote_session = optgetc(“&amp;amp;remote”);
  Msg = sysmsg();
  put msg =  remote_session =;
  rc=rlink(remote_session);
  if rc = 0 then put 'No link exists.';
  else put 'A link exists.';
  call symputx(‘rc’, put(rc,2.));
run;
%end;
%mend repeat_signon;

%repeat_signon (remote =%str(lwstv21.__8015));
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Apr 2016 09:19:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Checking-Authentication-in-SAS/m-p/263800#M51647</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2016-04-14T09:19:49Z</dc:date>
    </item>
    <item>
      <title>Re: Checking Authentication in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Checking-Authentication-in-SAS/m-p/263814#M51648</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13976"&gt;@SASKiwi﻿&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The code is giving below error:-&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;68&lt;BR /&gt;ERROR 68-185: The function OPTGETC is unknown, or cannot be accessed.&lt;/P&gt;
&lt;P&gt;2883 Msg = sysmsg();&lt;BR /&gt;2884 put msg = remote_session =;&lt;BR /&gt;2885 rc= rlink(remote_session);&lt;BR /&gt; -----&lt;BR /&gt; 68&lt;BR /&gt;ERROR 68-185: The function RLINK is unknown, or cannot be accessed.&lt;/P&gt;
&lt;P&gt;2886 if rc = 0 then put 'No link exists.';&lt;BR /&gt;2887 else put 'A link exists.';&lt;BR /&gt;2888 call symputx('rc', put(rc,2.));&lt;BR /&gt;2889 run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Apr 2016 10:51:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Checking-Authentication-in-SAS/m-p/263814#M51648</guid>
      <dc:creator>Aditi24</dc:creator>
      <dc:date>2016-04-14T10:51:32Z</dc:date>
    </item>
    <item>
      <title>Re: Checking Authentication in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Checking-Authentication-in-SAS/m-p/263816#M51649</link>
      <description>&lt;P&gt;The rlink() function is only present in SCL, so it won't be of much help outside a DMS SAS. An one would need to have SAS/AF licensed to build a SCL program.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Apr 2016 11:08:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Checking-Authentication-in-SAS/m-p/263816#M51649</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2016-04-14T11:08:29Z</dc:date>
    </item>
    <item>
      <title>Re: Checking Authentication in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Checking-Authentication-in-SAS/m-p/263902#M51679</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Check the doc for &lt;A href="http://support.sas.com/documentation/cdl/en/connref/67933/HTML/default/viewer.htm#p0brzkmxqg483hn163ek01h4mf6e.htm" target="_blank"&gt;SIGNON Statement and Command&lt;/A&gt;. The SIGNON statement provides the CMACVAR option to name a macro variable that will tell you the follwoing:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV class="xis-table"&gt;
&lt;TABLE class="tgroup"&gt;&lt;CAPTION class="xis-title"&gt;CMACVAR Macro Variable Values in SIGNON&lt;/CAPTION&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TH class="xis-verticalTop" style="text-align: left;"&gt;
&lt;DIV id="n0zbbhpuaxhiasn1b8wq3hyc65i4" class="xis-paraTableFirst"&gt;Value&lt;/DIV&gt;
&lt;/TH&gt;
&lt;TH class="xis-verticalTop" style="text-align: left;"&gt;
&lt;DIV id="p0oyfs2lo68wzrn16ayw02xf6q78" class="xis-paraTableFirst"&gt;Description&lt;/DIV&gt;
&lt;/TH&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD style="text-align: left;"&gt;
&lt;DIV id="p0hkkzp3xxs1chn1bvp1yr8wbbl7" class="xis-paraTableFirst"&gt;&lt;CODE&gt;0&lt;/CODE&gt;&lt;/DIV&gt;
&lt;/TD&gt;
&lt;TD style="text-align: left;"&gt;
&lt;DIV id="p03sh8oi35jslkn1u5ryw15hyrls" class="xis-paraTableFirst"&gt;The sign-on is complete.&lt;/DIV&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD style="text-align: left;"&gt;
&lt;DIV id="p0r74i02e43rgun12asyghgexcy4" class="xis-paraTableFirst"&gt;&lt;CODE&gt;1&lt;/CODE&gt;&lt;/DIV&gt;
&lt;/TD&gt;
&lt;TD style="text-align: left;"&gt;
&lt;DIV id="p0nd7gloeoiwj3n1durrse3l5sw9" class="xis-paraTableFirst"&gt;The sign-on failed.&lt;/DIV&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD style="text-align: left;"&gt;
&lt;DIV id="p02rac2no0nvg6n1rv5lnvjmht3b" class="xis-paraTableFirst"&gt;&lt;CODE&gt;2&lt;/CODE&gt;&lt;/DIV&gt;
&lt;/TD&gt;
&lt;TD style="text-align: left;"&gt;
&lt;DIV id="p0qjkk2vw34vjqn19oyzxxwptbnk" class="xis-paraTableFirst"&gt;You have already signed on to the current server session.&lt;/DIV&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD style="text-align: left;"&gt;
&lt;DIV id="n1m04jmlmkpmm1n1kqmr7ge968we" class="xis-paraTableFirst"&gt;&lt;CODE&gt;3&lt;/CODE&gt;&lt;/DIV&gt;
&lt;/TD&gt;
&lt;TD style="text-align: left;"&gt;
&lt;DIV id="n04hebzxg95m8en12zncylsj9fri" class="xis-paraTableFirst"&gt;The sign-on is in progress.&lt;/DIV&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;/DIV&gt;
&lt;DIV id="n17ivaj27r7ksun11yvmmh3mej55" class="xis-note"&gt;&lt;SPAN class="xis-noteGenText"&gt;Note: &lt;/SPAN&gt;If the SIGNON command or statement fails because of incorrect syntax, the macro variable is not set.&lt;/DIV&gt;
&lt;DIV class="xis-note"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="xis-note"&gt;Bruno&lt;/DIV&gt;</description>
      <pubDate>Thu, 14 Apr 2016 15:27:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Checking-Authentication-in-SAS/m-p/263902#M51679</guid>
      <dc:creator>BrunoMueller</dc:creator>
      <dc:date>2016-04-14T15:27:51Z</dc:date>
    </item>
    <item>
      <title>Re: Checking Authentication in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Checking-Authentication-in-SAS/m-p/263997#M51718</link>
      <description>&lt;P&gt;Sorry, most SCL functions work in the DATA step but obviously not that one. Perhaps try&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/32"&gt;@BrunoMueller﻿&lt;/a&gt;'s suggestion in the same macro:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro repeat_signon ( remote = &amp;amp;remote
                      ,repeat = 3);
%let rc = 99;
%let I = 0;
%do %until(&amp;amp;I = &amp;amp;repeat or &amp;amp;rc = 0);
%let I = %eval(&amp;amp;I+1);
signon remote=&amp;amp;remote cscript='C:\Script\tcpunix93.scr' CMACVAR = signonrc;
%let rc = &amp;amp;signonrc;&lt;BR /&gt;
data _null_;
  remote_session = optgetc(“&amp;amp;remote”);
  Msg = sysmsg();
  put msg =  remote_session =;
  if symget('rc') = 0 then put 'A link exists.';
  else put 'A link does not exist.';
run;
%end;&lt;BR /&gt;
%mend repeat_signon;

%repeat_signon (remote =%str(lwstv21.__8015));&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Apr 2016 20:03:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Checking-Authentication-in-SAS/m-p/263997#M51718</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2016-04-14T20:03:10Z</dc:date>
    </item>
    <item>
      <title>Re: Checking Authentication in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Checking-Authentication-in-SAS/m-p/264753#M51983</link>
      <description>Thanks &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13976"&gt;@SASKiwi&lt;/a&gt;, you are a saviour.</description>
      <pubDate>Tue, 19 Apr 2016 10:33:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Checking-Authentication-in-SAS/m-p/264753#M51983</guid>
      <dc:creator>Aditi24</dc:creator>
      <dc:date>2016-04-19T10:33:00Z</dc:date>
    </item>
    <item>
      <title>Re: Checking Authentication in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Checking-Authentication-in-SAS/m-p/264754#M51984</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/32"&gt;@BrunoMueller﻿&lt;/a&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Apr 2016 10:33:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Checking-Authentication-in-SAS/m-p/264754#M51984</guid>
      <dc:creator>Aditi24</dc:creator>
      <dc:date>2016-04-19T10:33:28Z</dc:date>
    </item>
  </channel>
</rss>

