<?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: An error occurred executing the workspace job - SAS EG 7.1 (32 bit) in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/An-error-occurred-executing-the-workspace-job-SAS-EG-7-1-32-bit/m-p/650985#M195254</link>
    <description>&lt;P&gt;I see a missing semicolon here:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;            %let path1  = \\file_path\
/*			%let reporttab = Records;*/

				proc import
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;It might be that one of the macros you call has an ABORT or %ABORT statement that causes the server to disconnect.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Start your debugging work by properly formatting the code first; as it is, it is nigh unreadable with regards to functional blocks, as the indentation is used in a very arbitrary way, but not along the logic.&lt;/P&gt;
&lt;P&gt;Then remove (comment) the "action" parts and replace them with %put statements, so you can see if your conditions work.&lt;/P&gt;
&lt;P&gt;Also see Maxim 28. Using formatted macro variables forces you to use this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%if %sysevalf("&amp;amp;max_date."d &amp;gt;= "&amp;amp;file_upload_date"d) %then&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;instead of this&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%if &amp;amp;max_File_Load_Date. &amp;gt;= &amp;amp;file_upload_date. %then&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 27 May 2020 06:44:53 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2020-05-27T06:44:53Z</dc:date>
    <item>
      <title>An error occurred executing the workspace job - SAS EG 7.1 (32 bit)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/An-error-occurred-executing-the-workspace-job-SAS-EG-7-1-32-bit/m-p/650967#M195242</link>
      <description>&lt;P&gt;Hi All ,&lt;/P&gt;
&lt;P&gt;I am trying to automate the reading of some excel files from a folder location&lt;/P&gt;
&lt;P&gt;I have noticed that for example , If there are 3 files when the final 3 file is read I get the error.&lt;/P&gt;
&lt;P&gt;Similarly if 4 files are there , after reading the 4 file this error shows .&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#FF0000"&gt;Basically , as soon as the final file is read&amp;nbsp; I get the error . even the debugging code after that isn't executed .&lt;/FONT&gt;&lt;/P&gt;
&lt;PRE&gt;%put 'loop   4-'&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But all the logic before that is executed .&amp;nbsp; I tried putting&amp;nbsp;&amp;nbsp;options&amp;nbsp;&lt;SPAN style="color: #ff0000;"&gt;noerrorabend; &lt;FONT color="#000000"&gt;but still no luck&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="dennis_oz_0-1590547123126.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/40022i47B4A64A6536BEA4/image-size/medium?v=v2&amp;amp;px=400" role="button" title="dennis_oz_0-1590547123126.png" alt="dennis_oz_0-1590547123126.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;code&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;/* Import Files */
%Macro Import_StrategicFile(rtcf_file,file_upload_date,actual_file_name,output_file);
/*let flag=1;%if &amp;amp;flag="1" %then*/
%if %sysfunc(exist(My_lib.&amp;amp;output_file.)) %then 
    %do;
	proc sql;
		select max(Response_File_Load_Date) as max_date format=date9. 
			into :max_date
				from My_lib.&amp;amp;output_file.;
	quit;
	 
	%put 'loop   2';

	%if %sysevalf("&amp;amp;max_date."d &amp;gt;= "&amp;amp;file_upload_date"d) %then
		%do;
			/*	%if &amp;amp;max_File_Load_Date. &amp;gt;= &amp;amp;file_upload_date. %then*/
			
			data _null_;
				rc=dosubl('%data_present_message(&amp;amp;output_file.,&amp;amp;max_date.,&amp;amp;file_upload_date.)');
			run;
             
			%let can = cancel;
			data _null_;
				rc=dosubl('%folder_empty_message()');
			run &amp;amp;can;

			%let can =;
		%end;
     %else %do;
            %put 'loop   4aaaaaaa-'  &amp;amp;path1\&amp;amp;rtcf_file. ;
            %let path1  = \\file_path\
/*			%let reporttab = Records;*/

				proc import
				datafile="&amp;amp;path1\&amp;amp;rtcf_file." out=work.&amp;amp;output_file._a&amp;amp;file_upload_date. dbms=csv replace;
				delimiter=',';
				guessingrows=32767;
				run;
/**/
                data My_lib.&amp;amp;output_file._&amp;amp;file_upload_date.;
				Format Response_File_Load_Date date9.;
/*				set &amp;amp;output_file. ;*/
				set work.&amp;amp;output_file._a&amp;amp;file_upload_date.;
                Response_File_Load_Date="&amp;amp;file_upload_date."d;
				run;

					%put 'loop   4-'  &amp;amp;path1\&amp;amp;rtcf_file. ;
			%sysexec  move "&amp;amp;path1\&amp;amp;rtcf_file." "&amp;amp;path1\Archive";
			 
			%put 'loop   5';
         
%end;

		%end; /*2*/
	%else 
		%do;
			%let path1 = \\file_path\;
			%let reporttab = Records;

			proc import
				datafile="&amp;amp;path1\&amp;amp;rtcf_file." out=work.&amp;amp;output_file. dbms=csv replace;
				delimiter=',';
				guessingrows=32767;
				run;

			data MY_LIB.%str(&amp;amp;output_file.);
				Format Response_File_Load_Date date9.;
				set work.&amp;amp;output_file.;
				Response_File_Load_Date="&amp;amp;file_upload_date."d;
			run;

			%sysexec  move "&amp;amp;path1\&amp;amp;rtcf_file." "&amp;amp;path1\Archive";
			%put 'loop   3';
		%end;
%Mend Import_StrategicFile;
&lt;/PRE&gt;</description>
      <pubDate>Wed, 27 May 2020 02:55:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/An-error-occurred-executing-the-workspace-job-SAS-EG-7-1-32-bit/m-p/650967#M195242</guid>
      <dc:creator>dennis_oz</dc:creator>
      <dc:date>2020-05-27T02:55:01Z</dc:date>
    </item>
    <item>
      <title>Re: An error occurred executing the workspace job - SAS EG 7.1 (32 bit)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/An-error-occurred-executing-the-workspace-job-SAS-EG-7-1-32-bit/m-p/650985#M195254</link>
      <description>&lt;P&gt;I see a missing semicolon here:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;            %let path1  = \\file_path\
/*			%let reporttab = Records;*/

				proc import
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;It might be that one of the macros you call has an ABORT or %ABORT statement that causes the server to disconnect.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Start your debugging work by properly formatting the code first; as it is, it is nigh unreadable with regards to functional blocks, as the indentation is used in a very arbitrary way, but not along the logic.&lt;/P&gt;
&lt;P&gt;Then remove (comment) the "action" parts and replace them with %put statements, so you can see if your conditions work.&lt;/P&gt;
&lt;P&gt;Also see Maxim 28. Using formatted macro variables forces you to use this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%if %sysevalf("&amp;amp;max_date."d &amp;gt;= "&amp;amp;file_upload_date"d) %then&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;instead of this&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%if &amp;amp;max_File_Load_Date. &amp;gt;= &amp;amp;file_upload_date. %then&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 27 May 2020 06:44:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/An-error-occurred-executing-the-workspace-job-SAS-EG-7-1-32-bit/m-p/650985#M195254</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-05-27T06:44:53Z</dc:date>
    </item>
    <item>
      <title>Re: An error occurred executing the workspace job - SAS EG 7.1 (32 bit)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/An-error-occurred-executing-the-workspace-job-SAS-EG-7-1-32-bit/m-p/650996#M195261</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;BR /&gt;&lt;BR /&gt;SYMBOLGEN:  Macro variable OUTPUT_FILE resolves to STRATEGIC_EXPORT
MPRINT(IMPORT_STRATEGICFILE):   set My_lib.STRATEGIC_EXPORT work.STRATEGIC_EXPORT;
MPRINT(IMPORT_STRATEGICFILE):   run;
WARNING: Multiple lengths were specified for the variable FIRST_NAME by input data set(s). This may cause truncation of data.
WARNING: Multiple lengths were specified for the variable PAYMENT_TYPE by input data set(s). This may cause truncation of data.
NOTE: There were 495 observations read from the data set MY_LIB.STRATEGIC_EXPORT.
NOTE: MVA_DSIO.OPEN_CLOSE| _DISARM|         STOP| _DISARM| 2020-05-27T17:16:35,655+10:00| _DISARM| WorkspaceServer| _DISARM| SAS| 
      _DISARM| | _DISARM| | _DISARM| 32948224| _DISARM| 10| _DISARM| 10| _DISARM| 6623417| _DISARM| 35538260| _DISARM| 0.015625| 
      _DISARM| 0.016000| _DISARM| 1906182995.640000| _DISARM| 1906182995.656000| _DISARM| 0.015625| _DISARM| | _ENDDISARM 
NOTE: There were 719 observations read from the data set WORK.STRATEGIC_EXPORT.
NOTE: MVA_DSIO.OPEN_CLOSE| _DISARM|         STOP| _DISARM| 2020-05-27T17:16:35,655+10:00| _DISARM| WorkspaceServer| _DISARM| SAS| 
      _DISARM| | _DISARM| | _DISARM| 31760384| _DISARM| 10| _DISARM| 10| _DISARM| 5967692| _DISARM| 35538672| _DISARM| 0.000000| 
      _DISARM| 0.000000| _DISARM| 1906182995.656000| _DISARM| 1906182995.656000| _DISARM| 0.000000| _DISARM| | _ENDDISARM 
NOTE: The data set MY_LIB.STRATEGIC_EXPORT has 1214 observations and 84 variables.
NOTE: MVA_DSIO.OPEN_CLOSE| _DISARM|         STOP| _DISARM| 2020-05-27T17:16:35,655+10:00| _DISARM| WorkspaceServer| _DISARM| SAS| 
      _DISARM| | _DISARM| | _DISARM| 31760384| _DISARM| 10| _DISARM| 10| _DISARM| 6820567| _DISARM| 36394127| _DISARM| 0.000000| 
      _DISARM| 0.000000| _DISARM| 1906182995.656000| _DISARM| 1906182995.656000| _DISARM| 0.000000| _DISARM| | _ENDDISARM 
NOTE: PROCEDURE| _DISARM|         STOP| _DISARM| 2020-05-27T17:16:35,655+10:00| _DISARM| WorkspaceServer| _DISARM| SAS| _DISARM| | 
      _DISARM| 37404672| _DISARM| 31760384| _DISARM| 10| _DISARM| 10| _DISARM| 8135651| _DISARM| 36394394| _DISARM| 0.015625| 
      _DISARM| 0.016000| _DISARM| 1906182995.640000| _DISARM| 1906182995.656000| _DISARM| 0.015625| _DISARM| | _ENDDISARM 
NOTE: DATA statement used (Total process time):
      real time           0.01 seconds
      user cpu time       0.01 seconds
      system cpu time     0.00 seconds
      memory              12664.21k
      OS Memory           36528.00k&lt;/PRE&gt;
&lt;P&gt;Hi sorry about that . I was trying the mask the folder location .&amp;nbsp; Like I said the code just stops executing the above step without executing further more . I have indented the code .Sorry about not doing that last time.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;It&amp;nbsp; entered the cancellation code and exited the cancellation code without any abrupt ending . So that part looks fine to me&amp;nbsp;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;while reading the last file it just does not go past&amp;nbsp; the below put statements&amp;nbsp; but throws the "error occurred executing the workspace job .&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;FONT face="helvetica"&gt;%&lt;FONT color="#FF0000"&gt;put 'left point 3'; &lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="helvetica" color="#FF0000"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; %put 'entered point 4' ; &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;/* Import Files */
%Macro Import_StrategicFile(rtcf_file,file_upload_date,actual_file_name,output_file);
/*let flag=1;%if &amp;amp;flag="1" %then*/
%if %sysfunc(exist(My_lib.&amp;amp;output_file.)) %then 
    %do;
	      %put 'entered point  2';
	         proc sql;
	         	select max(Response_File_Load_Date) as max_date format=date9. 
		     	into :max_date
		 		from My_lib.&amp;amp;output_file.;
	         quit;
	 
			%put 'left point  2';

			%if %sysevalf("&amp;amp;max_date."d &amp;gt;= "&amp;amp;file_upload_date"d) %then
	        	%do;
		 			    %put 'entered cancellation macro';
		            	data _null_;
			        	rc=dosubl('%data_present_message(&amp;amp;output_file.,&amp;amp;max_date.,&amp;amp;file_upload_date.)');
		            	run;
             
		                 	%let can = cancel;
		                	data _null_;
			             	rc=dosubl('%folder_empty_message()');
			                run &amp;amp;can;

		                	%let can =;
							%put 'exited cancellation macro';
		          %end;

                    %else %do;
                            %put 'entered point 3';
                             %let path1 =\\FTP\In;
 
                    			proc import
			                 	datafile="&amp;amp;path1\&amp;amp;rtcf_file." out=work.&amp;amp;output_file. dbms=csv replace;
			                 	delimiter=',';
			                 	guessingrows=32767;
			                	run;
 
                                data  &amp;amp;output_file.;
			           			Format Response_File_Load_Date date9.;
								set &amp;amp;output_file. ;
			  					Response_File_Load_Date="&amp;amp;file_upload_date."d;
								run;
 
								data My_lib.&amp;amp;output_file.;
								set My_lib.&amp;amp;output_file. work.&amp;amp;output_file.;
								run;
           						 %put 'left point 3';
								%put 'entered point 4'    ;

								%sysexec  move "&amp;amp;path1\&amp;amp;rtcf_file." "&amp;amp;path1\Archive";
			 
									%put 'left point 4';
         
							%end;

		  %end;  
	%else 
		%do;
			 	%let path1 =\\FTP\In;
				%let reporttab = Records;

			proc import
				datafile="&amp;amp;path1\&amp;amp;rtcf_file." out=work.&amp;amp;output_file. dbms=csv replace;
				delimiter=',';
				guessingrows=32767;
				run;

			data MY_LIB.%str(&amp;amp;output_file.);
				Format Response_File_Load_Date date9.;
				set work.&amp;amp;output_file.;
				Response_File_Load_Date="&amp;amp;file_upload_date."d;
			run;

			%sysexec  move "&amp;amp;path1\&amp;amp;rtcf_file." "&amp;amp;path1\Archive";
			%put 'loop   3';
		%end;
%Mend Import_StrategicFile;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 27 May 2020 07:37:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/An-error-occurred-executing-the-workspace-job-SAS-EG-7-1-32-bit/m-p/650996#M195261</guid>
      <dc:creator>dennis_oz</dc:creator>
      <dc:date>2020-05-27T07:37:25Z</dc:date>
    </item>
    <item>
      <title>Re: An error occurred executing the workspace job - SAS EG 7.1 (32 bit)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/An-error-occurred-executing-the-workspace-job-SAS-EG-7-1-32-bit/m-p/651010#M195266</link>
      <description>&lt;P&gt;hope this help&amp;nbsp;&lt;A href="https://support.sas.com/kb/42/679.html" target="_blank"&gt;https://support.sas.com/kb/42/679.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 27 May 2020 08:28:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/An-error-occurred-executing-the-workspace-job-SAS-EG-7-1-32-bit/m-p/651010#M195266</guid>
      <dc:creator>KianSin</dc:creator>
      <dc:date>2020-05-27T08:28:21Z</dc:date>
    </item>
    <item>
      <title>Re: An error occurred executing the workspace job - SAS EG 7.1 (32 bit)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/An-error-occurred-executing-the-workspace-job-SAS-EG-7-1-32-bit/m-p/652197#M195786</link>
      <description>Hi all,&lt;BR /&gt;I found the issue.. there input file had carriage return characters within the columns and was a .csv file  . This caused records to drop while reading and SAS was throwing an error.&lt;BR /&gt;Perhaps the error it tried to display on the log was too huge to be displayed in the log and hence the error .</description>
      <pubDate>Mon, 01 Jun 2020 11:09:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/An-error-occurred-executing-the-workspace-job-SAS-EG-7-1-32-bit/m-p/652197#M195786</guid>
      <dc:creator>dennis_oz</dc:creator>
      <dc:date>2020-06-01T11:09:40Z</dc:date>
    </item>
  </channel>
</rss>

