<?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: Proc Export Error Trapping in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Proc-Export-Error-Trapping/m-p/438122#M109210</link>
    <description>&lt;P&gt;&lt;FONT face="verdana,geneva"&gt;Maybe you can check for a non-zero value in the SYSCC or SYSERR automatic macro variables?&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="verdana,geneva"&gt;Vince DelGobbo&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="verdana,geneva"&gt;SAS R&amp;amp;D&lt;/FONT&gt;&lt;/P&gt;</description>
    <pubDate>Sat, 17 Feb 2018 02:42:38 GMT</pubDate>
    <dc:creator>Vince_SAS</dc:creator>
    <dc:date>2018-02-17T02:42:38Z</dc:date>
    <item>
      <title>Proc Export Error Trapping</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Export-Error-Trapping/m-p/438017#M109170</link>
      <description>&lt;P&gt;&lt;FONT face="courier new,courier" size="3"&gt;I'm uses SAS 9.3.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier" size="3"&gt;I have a macro that concatenates some SAS datasets and exports the new file into Access.&amp;nbsp; &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier" size="3"&gt;If the concatenation and export is successful, I then manually delete the source file; for they are redundant to concatenation. &lt;/FONT&gt;&lt;/P&gt;&lt;PRE&gt;&lt;FONT face="courier new,courier" size="3"&gt;&lt;CODE class=" language-sas"&gt;Libname Library "&amp;amp;WorkPath";
%Let ACCESS_Name = WGRR1701_TShell_MAIN_MODASA6_Output;

 %MergeOP(Suffix=
     _1   _2   _3 ,

  TabVol=Yes, 
  Briefing=No,
  __OUTACCESSDS = &amp;amp;ACCESS_Name,
  __OutPath=&amp;amp;WorkPath );&lt;/CODE&gt;&lt;/FONT&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The log looks like this:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;323         %MergeOP(Suffix=
324             _1   _2   _3 ,
325        
326          TabVol=Yes,
327          Briefing=No,
328          __OUTACCESSDS = &amp;amp;ACCESS_Name,
329          __OutPath=&amp;amp;WorkPath );
MPRINT(MERGEOP):   Data Library.TabVol;
MPRINT(MERGEOP):   set Library.TabVol_1 Library.TabVol_2 Library.TabVol_3 ;
MPRINT(MERGEOP):  run;

NOTE: There were 7480 observations read from the data set LIBRARY.TABVOL_1.
NOTE: There were 6325 observations read from the data set LIBRARY.TABVOL_2.
NOTE: There were 5445 observations read from the data set LIBRARY.TABVOL_3.
NOTE: The data set LIBRARY.TABVOL has 19250 observations and 78 variables.
NOTE: DATA statement used (Total process time):
      real time           0.49 seconds
      cpu time            0.48 seconds
      

MPRINT(MERGEOP):   proc export data = Library.TabVol OUTTABLE= "TabVol" DBMS=ACCESSCS REPLACE ;
MPRINT(MERGEOP):   AACC;
MPRINT(MERGEOP):   DATABASE="F:\surveys\WGRR\WGRR1701\6-Tabs\6_MAIN_SA6\ModASA6\WGRR1701_TShell_MAIN_MODASA6_Output.mdb" ;
MPRINT(MERGEOP):   DBDSOPTS="INSERTBUFF=25 DBCOMMIT=0";
MPRINT(MERGEOP):   run ;

NOTE: "TabVol" table was successfully created.
NOTE: PROCEDURE EXPORT used (Total process time):
      real time           17.12 seconds
      cpu time            0.51 seconds&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to programmatically test if the export&amp;nbsp;was "successful."&amp;nbsp; If "successful," then I would add new section to the macro to delete the base files.&amp;nbsp; In this example, the base files are TabVol_1, TabVol_2 and TabVol_3.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In my organization, we batch submit to process&amp;nbsp;all macros.&amp;nbsp; I had found some code that would read in the .log file and scan the .log for key words.&amp;nbsp; I can only get that to work with in interactive mode; not with in batch.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data log_test;
	infile "F:\SAM2\Versions_of_SAM\SAM2_20171128\log_check_test.log" truncover;
	input a_line $256.;
	if index(a_line, "ERROR:") &amp;gt; 0
	then abort cancel;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 16 Feb 2018 16:19:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Export-Error-Trapping/m-p/438017#M109170</guid>
      <dc:creator>MargaretCoffey</dc:creator>
      <dc:date>2018-02-16T16:19:13Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Export Error Trapping</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Export-Error-Trapping/m-p/438122#M109210</link>
      <description>&lt;P&gt;&lt;FONT face="verdana,geneva"&gt;Maybe you can check for a non-zero value in the SYSCC or SYSERR automatic macro variables?&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="verdana,geneva"&gt;Vince DelGobbo&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="verdana,geneva"&gt;SAS R&amp;amp;D&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 17 Feb 2018 02:42:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Export-Error-Trapping/m-p/438122#M109210</guid>
      <dc:creator>Vince_SAS</dc:creator>
      <dc:date>2018-02-17T02:42:38Z</dc:date>
    </item>
  </channel>
</rss>

