<?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 &amp;amp; Windows Task Scheduler Error in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/SAS-amp-Windows-Task-Scheduler-Error/m-p/250594#M47258</link>
    <description>&lt;P&gt;Not sure what is meant be "&lt;SPAN&gt;missing/not executed init file".&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Thanks.&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 17 Feb 2016 12:28:03 GMT</pubDate>
    <dc:creator>Jlochoa</dc:creator>
    <dc:date>2016-02-17T12:28:03Z</dc:date>
    <item>
      <title>SAS &amp; Windows Task Scheduler Error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-amp-Windows-Task-Scheduler-Error/m-p/250469#M47227</link>
      <description>&lt;P&gt;I have an interesting situation with SAS and Task Scheduler.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;TABLE width="90%"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="113"&gt;
&lt;P&gt;OS:&lt;/P&gt;
&lt;/TD&gt;
&lt;TD&gt;
&lt;P&gt;win7&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="113"&gt;
&lt;P&gt;Product:&lt;/P&gt;
&lt;/TD&gt;
&lt;TD&gt;
&lt;P&gt;Base SAS&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="113"&gt;
&lt;P&gt;Release:&lt;/P&gt;
&lt;/TD&gt;
&lt;TD&gt;
&lt;P&gt;9.4 TS1M2&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I created a SAS program that establishes a LIBNAME connection using the following statement&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname ship oledb user='xyz' password='abc' datasource='RDBP' provider='OraOLEDB.Oracle.1' schema='VAL_DW';&amp;nbsp;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The problem appears when I use Task Scheduler to start the SAS program via a batch file. The error is "Error trying to establish connection: Unable to Initialize: ORA-12154: TNS:could not resolve the connect identifier specified. Error in LIBNAME Statement.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I've checked the Task Scheduler configurations are correct. I have admin rights on the PC.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Why are there no errors when I run the SAS program via the batch file, yet there are errors when Task Scheduler runs the batch file/SASprogram?&lt;/P&gt;</description>
      <pubDate>Tue, 16 Feb 2016 23:00:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-amp-Windows-Task-Scheduler-Error/m-p/250469#M47227</guid>
      <dc:creator>Jlochoa</dc:creator>
      <dc:date>2016-02-16T23:00:28Z</dc:date>
    </item>
    <item>
      <title>Re: SAS &amp; Windows Task Scheduler Error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-amp-Windows-Task-Scheduler-Error/m-p/250518#M47237</link>
      <description>What user runs the task? &lt;BR /&gt;If system, test with another account. &lt;BR /&gt;If you have UAC activated try using a non admin account.</description>
      <pubDate>Wed, 17 Feb 2016 06:54:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-amp-Windows-Task-Scheduler-Error/m-p/250518#M47237</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2016-02-17T06:54:01Z</dc:date>
    </item>
    <item>
      <title>Re: SAS &amp; Windows Task Scheduler Error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-amp-Windows-Task-Scheduler-Error/m-p/250530#M47243</link>
      <description>&lt;P&gt;Looks like your scheduled job runs in a different context (other user? missing/not executed init file?)&lt;/P&gt;</description>
      <pubDate>Wed, 17 Feb 2016 07:35:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-amp-Windows-Task-Scheduler-Error/m-p/250530#M47243</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2016-02-17T07:35:24Z</dc:date>
    </item>
    <item>
      <title>Re: SAS &amp; Windows Task Scheduler Error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-amp-Windows-Task-Scheduler-Error/m-p/250593#M47257</link>
      <description>&lt;P&gt;task Scheduler has the option to select user to run task. I have myself as the user. I will change to another user&lt;/P&gt;</description>
      <pubDate>Wed, 17 Feb 2016 12:26:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-amp-Windows-Task-Scheduler-Error/m-p/250593#M47257</guid>
      <dc:creator>Jlochoa</dc:creator>
      <dc:date>2016-02-17T12:26:52Z</dc:date>
    </item>
    <item>
      <title>Re: SAS &amp; Windows Task Scheduler Error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-amp-Windows-Task-Scheduler-Error/m-p/250594#M47258</link>
      <description>&lt;P&gt;Not sure what is meant be "&lt;SPAN&gt;missing/not executed init file".&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Thanks.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Feb 2016 12:28:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-amp-Windows-Task-Scheduler-Error/m-p/250594#M47258</guid>
      <dc:creator>Jlochoa</dc:creator>
      <dc:date>2016-02-17T12:28:03Z</dc:date>
    </item>
    <item>
      <title>Re: SAS &amp; Windows Task Scheduler Error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-amp-Windows-Task-Scheduler-Error/m-p/250596#M47260</link>
      <description>&lt;P&gt;Access to a RDBMS usually requires a lot of specifications. In DB/2 (for ex), this is done via "instances", where each instance holds the configuration for a specific database. This instance needs to be activated (by running a script or batch that sets environmnent variables) before the DB becomes accessible.&lt;/P&gt;
&lt;P&gt;This is what I meant by "&lt;SPAN&gt;missing/not executed init file"&lt;/SPAN&gt;.&lt;/P&gt;</description>
      <pubDate>Wed, 17 Feb 2016 12:33:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-amp-Windows-Task-Scheduler-Error/m-p/250596#M47260</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2016-02-17T12:33:53Z</dc:date>
    </item>
    <item>
      <title>Re: SAS &amp; Windows Task Scheduler Error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-amp-Windows-Task-Scheduler-Error/m-p/250609#M47263</link>
      <description>&lt;P&gt;Are the environment variables set as part of the LIBNAME statement as options and/or property settings?&lt;/P&gt;</description>
      <pubDate>Wed, 17 Feb 2016 13:34:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-amp-Windows-Task-Scheduler-Error/m-p/250609#M47263</guid>
      <dc:creator>Jlochoa</dc:creator>
      <dc:date>2016-02-17T13:34:58Z</dc:date>
    </item>
    <item>
      <title>Re: SAS &amp; Windows Task Scheduler Error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-amp-Windows-Task-Scheduler-Error/m-p/250617#M47264</link>
      <description>&lt;P&gt;I can only speak from my experience with DB/2 (on a Linux server) and SAS on an AIX server.&lt;/P&gt;
&lt;P&gt;I needed to install the DB/2 client on AIX&lt;/P&gt;
&lt;P&gt;Then I needed to create an "instance" (which is actually a userid that has the config files in its home directory)&lt;/P&gt;
&lt;P&gt;Then I had to set the same environment variables that were set in the "instance" in the shell script that starts SAS. Now, when SAS calls the external DB/2 client, the client determines the connection parameters from the environment variables that were gleaned from the "instance".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Sounds complicated, is complicated, and is the reason why data transfer is handled via database unloads into flat files over here.&lt;/P&gt;
&lt;P&gt;Apart from the fact that it spares license costs.&lt;/P&gt;</description>
      <pubDate>Wed, 17 Feb 2016 13:52:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-amp-Windows-Task-Scheduler-Error/m-p/250617#M47264</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2016-02-17T13:52:46Z</dc:date>
    </item>
    <item>
      <title>Re: SAS &amp; Windows Task Scheduler Error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-amp-Windows-Task-Scheduler-Error/m-p/250618#M47265</link>
      <description>&lt;P&gt;I guess (and it is a wild guess) that when you are working frrom the desktop, the connection parameters are present in your users's environment. When you try to run the same thing from the scheduler, some of that is missing, and the DB connection fails.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Feb 2016 13:54:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-amp-Windows-Task-Scheduler-Error/m-p/250618#M47265</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2016-02-17T13:54:54Z</dc:date>
    </item>
    <item>
      <title>Re: SAS &amp; Windows Task Scheduler Error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-amp-Windows-Task-Scheduler-Error/m-p/250654#M47282</link>
      <description>&lt;P&gt;I figured out a work around by changing the Libname statement.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Old versions that did not work with Task Scheduler&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname ship oledb OLEDB_SERVICES=NO REQUIRED=YES COMPLETE=YES init_string="Provider=OraOLEDB.Oracle.1;Password=xxxxx;Persist Security Info=True;User ID=yyyyy;Data Source=RDBP" schema=VAL_DW;
&amp;nbsp;
libname ship oledb user='xxxxxx' password='yyyyy' datasource='RDBP' provider='OraOLEDB.Oracle.1' schema='VAL_DW';
&amp;nbsp;
LIBNAME ship OLEDB
PROVIDER="OraOLEDB.Oracle.1"
PROPERTIES=(
"user id"=xxxxx
password=yyyyy
"data source"=RDBP
schema=VAL_DW&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;New version that works with Task Scheduler&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname ship oledb INIT_STRING="PROVIDER=OraOLEDB.Oracle.1;Data Source=(DESCRIPTION=(SDU=16384)(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=DBP.com)(PORT=1521)))
(CONNECT_DATA=(SERVICE_NAME=RDBP.com))); Password=xxxxx;User ID=yyyyy;Persist Security Info=True" SCHEMA=VAL_DW&amp;nbsp; dbmax_text=12000;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I still curious why the old versions don’t work with Task Scheduler.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Feb 2016 17:01:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-amp-Windows-Task-Scheduler-Error/m-p/250654#M47282</guid>
      <dc:creator>Jlochoa</dc:creator>
      <dc:date>2016-02-17T17:01:27Z</dc:date>
    </item>
    <item>
      <title>Re: SAS &amp; Windows Task Scheduler Error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-amp-Windows-Task-Scheduler-Error/m-p/250672#M47284</link>
      <description>&lt;P&gt;My guess is the datasource is not being picked up for some reason hence the need to specify and initstring to replace it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Where is the datasource RDBP defined?&lt;/P&gt;</description>
      <pubDate>Wed, 17 Feb 2016 18:35:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-amp-Windows-Task-Scheduler-Error/m-p/250672#M47284</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2016-02-17T18:35:28Z</dc:date>
    </item>
    <item>
      <title>Re: SAS &amp; Windows Task Scheduler Error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-amp-Windows-Task-Scheduler-Error/m-p/250726#M47302</link>
      <description>&lt;P&gt;Found another LIBNAME statement workaround. Interesting how there are multiple ways of creating LIBNAME statements.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname ship oledb INIT_STRING="PROVIDER=OraOLEDB.Oracle.1;Data Source=//RDBP.com:1521/RDBP.na.com; Password=zzzzzz;User ID=yyyyy;Persist Security Info=True" SCHEMA=VAL_DW  dbmax_text=12000;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;Source: &amp;nbsp;Oracle Call Interface Programmer's Guide&lt;/P&gt;
&lt;P&gt;Database Connection Strings for OCI Instant Client The OCI Instant Client can make remote database connections in all the ways that ordinary SQL clients can. However because the Instant Client does not have the ORACLE_HOME environment and directory structure some of the database naming methods will require additional configuration steps.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;All Oracle net naming methods that do not require use of ORACLE_HOME or TNS_ADMIN (to locate configuration files such as tnsnames.ora or sqlnet.ora) work in the Instant Client mode. In particular, the connect_identifier in the OCIServerAttach() call can be specified in the following formats:&lt;/P&gt;
&lt;P&gt;■ A SQL Connect URL string of the form: //host:port/service name such as: //dlsun242:5521/bjava21&lt;/P&gt;
&lt;P&gt;■ As an Oracle Net connect descriptor. For example: "(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp) (HOST=dlsun242) (PORT=5521)) (CONNECT_DATA=(SERVICE_NAME=bjava21)))"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Feb 2016 21:48:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-amp-Windows-Task-Scheduler-Error/m-p/250726#M47302</guid>
      <dc:creator>Jlochoa</dc:creator>
      <dc:date>2016-02-17T21:48:53Z</dc:date>
    </item>
  </channel>
</rss>

