<?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 Issue running SAS program through windows bat file in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Issue-running-SAS-program-through-windows-bat-file/m-p/59888#M16917</link>
    <description>I have a working SAS program  as below(basically uses proc sql to get metadata &lt;BR /&gt;
for each dataset whose name appears in files dataset&lt;BR /&gt;
------------------------------------------------------------------------------------------------&lt;BR /&gt;
data _null_;&lt;BR /&gt;
&lt;BR /&gt;
set files;&lt;BR /&gt;
&lt;BR /&gt;
%let libLoc = TRIM(parentFolder);&lt;BR /&gt;
%let dsName = TRIM(datasetName);&lt;BR /&gt;
%let uDSName = UPCASE(&amp;amp;dsName);&lt;BR /&gt;
%let opFile = TRIM(outputFileNameCSV);&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
%let tempLine = 'LIBNAME sasdata2 '''||&amp;amp;libLoc||''';' || 'data _NULL_;' || 'set sasdata2.'||&amp;amp;dsName||';' || 'run;' || 'ODS CSV FILE = '''||&amp;amp;opFile||''';' || 'proc sql;' || 'select * from dictionary.tables where memname='''||&amp;amp;uDSName||''';' || 'select * from dictionary.columns where memname='''||&amp;amp;uDSName||''';' || 'run;' || 'ODS CSV CLOSE;'&lt;BR /&gt;
;&lt;BR /&gt;
&lt;BR /&gt;
call execute(&amp;amp;tempLine);&lt;BR /&gt;
&lt;BR /&gt;
run;&lt;BR /&gt;
--------------------------------------------------------------------------------------------------&lt;BR /&gt;
The above program runs fine through the SAS application  and I get the metadata extracted in the appropriate csv files. But if I try to run the same program through a windows .bat file I don't see any output(No csv files created). My .bat file contains&lt;BR /&gt;
&lt;BR /&gt;
------------------------------------------------------------------------------------------------&lt;BR /&gt;
set program_path="C:\DAG\SAS\Tests\mySASProgram.sas"&lt;BR /&gt;
set log_path="C:\DAG\SAS\Tests\mySASProgram.log"&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
"C:\Program Files\SAS\SASFoundation\9.2\sas.exe" -SYSPARM incov -SYSIN %program_path% -log %log_path%&lt;BR /&gt;
------------------------------------------------------------------------------------------------&lt;BR /&gt;
&lt;BR /&gt;
Any ideas on what I'm missing in the .bat file?&lt;BR /&gt;
&lt;BR /&gt;
Thanks &amp;amp; Regards,&lt;BR /&gt;
Neelam</description>
    <pubDate>Wed, 29 Jul 2009 15:59:08 GMT</pubDate>
    <dc:creator>deleted_user</dc:creator>
    <dc:date>2009-07-29T15:59:08Z</dc:date>
    <item>
      <title>Issue running SAS program through windows bat file</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Issue-running-SAS-program-through-windows-bat-file/m-p/59888#M16917</link>
      <description>I have a working SAS program  as below(basically uses proc sql to get metadata &lt;BR /&gt;
for each dataset whose name appears in files dataset&lt;BR /&gt;
------------------------------------------------------------------------------------------------&lt;BR /&gt;
data _null_;&lt;BR /&gt;
&lt;BR /&gt;
set files;&lt;BR /&gt;
&lt;BR /&gt;
%let libLoc = TRIM(parentFolder);&lt;BR /&gt;
%let dsName = TRIM(datasetName);&lt;BR /&gt;
%let uDSName = UPCASE(&amp;amp;dsName);&lt;BR /&gt;
%let opFile = TRIM(outputFileNameCSV);&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
%let tempLine = 'LIBNAME sasdata2 '''||&amp;amp;libLoc||''';' || 'data _NULL_;' || 'set sasdata2.'||&amp;amp;dsName||';' || 'run;' || 'ODS CSV FILE = '''||&amp;amp;opFile||''';' || 'proc sql;' || 'select * from dictionary.tables where memname='''||&amp;amp;uDSName||''';' || 'select * from dictionary.columns where memname='''||&amp;amp;uDSName||''';' || 'run;' || 'ODS CSV CLOSE;'&lt;BR /&gt;
;&lt;BR /&gt;
&lt;BR /&gt;
call execute(&amp;amp;tempLine);&lt;BR /&gt;
&lt;BR /&gt;
run;&lt;BR /&gt;
--------------------------------------------------------------------------------------------------&lt;BR /&gt;
The above program runs fine through the SAS application  and I get the metadata extracted in the appropriate csv files. But if I try to run the same program through a windows .bat file I don't see any output(No csv files created). My .bat file contains&lt;BR /&gt;
&lt;BR /&gt;
------------------------------------------------------------------------------------------------&lt;BR /&gt;
set program_path="C:\DAG\SAS\Tests\mySASProgram.sas"&lt;BR /&gt;
set log_path="C:\DAG\SAS\Tests\mySASProgram.log"&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
"C:\Program Files\SAS\SASFoundation\9.2\sas.exe" -SYSPARM incov -SYSIN %program_path% -log %log_path%&lt;BR /&gt;
------------------------------------------------------------------------------------------------&lt;BR /&gt;
&lt;BR /&gt;
Any ideas on what I'm missing in the .bat file?&lt;BR /&gt;
&lt;BR /&gt;
Thanks &amp;amp; Regards,&lt;BR /&gt;
Neelam</description>
      <pubDate>Wed, 29 Jul 2009 15:59:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Issue-running-SAS-program-through-windows-bat-file/m-p/59888#M16917</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-07-29T15:59:08Z</dc:date>
    </item>
    <item>
      <title>Re: Issue running SAS program through windows bat file</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Issue-running-SAS-program-through-windows-bat-file/m-p/59889#M16918</link>
      <description>What does your SAS Log reveal about the SAS code being executed?  Recommend you generate as much output for your executed code - add the following:&lt;BR /&gt;
&lt;BR /&gt;
OPTIONS SOURCE SOURCE2 MACROGEN SYMBOLGEN ;&lt;BR /&gt;
&lt;BR /&gt;
Then review the SASLOG output and if the problem is not obvious, then re-post a reply to this thread and paste the relevant SAS log (where code is executed) for additional diagnosis.&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.</description>
      <pubDate>Wed, 29 Jul 2009 16:17:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Issue-running-SAS-program-through-windows-bat-file/m-p/59889#M16918</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2009-07-29T16:17:21Z</dc:date>
    </item>
  </channel>
</rss>

