<?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: &amp;quot;The SAS System&amp;quot; printed into the log file in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/quot-The-SAS-System-quot-printed-into-the-log-file/m-p/516777#M139611</link>
    <description>&lt;P&gt;Tom, I copy /paste and run&amp;nbsp;your code but I can not find the "test" file&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 28 Nov 2018 16:29:18 GMT</pubDate>
    <dc:creator>Nasser_DRMCP</dc:creator>
    <dc:date>2018-11-28T16:29:18Z</dc:date>
    <item>
      <title>"The SAS System" printed into the log file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/quot-The-SAS-System-quot-printed-into-the-log-file/m-p/516631#M139553</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro mc_library_table_list2(p_lib_name , p_table_name) ;
option nomprint nodate nonumber nonotes nosymbolgen nosource ;
title ="" ;

proc printto log="/home/ldap/mellouna/log_script.txt" new;  run;

%do i=1 %to 10 ;
proc sql nofeedback ;
  describe table &amp;amp;p_lib_name..&amp;amp;p_table_name. ;
quit;

%end;

%mend ;


%mc_library_table_list2(p_lib_name=SASHELP , p_table_name=CLASS) ;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;hello,&lt;BR /&gt;by launching this code I can see the text "The SAS System" printed into the log file. how could I get rid of this ?&lt;BR /&gt;thanks a lot in advance&lt;BR /&gt;Nass&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Nov 2018 11:56:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/quot-The-SAS-System-quot-printed-into-the-log-file/m-p/516631#M139553</guid>
      <dc:creator>Nasser_DRMCP</dc:creator>
      <dc:date>2018-11-28T11:56:36Z</dc:date>
    </item>
    <item>
      <title>Re: "The SAS System" printed into the log file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/quot-The-SAS-System-quot-printed-into-the-log-file/m-p/516636#M139558</link>
      <description>&lt;P&gt;You can't, it will always tell you some information about the environment which it is using to compile.&amp;nbsp; Why would you need to, just redirect what log information you need to another file.&lt;/P&gt;</description>
      <pubDate>Wed, 28 Nov 2018 12:33:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/quot-The-SAS-System-quot-printed-into-the-log-file/m-p/516636#M139558</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-11-28T12:33:38Z</dc:date>
    </item>
    <item>
      <title>Re: "The SAS System" printed into the log file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/quot-The-SAS-System-quot-printed-into-the-log-file/m-p/516642#M139561</link>
      <description>&lt;P&gt;Thanks RW9&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have got many tables in the production environment and I need to create them (only stucture, no datas) in another test environment.&lt;/P&gt;&lt;P&gt;So after creating this script in production I can launch it in test.&lt;/P&gt;</description>
      <pubDate>Wed, 28 Nov 2018 13:00:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/quot-The-SAS-System-quot-printed-into-the-log-file/m-p/516642#M139561</guid>
      <dc:creator>Nasser_DRMCP</dc:creator>
      <dc:date>2018-11-28T13:00:09Z</dc:date>
    </item>
    <item>
      <title>Re: "The SAS System" printed into the log file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/quot-The-SAS-System-quot-printed-into-the-log-file/m-p/516666#M139574</link>
      <description>&lt;P&gt;Well, I found this post:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://stackoverflow.com/questions/28768792/extract-sql-describe-table-output" target="_blank"&gt;https://stackoverflow.com/questions/28768792/extract-sql-describe-table-output&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Which gives a macro.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Nov 2018 14:06:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/quot-The-SAS-System-quot-printed-into-the-log-file/m-p/516666#M139574</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-11-28T14:06:18Z</dc:date>
    </item>
    <item>
      <title>Re: "The SAS System" printed into the log file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/quot-The-SAS-System-quot-printed-into-the-log-file/m-p/516676#M139581</link>
      <description>&lt;P&gt;Perhaps if you removed the equal sign from the TITLE statement?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;title ' ' ;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Also you should make your macro reset the options back to the way it found them.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro mc_library_table_list2(p_lib_name , p_table_name) ;
%local save;
%let save=
 %sysfunc(getoption(mprint))
 %sysfunc(getoption(date))
 %sysfunc(getoption(number))
 %sysfunc(getoption(notes))
 %sysfunc(getoption(symbolgen))
 %sysfunc(getoption(source))
;
options nomprint nodate nonumber nonotes nosymbolgen nosource ;
 
....

options &amp;amp;save;
%mend ;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 28 Nov 2018 14:24:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/quot-The-SAS-System-quot-printed-into-the-log-file/m-p/516676#M139581</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2018-11-28T14:24:32Z</dc:date>
    </item>
    <item>
      <title>Re: "The SAS System" printed into the log file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/quot-The-SAS-System-quot-printed-into-the-log-file/m-p/516681#M139582</link>
      <description>&lt;P&gt;thanks Tom&lt;/P&gt;&lt;P&gt;but "The SAS System" still printed in the log file&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Nov 2018 14:29:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/quot-The-SAS-System-quot-printed-into-the-log-file/m-p/516681#M139582</guid>
      <dc:creator>Nasser_DRMCP</dc:creator>
      <dc:date>2018-11-28T14:29:14Z</dc:date>
    </item>
    <item>
      <title>Re: "The SAS System" printed into the log file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/quot-The-SAS-System-quot-printed-into-the-log-file/m-p/516683#M139584</link>
      <description>It didn't when I ran your test.  Did you make sure to turn off the PRINTTO?  You did not include that in your example code.  Or try setting the TITLE to some invisible character like 'A0'x.&lt;BR /&gt;</description>
      <pubDate>Wed, 28 Nov 2018 14:33:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/quot-The-SAS-System-quot-printed-into-the-log-file/m-p/516683#M139584</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2018-11-28T14:33:40Z</dc:date>
    </item>
    <item>
      <title>Re: "The SAS System" printed into the log file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/quot-The-SAS-System-quot-printed-into-the-log-file/m-p/516697#M139587</link>
      <description>&lt;P&gt;with &lt;FONT face="Courier New" size="3"&gt;title &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'A0'x&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; ; the message still appears.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;I check the log tab in sas EG and I can see that&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;"Project Log turned off"&lt;/P&gt;&lt;P&gt;should I specify to turn off the PRINTTO in the code macro ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Nov 2018 14:45:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/quot-The-SAS-System-quot-printed-into-the-log-file/m-p/516697#M139587</guid>
      <dc:creator>Nasser_DRMCP</dc:creator>
      <dc:date>2018-11-28T14:45:10Z</dc:date>
    </item>
    <item>
      <title>Re: "The SAS System" printed into the log file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/quot-The-SAS-System-quot-printed-into-the-log-file/m-p/516724#M139594</link>
      <description>&lt;P&gt;I ran your example and did not get any title statements in the file generated by the PROC PRINTTO LOG=.&lt;/P&gt;
&lt;P&gt;Where are you seeing this line?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro mc_library_table_list2(p_lib_name , p_table_name) ;
%local save;
%let save=
 %sysfunc(getoption(mprint))
 %sysfunc(getoption(date))
 %sysfunc(getoption(number))
 %sysfunc(getoption(notes))
 %sysfunc(getoption(symbolgen))
 %sysfunc(getoption(source))
;
option nomprint nodate nonumber nonotes nosymbolgen nosource ;

proc printto log=test  new;  run;

%do i=1 %to 10 ;
proc sql nofeedback ;
  describe table &amp;amp;p_lib_name..&amp;amp;p_table_name. ;
quit;

%end;
proc printto log=log; run;
options &amp;amp;save;
%mend ;

title 'Here is my title';
filename test temp;
%mc_library_table_list2(p_lib_name=SASHELP , p_table_name=CLASS) ;
data _null_;
  infile test;
  input;
  put _infile_;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 28 Nov 2018 15:17:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/quot-The-SAS-System-quot-printed-into-the-log-file/m-p/516724#M139594</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2018-11-28T15:17:58Z</dc:date>
    </item>
    <item>
      <title>Re: "The SAS System" printed into the log file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/quot-The-SAS-System-quot-printed-into-the-log-file/m-p/516730#M139596</link>
      <description>&lt;P&gt;please find attached my log file .&amp;nbsp;line 35&lt;/P&gt;</description>
      <pubDate>Wed, 28 Nov 2018 15:23:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/quot-The-SAS-System-quot-printed-into-the-log-file/m-p/516730#M139596</guid>
      <dc:creator>Nasser_DRMCP</dc:creator>
      <dc:date>2018-11-28T15:23:51Z</dc:date>
    </item>
    <item>
      <title>Re: "The SAS System" printed into the log file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/quot-The-SAS-System-quot-printed-into-the-log-file/m-p/516736#M139598</link>
      <description>&lt;P&gt;Your example was do the same table description 10 times. The log you posted is for different tables.&lt;/P&gt;
&lt;P&gt;How did you get it to run for different tables?&amp;nbsp; Perhaps in there you triggered some other step that generated the title statement?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Nov 2018 15:31:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/quot-The-SAS-System-quot-printed-into-the-log-file/m-p/516736#M139598</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2018-11-28T15:31:23Z</dc:date>
    </item>
    <item>
      <title>Re: "The SAS System" printed into the log file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/quot-The-SAS-System-quot-printed-into-the-log-file/m-p/516741#M139601</link>
      <description>&lt;P&gt;very sorry. please find enclosed the right log file. (the same table description 10 times.)line 53.&lt;/P&gt;&lt;P&gt;10 times (loop 10) &amp;nbsp;is just&amp;nbsp;just an example to describ the probem.&amp;nbsp;with loop 5 the text is not displayed.&lt;/P&gt;</description>
      <pubDate>Wed, 28 Nov 2018 15:38:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/quot-The-SAS-System-quot-printed-into-the-log-file/m-p/516741#M139601</guid>
      <dc:creator>Nasser_DRMCP</dc:creator>
      <dc:date>2018-11-28T15:38:28Z</dc:date>
    </item>
    <item>
      <title>Re: "The SAS System" printed into the log file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/quot-The-SAS-System-quot-printed-into-the-log-file/m-p/516752#M139603</link>
      <description>&lt;P&gt;I cannot re-create the issue.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Run the code I posted that writes the lines to a temp file and then echos the resulting file back to the SAS log using a data _null_ step.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Do you see the title lines in that?&amp;nbsp; If so then raise an issue with SAS support and perhaps they can figure out if there is some other option that controls the generation of those title lines in the re-directed log.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Nov 2018 16:04:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/quot-The-SAS-System-quot-printed-into-the-log-file/m-p/516752#M139603</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2018-11-28T16:04:15Z</dc:date>
    </item>
    <item>
      <title>Re: "The SAS System" printed into the log file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/quot-The-SAS-System-quot-printed-into-the-log-file/m-p/516777#M139611</link>
      <description>&lt;P&gt;Tom, I copy /paste and run&amp;nbsp;your code but I can not find the "test" file&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Nov 2018 16:29:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/quot-The-SAS-System-quot-printed-into-the-log-file/m-p/516777#M139611</guid>
      <dc:creator>Nasser_DRMCP</dc:creator>
      <dc:date>2018-11-28T16:29:18Z</dc:date>
    </item>
    <item>
      <title>Re: "The SAS System" printed into the log file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/quot-The-SAS-System-quot-printed-into-the-log-file/m-p/516787#M139614</link>
      <description>&lt;P&gt;The TEST fileref in my original program was using the TEMP engine to make a temporary file. So it will disappear when SAS is done.&amp;nbsp; You could change the FILENAME statement to have it write a real file instead.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I was able to recreate the problem by running the program in batch (background) mode instead of from Display Manager.&lt;/P&gt;
&lt;P&gt;I tried use PROC OPTSAVE to save the option settings and see if there were any options that were set differently when running in batch versus interactive that could change that.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;At this point your best bet is make it a two step process.&lt;/P&gt;
&lt;P&gt;One that redirects the log.&lt;/P&gt;
&lt;P&gt;And then a post processing step that reads the redirected log and writes it back out without the extra title lines.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Or even better forget about this and just generate your own table descriptions from the metadata you can get from PROC CONTENTS or DICTIONARY.COLUMNS.&amp;nbsp; This has the added benefit that you can decide what information is important and what format to use. For example you could write the commas that delimit the column names at the beginning of the lines instead of the end so that the code is easier to for humans to scan.&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;create table CARS( label='2004 Car Data' )
  (Make char(13)
  ,Model char(40)
  ,Type char(8)
  ,Origin char(6)
  ,DriveTrain char(5)
  ,MSRP num format=DOLLAR8.
  ,Invoice num format=DOLLAR8.
  ,EngineSize num label='Engine Size (L)'
  ,Cylinders num
  ,Horsepower num
  ,MPG_City num label='MPG (City)'
  ,MPG_Highway num label='MPG (Highway)'
  ,Weight num label='Weight (LBS)'
  ,Wheelbase num label='Wheelbase (IN)'
  ,Length num label='Length (IN)'
  )
;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Or you could generate SAS code instead of SQL code.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data cars (label='2004 Car Data');
  length Make $13 Model $40 Type $8 Origin $6 DriveTrain $5
    MSRP 8 Invoice 8 EngineSize 8 Cylinders 8 Horsepower 8
    MPG_City 8 MPG_Highway 8 Weight 8 Wheelbase 8 Length 8
  ;
  format MSRP dollar8. Invoice dollar8. ;
  label EngineSize='Engine Size (L)' MPG_City='MPG (City)'
    MPG_Highway='MPG (Highway)' Weight='Weight (LBS)'
    Wheelbase='Wheelbase (IN)' Length='Length (IN)'
  ;
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 28 Nov 2018 16:53:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/quot-The-SAS-System-quot-printed-into-the-log-file/m-p/516787#M139614</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2018-11-28T16:53:54Z</dc:date>
    </item>
    <item>
      <title>Re: "The SAS System" printed into the log file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/quot-The-SAS-System-quot-printed-into-the-log-file/m-p/516798#M139619</link>
      <description>&lt;P&gt;thanks a lot Tom.&lt;/P&gt;&lt;P&gt;I run the code you posted by replacing&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;filename&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; test &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;temp&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;with this==&amp;gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;filename&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; test &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;"/home/ldap/mellouna/log_script.txt"&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; ;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;but the result is still the same &lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Nov 2018 16:58:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/quot-The-SAS-System-quot-printed-into-the-log-file/m-p/516798#M139619</guid>
      <dc:creator>Nasser_DRMCP</dc:creator>
      <dc:date>2018-11-28T16:58:24Z</dc:date>
    </item>
  </channel>
</rss>

