<?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: Print text in color in data _null_ step without using proc template? in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Print-text-in-color-in-data-null-step-without-using-proc/m-p/314674#M17396</link>
    <description>&lt;P&gt;There's a bug in the forum software when you click on Preview and have embedded SAS code, then edit that post.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The gist is I lost the surrounding commentary of this post, and it's not worth recreating in lieu of my follow on post.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Since I can't delete this post, here is the remnants of that post, superceded by the below post:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods escapechar='^';

data _null_;
   file print ods;
   msg="^{style[color=red font_weight=bold font_size=12pt]Testing 1,2,3}";
   put @1 msg ;
   label msg = ' ';
run;
 
data msg;
   msg1="Testing 1,2,3";
   msg2="^{style[color=red font_weight=bold font_size=12pt]Testing 1,2,3}";
run;

proc print data=msg noobs label;
   var msg2;
   label msg2='00'x; * a simple space does not work ;
run;
 
proc report data=msg noheader;
   column msg1;
   define msg1 / display style(column)={color=red font_weight=bold font_size=12pt};
run;

proc report data=msg noheader;
   column msg2;
   define msg2 / display;
run;

proc delete data=msg;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 28 Nov 2016 00:08:00 GMT</pubDate>
    <dc:creator>ScottBass</dc:creator>
    <dc:date>2016-11-28T00:08:00Z</dc:date>
    <item>
      <title>Print text in color in data _null_ step without using proc template?</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Print-text-in-color-in-data-null-step-without-using-proc/m-p/314221#M17386</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;* option 1 ;
data _null_;
   file print;
   msg="Testing 1,2,3";
   put msg;
run;

* option 2 ;
data _null_;
   file print ods;
   msg="Testing 1,2,3";
   put msg _ods_;
run;

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;SAS 9.3&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've skimmed&amp;nbsp;&lt;A href="http://www2.sas.com/proceedings/sugi30/088-30.pdf" target="_blank"&gt;http://www2.sas.com/proceedings/sugi30/088-30.pdf&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;All I want to do is print the text red bold so it stands out, and also suppress the variable name. &amp;nbsp;It's an error message in a stored process called from EG.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I suppose I could use proc template; I was hoping&amp;nbsp;I didn't have to for such a simple task.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I just want option 2 to mimic option 1, but in red bold. &amp;nbsp;I suppose centered within the current linesize would be cool too.&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;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 25 Nov 2016 07:26:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Print-text-in-color-in-data-null-step-without-using-proc/m-p/314221#M17386</guid>
      <dc:creator>ScottBass</dc:creator>
      <dc:date>2016-11-25T07:26:11Z</dc:date>
    </item>
    <item>
      <title>Re: Print text in color in data _null_ step without using proc template?</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Print-text-in-color-in-data-null-step-without-using-proc/m-p/314251#M17387</link>
      <description>&lt;P&gt;Have you tried inline formatting:&lt;/P&gt;
&lt;PRE&gt;ods escapechar='^';

data _null_;
   file print;
   put '^S={foreground=red}Testing 1,2,3';
run;
&lt;/PRE&gt;</description>
      <pubDate>Fri, 25 Nov 2016 09:45:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Print-text-in-color-in-data-null-step-without-using-proc/m-p/314251#M17387</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2016-11-25T09:45:53Z</dc:date>
    </item>
    <item>
      <title>Re: Print text in color in data _null_ step without using proc template?</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Print-text-in-color-in-data-null-step-without-using-proc/m-p/314307#M17388</link>
      <description>&lt;P&gt;Hi:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; And to modify RW9's suggestion, you can add a blank label statement to get rid of the header, but not of the area reserved for the header.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; But PROC REPORT could do it for you without a header and without a template.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;cynthia&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
ods html(id=msg1) file='c:\temp\message1.html';
ods escapechar='^';
data _null_;
   file print ods;
   msg="^{style[color=red font_weight=bold font_size=20pt]Testing 1,2,3}";
   put @1 msg ;
   label msg = ' ';
run;
ods html(id=msg1) close;
    
ods html(id=msg2) file='c:\temp\message2.html';
ods escapechar='^';
data msg;
   msg="Testing 1,2,3";
run;
  
proc report data=msg noheader;
  column msg;
  define msg / display style(column)={color=red font_weight=bold font_size=20pt};
run;
ods html(id=msg2) close;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 25 Nov 2016 14:30:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Print-text-in-color-in-data-null-step-without-using-proc/m-p/314307#M17388</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2016-11-25T14:30:05Z</dc:date>
    </item>
    <item>
      <title>Re: Print text in color in data _null_ step without using proc template?</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Print-text-in-color-in-data-null-step-without-using-proc/m-p/314674#M17396</link>
      <description>&lt;P&gt;There's a bug in the forum software when you click on Preview and have embedded SAS code, then edit that post.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The gist is I lost the surrounding commentary of this post, and it's not worth recreating in lieu of my follow on post.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Since I can't delete this post, here is the remnants of that post, superceded by the below post:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods escapechar='^';

data _null_;
   file print ods;
   msg="^{style[color=red font_weight=bold font_size=12pt]Testing 1,2,3}";
   put @1 msg ;
   label msg = ' ';
run;
 
data msg;
   msg1="Testing 1,2,3";
   msg2="^{style[color=red font_weight=bold font_size=12pt]Testing 1,2,3}";
run;

proc print data=msg noobs label;
   var msg2;
   label msg2='00'x; * a simple space does not work ;
run;
 
proc report data=msg noheader;
   column msg1;
   define msg1 / display style(column)={color=red font_weight=bold font_size=12pt};
run;

proc report data=msg noheader;
   column msg2;
   define msg2 / display;
run;

proc delete data=msg;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Nov 2016 00:08:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Print-text-in-color-in-data-null-step-without-using-proc/m-p/314674#M17396</guid>
      <dc:creator>ScottBass</dc:creator>
      <dc:date>2016-11-28T00:08:00Z</dc:date>
    </item>
    <item>
      <title>Re: Print text in color in data _null_ step without using proc template?</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Print-text-in-color-in-data-null-step-without-using-proc/m-p/314679#M17397</link>
      <description>&lt;P&gt;Further Googling led me to this usage note: &amp;nbsp;&lt;A href="http://support.sas.com/kb/23/353.html" target="_blank"&gt;http://support.sas.com/kb/23/353.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I assume there is no way to create "enhanced output" via data _null_ / file print ods without using proc template. &amp;nbsp;For my purposes, that's more effort than I want to expend to just color code an error message.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Embedding style data within the data itself does not seem to work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is some additional code, with both proc print and proc report creating enhanced output:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods escapechar='^';

data _null_;
   file print;
   msg="Testing 1,2,3";
   put msg;
run;

data _null_;
   file print ods;
   msg="^{style[color=red font_weight=bold font_size=12pt]Testing 1,2,3}";
   put @1 msg;
   label msg = '00'x;
run;
     
data msg;
   msg1="Testing 1,2,3";
   msg2="^{style[color=red font_weight=bold font_size=12pt]Testing 1,2,3}";
run;

proc print data=msg noobs label;
   var msg1 / style={color=red font_weight=bold font_size=12pt};
   label msg1='00'x; * a simple space does not work ;
run;
 
proc print data=msg noobs label;
   var msg2;
   label msg2='00'x; * a simple space does not work ;
run;
 
proc print data=msg noobs label;
   var msg2 / style={color=red font_weight=bold font_size=12pt};
   label msg2='00'x; * a simple space does not work ;
run;
 
proc report data=msg noheader;
  column msg1;
  define msg1 / display style(column)={color=red font_weight=bold font_size=12pt};
run;

proc report data=msg noheader;
  column msg2;
  define msg2 / display;
run;

proc delete data=msg;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/13198iCF2A309ACDAC8D35/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="2016-11-29_8-49-22.png" title="2016-11-29_8-49-22.png" /&gt;</description>
      <pubDate>Mon, 28 Nov 2016 21:50:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Print-text-in-color-in-data-null-step-without-using-proc/m-p/314679#M17397</guid>
      <dc:creator>ScottBass</dc:creator>
      <dc:date>2016-11-28T21:50:59Z</dc:date>
    </item>
    <item>
      <title>Re: Print text in color in data _null_ step without using proc template?</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Print-text-in-color-in-data-null-step-without-using-proc/m-p/314770#M17398</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Sorry, it wasn't clear to me what "wasn't working", the color seems to work on all those statements for me other than the first. &amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, I think you may have a misonception here. &amp;nbsp;The log file is the place for errors/warnings and such like, color coding is defined there by the use of those keywords. &amp;nbsp;Output window is for output, i.e. report/print and procedure output. &amp;nbsp;Normally this is plain text, however you can set it to HTMLwhich then has the formatting. &amp;nbsp;However that being said, if your producing output then you would find it far simpler and more robust to produce a report, than putting out bits of text there. &amp;nbsp;Its not difficult to have an errors dataset, which you insert each problem you come across into, and then at the end proc report this to a file.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Nov 2016 09:29:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Print-text-in-color-in-data-null-step-without-using-proc/m-p/314770#M17398</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2016-11-28T09:29:58Z</dc:date>
    </item>
    <item>
      <title>Re: Print text in color in data _null_ step without using proc template?</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Print-text-in-color-in-data-null-step-without-using-proc/m-p/314977#M17402</link>
      <description>&lt;P&gt;I've edited my previous post, attaching a screenshot of the results in my EG6.1M1 / SAS 9.3 environment.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for the advice regarding coding approaches. &amp;nbsp;For my particular application I am happy with my current approach - using the output window to give feedback to the end user, including error messages.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If we had SAS/AF licensed (and I had a mandate to use it), I would use it rather than EG for this particular programming task. &amp;nbsp;I could use a custom task for this but that too is not mandated by my mangement or end users.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Nov 2016 21:58:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Print-text-in-color-in-data-null-step-without-using-proc/m-p/314977#M17402</guid>
      <dc:creator>ScottBass</dc:creator>
      <dc:date>2016-11-28T21:58:44Z</dc:date>
    </item>
    <item>
      <title>Re: Print text in color in data _null_ step without using proc template?</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Print-text-in-color-in-data-null-step-without-using-proc/m-p/315125#M17406</link>
      <description>&lt;P&gt;Must be your setup/process then. &amp;nbsp;In 9.4 normal SAS it works fine. &amp;nbsp;Am afraid I don't have EG to check that. &amp;nbsp;I would really not recommend using AF, I can't think of anything more clunky/outdated than that.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Nov 2016 09:15:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Print-text-in-color-in-data-null-step-without-using-proc/m-p/315125#M17406</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2016-11-29T09:15:44Z</dc:date>
    </item>
  </channel>
</rss>

