<?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: Callscoring Log error while executing SAS in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Callscoring-Log-error-while-executing-SAS/m-p/761160#M240802</link>
    <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/392912"&gt;@raj712&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/19879"&gt;@Quentin&lt;/a&gt;'s advice is good.&amp;nbsp; Get the SAS job running properly as just a SAS job first.&amp;nbsp; I imagine that it's running fine, but it looks like you might need to make a few adjustments.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;First, when you see this type of error:&lt;/P&gt;
&lt;LI-CODE lang="sas"&gt;ERROR: Insufficient authorization to access C:\Program Files (x86)\Microsoft SQL Server\130\DTS\binn\CallScoring.log.&lt;/LI-CODE&gt;
&lt;P&gt;it's usually because no log path was specified or the path was specified incorrectly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What command string are you using in C# to invoke SAS?&amp;nbsp; I would like to see the entire command string.&amp;nbsp; You probably need to put a fully qualified log path in your command string otherwise, SAS will try to write the log to where ever it is invoked from.&amp;nbsp; If you're invoking SAS from C#, it might therefore be trying to write the log to&amp;nbsp;C:\Program Files (x86)\Microsoft SQL Server\130\DTS\binn.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The second error is occurring because you're executing two instances of CallScoring concurrently.&amp;nbsp; They're both trying to write to the same log.&amp;nbsp; You need to create a dynamic log file name.&amp;nbsp; I usually use "directives" to assign such a dynamic name, but you could do it in your C# code.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="sas"&gt;ERROR: File is in use, c:\Users\abc\CallScoring.log&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here's how I typically do it in my command line string (this is just the log portion of the string):&lt;/P&gt;
&lt;PRE&gt;-log c:\Users\abc\CallScoring_#Y-#m-#d_#H-#M-#s_#p.log&lt;/PRE&gt;
&lt;P&gt;"#Y-#m-#d_#H-#M-#s" places the year-month-day-hour-minute-second into the filename of the log file.&amp;nbsp; #p places the Windows process ID into the file name which guarantees that the name will be unique and should eliminate the "File is in use" error.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Jim&lt;/P&gt;</description>
    <pubDate>Thu, 12 Aug 2021 14:32:39 GMT</pubDate>
    <dc:creator>jimbarbour</dc:creator>
    <dc:date>2021-08-12T14:32:39Z</dc:date>
    <item>
      <title>Callscoring Log error while executing SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Callscoring-Log-error-while-executing-SAS/m-p/761111#M240785</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am very new to SAS, so asking this weird queries.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can someone help me to identify how "Callscoring.log" file is being called? can i replace it with some other file (just as testing purpose)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When i am calling sas program from c#, i am getting below error. Please help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ERROR: Insufficient authorization to access C:\Program Files (x86)\Microsoft SQL Server\130\DTS\binn\CallScoring.log.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Also when i tried to run two powershell commands to execute SAS.exe as same time, it throw me error as below.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ERROR: File is in use, c:\Users\abc\CallScoring.log&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;</description>
      <pubDate>Thu, 12 Aug 2021 10:26:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Callscoring-Log-error-while-executing-SAS/m-p/761111#M240785</guid>
      <dc:creator>raj712</dc:creator>
      <dc:date>2021-08-12T10:26:00Z</dc:date>
    </item>
    <item>
      <title>Re: Callscoring Log error while executing SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Callscoring-Log-error-while-executing-SAS/m-p/761141#M240799</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;Can you show more of your log?&amp;nbsp; The part before those error messages?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you are calling a SAS program CallScoring.sas, SAS would typically create CallScoring.log which is a log file from the SAS session.&amp;nbsp; By default it's usually placed in the directory where the .sas file is located.&amp;nbsp; It's odd that it would try to write to:&lt;/P&gt;
&lt;PRE class="language-sas"&gt;&lt;CODE&gt;C:\Program Files (x86)\Microsoft SQL Server\130\DTS\binn\&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If it's possible a process has lock on the .log file, that might explain the second message.&amp;nbsp; You would just need to find out what program is locking it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Before trying to call the program from c#, I would try to get it working just as a SAS batch job.&amp;nbsp; Since you're on windows, testing that is probably as easy as right-clicking the .sas file and selecting 'batch submit.'&amp;nbsp; Get that working first, so you know the SAS part is working.&amp;nbsp; Then go back to calling it from c#.&lt;/P&gt;</description>
      <pubDate>Thu, 12 Aug 2021 13:51:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Callscoring-Log-error-while-executing-SAS/m-p/761141#M240799</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2021-08-12T13:51:01Z</dc:date>
    </item>
    <item>
      <title>Re: Callscoring Log error while executing SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Callscoring-Log-error-while-executing-SAS/m-p/761160#M240802</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/392912"&gt;@raj712&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/19879"&gt;@Quentin&lt;/a&gt;'s advice is good.&amp;nbsp; Get the SAS job running properly as just a SAS job first.&amp;nbsp; I imagine that it's running fine, but it looks like you might need to make a few adjustments.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;First, when you see this type of error:&lt;/P&gt;
&lt;LI-CODE lang="sas"&gt;ERROR: Insufficient authorization to access C:\Program Files (x86)\Microsoft SQL Server\130\DTS\binn\CallScoring.log.&lt;/LI-CODE&gt;
&lt;P&gt;it's usually because no log path was specified or the path was specified incorrectly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What command string are you using in C# to invoke SAS?&amp;nbsp; I would like to see the entire command string.&amp;nbsp; You probably need to put a fully qualified log path in your command string otherwise, SAS will try to write the log to where ever it is invoked from.&amp;nbsp; If you're invoking SAS from C#, it might therefore be trying to write the log to&amp;nbsp;C:\Program Files (x86)\Microsoft SQL Server\130\DTS\binn.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The second error is occurring because you're executing two instances of CallScoring concurrently.&amp;nbsp; They're both trying to write to the same log.&amp;nbsp; You need to create a dynamic log file name.&amp;nbsp; I usually use "directives" to assign such a dynamic name, but you could do it in your C# code.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="sas"&gt;ERROR: File is in use, c:\Users\abc\CallScoring.log&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here's how I typically do it in my command line string (this is just the log portion of the string):&lt;/P&gt;
&lt;PRE&gt;-log c:\Users\abc\CallScoring_#Y-#m-#d_#H-#M-#s_#p.log&lt;/PRE&gt;
&lt;P&gt;"#Y-#m-#d_#H-#M-#s" places the year-month-day-hour-minute-second into the filename of the log file.&amp;nbsp; #p places the Windows process ID into the file name which guarantees that the name will be unique and should eliminate the "File is in use" error.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Jim&lt;/P&gt;</description>
      <pubDate>Thu, 12 Aug 2021 14:32:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Callscoring-Log-error-while-executing-SAS/m-p/761160#M240802</guid>
      <dc:creator>jimbarbour</dc:creator>
      <dc:date>2021-08-12T14:32:39Z</dc:date>
    </item>
    <item>
      <title>Re: Callscoring Log error while executing SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Callscoring-Log-error-while-executing-SAS/m-p/761166#M240805</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/19879"&gt;@Quentin&lt;/a&gt;&amp;nbsp;and&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/37107"&gt;@jimbarbour&lt;/a&gt;. I just explicitly passed log file location to command and it worked. Thanks a lot.&lt;/P&gt;</description>
      <pubDate>Thu, 12 Aug 2021 14:48:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Callscoring-Log-error-while-executing-SAS/m-p/761166#M240805</guid>
      <dc:creator>raj712</dc:creator>
      <dc:date>2021-08-12T14:48:58Z</dc:date>
    </item>
  </channel>
</rss>

