<?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: log file seems to be incomplete in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/log-file-seems-to-be-incomplete/m-p/951690#M45586</link>
    <description>&lt;P&gt;Either you have hit something that is causing SAS to stop.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It could have something to do with what ever %DOIT() is doing for the place it stops.&amp;nbsp; If so you might want to try running the job with the system option that makes it not buffer writes to the LOG so you can see better where it died.&amp;nbsp; If you are starting SAS from the command line try adding this option&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;-logparm 'write=immediate'&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For example perhaps the actual values you used to generate the code you pushed to the stack to run has unbalanced quotes or parentheses.&amp;nbsp; Can you browse the data and check for quotes or () in the values of those variables?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Or perhaps you have just exceeded the number of bytes of code you can stack with CALL EXECUTE.&amp;nbsp; Try switching to write the generated code to a file instead.&amp;nbsp; That will actually make it easier to check the last two possibilities as you can LOOK at the code before you run it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You should also move the definition of the macro %DOIT out of the middle of the definition of the other macro.&amp;nbsp; Why would you want to force SAS to redefine %DOIT every time you execute %DSCLEANUP?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/* Generate code to a temporary file. */
filename code temp;
data _null_;
  set src1.listofdatasetstocleanup2;
  file code;
  put
   '%doit(' filename=
   ',' year=
   ',' month=
   ',' cie=
   ',' lob=
   ',' folder=
   ')'
  ;
run;

/* Run this step to copy the generated code to the log */
data _null_;
  infile code;
  input;
  put _infile_;
run;

/* Run this statement to execute the generated code */
%include code / source2;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 22 Nov 2024 23:24:32 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2024-11-22T23:24:32Z</dc:date>
    <item>
      <title>log file seems to be incomplete</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/log-file-seems-to-be-incomplete/m-p/951682#M45583</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have 694 observations in my file and I am doing a call execute.&lt;/P&gt;
&lt;P&gt;However, the log file never goes until the end. So I am not able to confirm that every&amp;nbsp; thing was fine.&lt;/P&gt;
&lt;P&gt;How to solve that issue.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro dscleanup(env);
proc printto log="/dwh_actuariat/sasdata/Data_Retention/Validation/log/dscleanup.log" new;

%put &amp;amp;=env;

libname src1 spde "/.../Data_Retention_list/&amp;amp;env./";
libname src2 base "/.../SpecialPrjcts/Data_Retention/data/&amp;amp;env/";

data **bleep**rmt_in_premds_intg_20241031;
set src1.**bleep**rmt_in_premds_intg_20241031;
run;

data src1.listofdatasetstocleanup;
set src1.listofdatasetstocleanup;
run;

proc format;
value $alt_folder
'auto' = 'auto'
'prop' = 'habi'
'entr' = 'entr'
;
run;

proc format;
value $alt_prefix
'auto' = 'auto'
'prop' = 'prop'
'entr' = 'gc_cna'
;
run;

data src1.listofdatasetstocleanup2;
set src1.listofdatasetstocleanup;
cie=substr(filename,1,2);
lob=substr(filename,4,4);
month=substr(filename,12,3);
year=substr(filename,15,4);
folder=put(lob,alt_folder.);
run;

/*data masterlist_policy_20241031;*/
/*set src2.masterlist_policy_20241031;*/
/*run;*/

%macro doit(filename,year,month,cie, lob,folder);

%let path1=/dwh_actuariat/sasdata/Data_Retention;
%let path2=/dwh_actuariat/sasdata/Data_Retention/Data_Retention_CleanFiles;
%let path3=/dwh_actuariat/sasdata/Data_Retention/Data_Retention_Anonymized;

%put  "&amp;amp;path1./sas&amp;amp;year./&amp;amp;cie./&amp;amp;folder." ;
%put  "&amp;amp;path2./sas&amp;amp;year./&amp;amp;cie./&amp;amp;folder." ;
%put  "&amp;amp;path3./sas&amp;amp;year./&amp;amp;cie./&amp;amp;folder." ;

/*libname source4 spde "&amp;amp;path1./sas&amp;amp;year./&amp;amp;cie./&amp;amp;folder." ;*/
/*libname dest1   spde "&amp;amp;path2./sas&amp;amp;year./&amp;amp;cie./&amp;amp;folder." ;*/
/*libname dest2   spde "&amp;amp;path3./sas&amp;amp;year./&amp;amp;cie./&amp;amp;folder." ;*/

/*data dest1.&amp;amp;fname dest2.&amp;amp;fname._Anonym;*/
/*   merge source4.&amp;amp;fname. (in=inbase)*/
/*         src2.masterlist_policy_20241031 (in=inlist)*/
/*  ;*/
/*  by ORGNL_SAS_DS_ROW_NBR;*/
/*  if inlist and inbase then output dest2.&amp;amp;fname._Anonym;*/
/*  else if inbase then output dest1.&amp;amp;fname.;*/
/*run;*/

/*libname source4 clear;*/
/*libname dest1 clear;*/
/*libname dest2 clear;*/

%mend doit;
data test;
set src1.listofdatasetstocleanup2;
run;
data _null_;
  set src1.listofdatasetstocleanup2;
  call execute(cats('%nrstr(%doit)(',filename  	 
     ,',',year
     ,',',month
	 ,',',cie
	 ,',',lob
	 ,',',folder,')'))
  ;
run;
%exit: %mend dscleanup;
%dscleanup(intg);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;End of the log file:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;677       + %doit(gc_auto_prmmar2015,2015,mar,gc,auto,auto)
"/dwh_actuariat/sasdata/Data_Retention/sas2015/gc/auto"
"/dwh_actuariat/sasdata/Data_Retention/Data_Retention_CleanFiles/sas2015/gc/auto"
"/dwh_actuariat/sasdata/Data_Retention/Data_Retention_Anonymized/sas2015/gc/auto"
678       + %doit(gc_auto_prmnov2015,2015,nov,gc,auto,auto)
&amp;#12;51                                                         The SAS System                            16:25 Friday, November 22, 2024

"/dwh_actuariat/sasdata/Data_Retention/sas2015/gc/auto"
"/dwh_actuariat/sasdata/Data_Retention/Data_Retention_CleanFiles/sas2015/gc/auto"
"/dwh_actuariat/sasdata/Data_Retention/Data_Retention_Anonymized/sas2015/gc/auto"
679       + %doit(gc_auto_prmoct2015,2015,oct,gc,auto,auto)
"/dwh_actuariat/sasdata/Data_Retention/sas2015/gc/auto"
"/dwh_actuariat/sasdata/Data_Retention/Data_Retention_CleanFiles/sas2015/gc/auto"
"/dwh_actuariat/sasdata/Data_Retention/Data_Retention_Anonymized/sas2015/gc/auto"
680       + %doit(gc_auto_prmsep2015,2015,sep,gc,auto,auto)
"/dwh_actuariat/sasdata/Data_Retention/sas2015&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;How to solve that issue ?&lt;/P&gt;</description>
      <pubDate>Fri, 22 Nov 2024 21:52:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/log-file-seems-to-be-incomplete/m-p/951682#M45583</guid>
      <dc:creator>alepage</dc:creator>
      <dc:date>2024-11-22T21:52:31Z</dc:date>
    </item>
    <item>
      <title>Re: log file seems to be incomplete</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/log-file-seems-to-be-incomplete/m-p/951690#M45586</link>
      <description>&lt;P&gt;Either you have hit something that is causing SAS to stop.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It could have something to do with what ever %DOIT() is doing for the place it stops.&amp;nbsp; If so you might want to try running the job with the system option that makes it not buffer writes to the LOG so you can see better where it died.&amp;nbsp; If you are starting SAS from the command line try adding this option&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;-logparm 'write=immediate'&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For example perhaps the actual values you used to generate the code you pushed to the stack to run has unbalanced quotes or parentheses.&amp;nbsp; Can you browse the data and check for quotes or () in the values of those variables?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Or perhaps you have just exceeded the number of bytes of code you can stack with CALL EXECUTE.&amp;nbsp; Try switching to write the generated code to a file instead.&amp;nbsp; That will actually make it easier to check the last two possibilities as you can LOOK at the code before you run it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You should also move the definition of the macro %DOIT out of the middle of the definition of the other macro.&amp;nbsp; Why would you want to force SAS to redefine %DOIT every time you execute %DSCLEANUP?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/* Generate code to a temporary file. */
filename code temp;
data _null_;
  set src1.listofdatasetstocleanup2;
  file code;
  put
   '%doit(' filename=
   ',' year=
   ',' month=
   ',' cie=
   ',' lob=
   ',' folder=
   ')'
  ;
run;

/* Run this step to copy the generated code to the log */
data _null_;
  infile code;
  input;
  put _infile_;
run;

/* Run this statement to execute the generated code */
%include code / source2;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 22 Nov 2024 23:24:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/log-file-seems-to-be-incomplete/m-p/951690#M45586</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2024-11-22T23:24:32Z</dc:date>
    </item>
    <item>
      <title>Re: log file seems to be incomplete</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/log-file-seems-to-be-incomplete/m-p/951695#M45587</link>
      <description>&lt;P&gt;I've experienced in the past issues with the use of call execute() within a SAS macro. You could use dosubl() instead. I personally prefer to generate and %include code the way&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159"&gt;@Tom&lt;/a&gt;&amp;nbsp;already demonstrated because it leads to SAS log that's easier to read and debug.&lt;/P&gt;</description>
      <pubDate>Sat, 23 Nov 2024 02:04:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/log-file-seems-to-be-incomplete/m-p/951695#M45587</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2024-11-23T02:04:39Z</dc:date>
    </item>
  </channel>
</rss>

