<?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: Printing sas macro contents in output window in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Printing-sas-macro-contents-in-output-window/m-p/592847#M170038</link>
    <description>Maybe PROC ODSTEXT, but you may need a proc to trigger the output. At least ODS TEXT did. &lt;BR /&gt;&lt;BR /&gt;A workaround is to push the data to a data set and PROC PRINT/REPORT on the data set to the results viewer.</description>
    <pubDate>Mon, 30 Sep 2019 22:14:56 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2019-09-30T22:14:56Z</dc:date>
    <item>
      <title>Printing sas macro contents in output window</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Printing-sas-macro-contents-in-output-window/m-p/592844#M170036</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to figure out a way to display the contents of a macro function into the sas output window instead of the log window.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;this is just a sample, just trying to understand a concept here. I know we can use put and %put for variables and macro variables, but what can we do to display the contents of a macro function stored in a remote unix location in the output window instead of the log file. Thank you for your guidance &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below is the sample code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;options mautosource sasautos = ('unix path location for macro')  
                               nocenter source2 mlogic symbolgen mprint;

%include 'unix path location for macro/checkk.sas';

data _null_;
title 'macro details:';
put z = %checkk;
title;
run;


Details in macro checkk:

File name is checkk.sas
%macro checkk;
a=1 or b=3
%mend;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Sep 2019 22:05:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Printing-sas-macro-contents-in-output-window/m-p/592844#M170036</guid>
      <dc:creator>AJ_Brien</dc:creator>
      <dc:date>2019-09-30T22:05:04Z</dc:date>
    </item>
    <item>
      <title>Re: Printing sas macro contents in output window</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Printing-sas-macro-contents-in-output-window/m-p/592847#M170038</link>
      <description>Maybe PROC ODSTEXT, but you may need a proc to trigger the output. At least ODS TEXT did. &lt;BR /&gt;&lt;BR /&gt;A workaround is to push the data to a data set and PROC PRINT/REPORT on the data set to the results viewer.</description>
      <pubDate>Mon, 30 Sep 2019 22:14:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Printing-sas-macro-contents-in-output-window/m-p/592847#M170038</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-09-30T22:14:56Z</dc:date>
    </item>
    <item>
      <title>Re: Printing sas macro contents in output window</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Printing-sas-macro-contents-in-output-window/m-p/592857#M170043</link>
      <description>thank you for your reply.&lt;BR /&gt;&lt;BR /&gt;the macro will most likely contain a bunch of conditions, such as if %checkk then delete; will be the kind of condition used. So I'm not sure if i can push that into a dataset. I tried working around odstext, but looks like it requires 'P' to be added before each line in the macro. That will be an issue if I end up using this with multiple macros in the future.&lt;BR /&gt;&lt;BR /&gt;The main purpose of doing this exercise is to be able to see what the macro in the remote location consists of without going out of the way and opening that file through winscp or another software.</description>
      <pubDate>Mon, 30 Sep 2019 22:45:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Printing-sas-macro-contents-in-output-window/m-p/592857#M170043</guid>
      <dc:creator>AJ_Brien</dc:creator>
      <dc:date>2019-09-30T22:45:34Z</dc:date>
    </item>
    <item>
      <title>Re: Printing sas macro contents in output window</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Printing-sas-macro-contents-in-output-window/m-p/592858#M170044</link>
      <description>Sorry, I don't understand what you're trying to do then. Good Luck!</description>
      <pubDate>Mon, 30 Sep 2019 22:48:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Printing-sas-macro-contents-in-output-window/m-p/592858#M170044</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-09-30T22:48:26Z</dc:date>
    </item>
    <item>
      <title>Re: Printing sas macro contents in output window</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Printing-sas-macro-contents-in-output-window/m-p/592861#M170045</link>
      <description>&lt;P&gt;It may help if you show something that actually should create some output and what you would expect to appear in the output destination.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Since your "example" output for the data step is basically a bunch of uninitialized variables it doesn't make much sense&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And is the macro itself supposed to provide the output???&lt;/P&gt;
&lt;P&gt;I don't understand your comment about the P statement of Proc Odstext other than in that context:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If I run:&lt;/P&gt;
&lt;PRE&gt;%macro checkk;
a=1 or b=3
%mend;

proc odstext;
p "%checkk";
run;




&lt;/PRE&gt;
&lt;P&gt;The results window shows&lt;/P&gt;
&lt;PRE&gt;a=1 or b=3&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Sep 2019 23:21:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Printing-sas-macro-contents-in-output-window/m-p/592861#M170045</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-09-30T23:21:56Z</dc:date>
    </item>
    <item>
      <title>Re: Printing sas macro contents in output window</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Printing-sas-macro-contents-in-output-window/m-p/592862#M170046</link>
      <description>ah I see what you did here. This is what I was looking to see how to use. Thank you!</description>
      <pubDate>Mon, 30 Sep 2019 23:28:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Printing-sas-macro-contents-in-output-window/m-p/592862#M170046</guid>
      <dc:creator>AJ_Brien</dc:creator>
      <dc:date>2019-09-30T23:28:35Z</dc:date>
    </item>
  </channel>
</rss>

