<?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 macro is not creating the graphs in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/macro-is-not-creating-the-graphs/m-p/897873#M354878</link>
    <description>&lt;P&gt;Hi All,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;this macro dosn't work not sure what is the issue.&amp;nbsp;&lt;BR /&gt;%macro create_graph(_paramn=, _param=, _avision=, _trta=, _usubjid=);&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;data _null_;&lt;BR /&gt;set all;&lt;BR /&gt;where paramn=&amp;amp;_paramn. &amp;amp; param="&amp;amp;_param." &amp;amp; avision="&amp;amp;_avision." &amp;amp; trta="&amp;amp;_trta." &amp;amp; usubjid="&amp;amp;_usubjid.";&lt;BR /&gt;call symput('Int', put(intercept, BEST6.)); &lt;BR /&gt;call symput('Slope', put(slope, BEST6.)); &lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;proc sgplot data=all noautolegend;&lt;BR /&gt;where trta="&amp;amp;_trta." &amp;amp; usubjid="&amp;amp;_usubjid."; &lt;BR /&gt;title "Regression Line with Slope and Intercept";&lt;BR /&gt;reg y=aval x=accommodation_level;&lt;BR /&gt;inset "Intercept = &amp;amp;Int" "Slope = &amp;amp;Slope" / &lt;BR /&gt;border title="Parameter Estimates" position=topleft;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;%mend;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;data test;&lt;BR /&gt;set all;&lt;BR /&gt;by paramn param avision trta usubjid NOTSORTED;&lt;BR /&gt;if first.usubjid then&lt;BR /&gt;do;&lt;BR /&gt;str=catt('%create_graph(_paramn=', paramn, ", _param=", param, &lt;BR /&gt;" , _avision=", avision, ", _trta= ", trta, ", _usubjid=", %str(usubjid), &lt;BR /&gt;');');&lt;BR /&gt;output;&lt;BR /&gt;end;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 09 Oct 2023 20:42:42 GMT</pubDate>
    <dc:creator>LOLO12</dc:creator>
    <dc:date>2023-10-09T20:42:42Z</dc:date>
    <item>
      <title>macro is not creating the graphs</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macro-is-not-creating-the-graphs/m-p/897873#M354878</link>
      <description>&lt;P&gt;Hi All,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;this macro dosn't work not sure what is the issue.&amp;nbsp;&lt;BR /&gt;%macro create_graph(_paramn=, _param=, _avision=, _trta=, _usubjid=);&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;data _null_;&lt;BR /&gt;set all;&lt;BR /&gt;where paramn=&amp;amp;_paramn. &amp;amp; param="&amp;amp;_param." &amp;amp; avision="&amp;amp;_avision." &amp;amp; trta="&amp;amp;_trta." &amp;amp; usubjid="&amp;amp;_usubjid.";&lt;BR /&gt;call symput('Int', put(intercept, BEST6.)); &lt;BR /&gt;call symput('Slope', put(slope, BEST6.)); &lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;proc sgplot data=all noautolegend;&lt;BR /&gt;where trta="&amp;amp;_trta." &amp;amp; usubjid="&amp;amp;_usubjid."; &lt;BR /&gt;title "Regression Line with Slope and Intercept";&lt;BR /&gt;reg y=aval x=accommodation_level;&lt;BR /&gt;inset "Intercept = &amp;amp;Int" "Slope = &amp;amp;Slope" / &lt;BR /&gt;border title="Parameter Estimates" position=topleft;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;%mend;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;data test;&lt;BR /&gt;set all;&lt;BR /&gt;by paramn param avision trta usubjid NOTSORTED;&lt;BR /&gt;if first.usubjid then&lt;BR /&gt;do;&lt;BR /&gt;str=catt('%create_graph(_paramn=', paramn, ", _param=", param, &lt;BR /&gt;" , _avision=", avision, ", _trta= ", trta, ", _usubjid=", %str(usubjid), &lt;BR /&gt;');');&lt;BR /&gt;output;&lt;BR /&gt;end;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Oct 2023 20:42:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macro-is-not-creating-the-graphs/m-p/897873#M354878</guid>
      <dc:creator>LOLO12</dc:creator>
      <dc:date>2023-10-09T20:42:42Z</dc:date>
    </item>
    <item>
      <title>Re: macro is not creating the graphs</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macro-is-not-creating-the-graphs/m-p/897882#M354882</link>
      <description>&lt;P&gt;what does the log say?&lt;/P&gt;</description>
      <pubDate>Mon, 09 Oct 2023 23:10:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macro-is-not-creating-the-graphs/m-p/897882#M354882</guid>
      <dc:creator>tarheel13</dc:creator>
      <dc:date>2023-10-09T23:10:39Z</dc:date>
    </item>
    <item>
      <title>Re: macro is not creating the graphs</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macro-is-not-creating-the-graphs/m-p/897887#M354883</link>
      <description>&lt;P&gt;You never call the macro in the code you posted.&lt;/P&gt;
&lt;P&gt;You define a macro.&lt;/P&gt;
&lt;P&gt;You create a dataset with a character variable that looks like perhaps it has the code to call the macro.&amp;nbsp; But you never run the code you put into the character variable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Oct 2023 23:33:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macro-is-not-creating-the-graphs/m-p/897887#M354883</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2023-10-09T23:33:37Z</dc:date>
    </item>
    <item>
      <title>Re: macro is not creating the graphs</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macro-is-not-creating-the-graphs/m-p/897955#M354915</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/270892"&gt;@LOLO12&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Did you try the code before creating the macro?&lt;BR /&gt;Have a look at this blog post&amp;nbsp;&lt;A href="https://blogs.sas.com/content/iml/2013/02/27/slope-of-a-regression-line.html" target="_blank"&gt;How to use PROC SGPLOT to display the slope and intercept of a regression line - The DO Loop (sas.com)&lt;/A&gt;&amp;nbsp;&lt;BR /&gt;This will help you understand using Proc SGPLOT do&amp;nbsp; &amp;nbsp;what you want.&lt;/P&gt;</description>
      <pubDate>Tue, 10 Oct 2023 13:30:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macro-is-not-creating-the-graphs/m-p/897955#M354915</guid>
      <dc:creator>Sajid01</dc:creator>
      <dc:date>2023-10-10T13:30:54Z</dc:date>
    </item>
  </channel>
</rss>

