<?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: macro call function in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/macro-call-function/m-p/385532#M13209</link>
    <description>Thank you for your information. However, I am getting like 1,2 and 3. Actually I need to show 12,36 and 60 bins number . My code is here below. Can you please help me to obtain 12,36 and 60 instead of 1, 2 and 3 in y axis&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;%macro plot_histograms(table_name, column_name, number_of_bins, main="Main", xlabel="X Label");&lt;BR /&gt;%do j = 1 %to 3;&lt;BR /&gt;proc sgplot data=&amp;amp;table_name;&lt;BR /&gt;histogram &amp;amp;column_name / nbins=%scan(&amp;amp;number_of_bins,&amp;amp;j) ;&lt;BR /&gt;* histogram &amp;amp;column_name / nbins=%scan(&amp;amp;number_of_bins,2) ;&lt;BR /&gt;* histogram &amp;amp;column_name / nbins=%scan(&amp;amp;number_of_bins,3) ;&lt;BR /&gt;title &amp;amp;main;&lt;BR /&gt;label &amp;amp;column_name=&amp;amp;xlabel;&lt;BR /&gt;yaxis label="Frequency, bins= ";&lt;BR /&gt;run;&lt;BR /&gt;%end;&lt;BR /&gt;%mend;&lt;BR /&gt;option mprint;&lt;BR /&gt;%plot_histograms(hidalgo, y, 12 36 60 , main="1872 Hidalgo issue", xlabel="Thickness (mm)");&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Fri, 04 Aug 2017 00:17:28 GMT</pubDate>
    <dc:creator>mukeshmehata1</dc:creator>
    <dc:date>2017-08-04T00:17:28Z</dc:date>
    <item>
      <title>macro call function</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/macro-call-function/m-p/385185#M13199</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have created a macro function to&amp;nbsp;&lt;SPAN&gt;accept a table name, a column name, a list of integers, a main axis label and an x axis label. With this function I have produced 3 plots. The problem is that I need to&amp;nbsp;y-axis to read&amp;nbsp;&lt;CODE&gt;Frequency, bins =&lt;/CODE&gt;&amp;nbsp;and the number of bins.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;How can I include different bins number for different histo&amp;nbsp;plot? The logout put and histo&amp;nbsp;plot are&amp;nbsp;attached. Thanks&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 03 Aug 2017 05:36:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/macro-call-function/m-p/385185#M13199</guid>
      <dc:creator>mukeshmehata1</dc:creator>
      <dc:date>2017-08-03T05:36:23Z</dc:date>
    </item>
    <item>
      <title>Re: macro call function</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/macro-call-function/m-p/385202#M13200</link>
      <description>&lt;P&gt;Always post any information in the body of your post using the code window (its the {i} above the post), I for one will not download any files of the net. &amp;nbsp;&lt;/P&gt;
&lt;P&gt;From what I can gather from your text you have a few options for passing though the inforamtion, or you could work it out in the macro. &amp;nbsp;Either way you would need to calculate the bin information then include it in the label so maybe:&lt;/P&gt;
&lt;PRE&gt;proc sql;
  select count(bins) into :b from have;
quit;

%g (yaxis="Frequency, bins = &amp;amp;B.");&lt;/PRE&gt;</description>
      <pubDate>Thu, 03 Aug 2017 08:28:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/macro-call-function/m-p/385202#M13200</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2017-08-03T08:28:40Z</dc:date>
    </item>
    <item>
      <title>Re: macro call function</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/macro-call-function/m-p/385331#M13207</link>
      <description>&lt;P&gt;I would recommend moving from Proc Gchart to Proc SGplot.&lt;/P&gt;
&lt;P&gt;The SGPlot freq has many more types of graphs and combinations are much easier than with Gchart.&lt;/P&gt;
&lt;P&gt;For instance, Proc SGPLOT has a HISTOGRAM statement and one of the parameters is NBINS to set the number of bins to use. Then the histogram algorithm will assign values to the number requested. When you have a macro variable holding the number of bins&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;yaxis label="Frequency, bins= &amp;amp;var";&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Which might be your &amp;amp;J if I read your code correctly.&lt;/P&gt;</description>
      <pubDate>Thu, 03 Aug 2017 14:47:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/macro-call-function/m-p/385331#M13207</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-08-03T14:47:02Z</dc:date>
    </item>
    <item>
      <title>Re: macro call function</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/macro-call-function/m-p/385532#M13209</link>
      <description>Thank you for your information. However, I am getting like 1,2 and 3. Actually I need to show 12,36 and 60 bins number . My code is here below. Can you please help me to obtain 12,36 and 60 instead of 1, 2 and 3 in y axis&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;%macro plot_histograms(table_name, column_name, number_of_bins, main="Main", xlabel="X Label");&lt;BR /&gt;%do j = 1 %to 3;&lt;BR /&gt;proc sgplot data=&amp;amp;table_name;&lt;BR /&gt;histogram &amp;amp;column_name / nbins=%scan(&amp;amp;number_of_bins,&amp;amp;j) ;&lt;BR /&gt;* histogram &amp;amp;column_name / nbins=%scan(&amp;amp;number_of_bins,2) ;&lt;BR /&gt;* histogram &amp;amp;column_name / nbins=%scan(&amp;amp;number_of_bins,3) ;&lt;BR /&gt;title &amp;amp;main;&lt;BR /&gt;label &amp;amp;column_name=&amp;amp;xlabel;&lt;BR /&gt;yaxis label="Frequency, bins= ";&lt;BR /&gt;run;&lt;BR /&gt;%end;&lt;BR /&gt;%mend;&lt;BR /&gt;option mprint;&lt;BR /&gt;%plot_histograms(hidalgo, y, 12 36 60 , main="1872 Hidalgo issue", xlabel="Thickness (mm)");&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 04 Aug 2017 00:17:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/macro-call-function/m-p/385532#M13209</guid>
      <dc:creator>mukeshmehata1</dc:creator>
      <dc:date>2017-08-04T00:17:28Z</dc:date>
    </item>
    <item>
      <title>healp for custmizing ylab in sgplot</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/macro-call-function/m-p/385561#M13215</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using macro function to create 3 histo plots at once with diffrent bins value. I am getting&amp;nbsp;in ylab as&amp;nbsp;like 1,2 and 3 from my code . Actually I need to show 12,36 and 60 bins number respectively for 3 histo&amp;nbsp;. My code is here below. Can you please help me to obtain 12,36 and 60 instead of 1, 2 and 3 in y axis.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%macro plot_histograms(table_name, column_name, number_of_bins, main="Main", xlabel="X Label");&lt;/P&gt;&lt;P&gt;%do j = 1 %to 3;&lt;/P&gt;&lt;P&gt;proc sgplot data=&amp;amp;table_name;&lt;BR /&gt;histogram &amp;amp;column_name / nbins=%scan(&amp;amp;number_of_bins,&amp;amp;j) ;&lt;BR /&gt;* histogram &amp;amp;column_name / nbins=%scan(&amp;amp;number_of_bins,2) ;&lt;BR /&gt;* histogram &amp;amp;column_name / nbins=%scan(&amp;amp;number_of_bins,3) ;&lt;BR /&gt;title &amp;amp;main;&lt;BR /&gt;label &amp;amp;column_name=&amp;amp;xlabel;&lt;BR /&gt;yaxis label="Frequency, bins= ";&lt;BR /&gt;run;&lt;BR /&gt;%end;&lt;BR /&gt;%mend;&lt;BR /&gt;option mprint;&lt;BR /&gt;%plot_histograms(hidalgo, y, 12 36 60 , main="1872 Hidalgo issue", xlabel="Thickness (mm)");&lt;/P&gt;</description>
      <pubDate>Fri, 04 Aug 2017 04:22:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/macro-call-function/m-p/385561#M13215</guid>
      <dc:creator>mukeshmehata1</dc:creator>
      <dc:date>2017-08-04T04:22:56Z</dc:date>
    </item>
    <item>
      <title>Re: macro call function</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/macro-call-function/m-p/385590#M13212</link>
      <description>&lt;P&gt;Something like:&lt;/P&gt;
&lt;PRE&gt;%macro plot_histograms(table_name=,column_name=,number_of_bins=,main="Main",xlabel="X Label");
  %do j = 1 %to 3;
    proc sgplot data=&amp;amp;table_name.;
      histogram &amp;amp;column_name. / nbins=%scan(&amp;amp;number_of_bins.,&amp;amp;j.);
      title &amp;amp;main.;
      label &amp;amp;column_name.=&amp;amp;xlabel.;
      yaxis label="Frequency, bins=%scan(&amp;amp;number_of_bins.,&amp;amp;j.)";
    run;
  %end;
%mend;
option mprint;
%plot_histograms(table_name=hidalgo,column_name=y,number_of_bins=12 36 60,main="1872 Hidalgo issue",xlabel="Thickness (mm)");&lt;/PRE&gt;
&lt;P&gt;Note the use of named parameters, the code window (its the {i} above the post area to retain formatting) and finishing macro variables with a .&lt;/P&gt;</description>
      <pubDate>Fri, 04 Aug 2017 07:52:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/macro-call-function/m-p/385590#M13212</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2017-08-04T07:52:54Z</dc:date>
    </item>
    <item>
      <title>Re: healp for custmizing ylab in sgplot</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/macro-call-function/m-p/385593#M13216</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Change your YAXIS statement like so:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;yaxis label="Frequency, bins=%scan(&amp;amp;number_of_bins,&amp;amp;j)";&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 04 Aug 2017 08:07:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/macro-call-function/m-p/385593#M13216</guid>
      <dc:creator>BrunoMueller</dc:creator>
      <dc:date>2017-08-04T08:07:12Z</dc:date>
    </item>
    <item>
      <title>Re: macro call function</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/macro-call-function/m-p/385594#M13214</link>
      <description>thank you so much</description>
      <pubDate>Fri, 04 Aug 2017 08:08:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/macro-call-function/m-p/385594#M13214</guid>
      <dc:creator>mukeshmehata1</dc:creator>
      <dc:date>2017-08-04T08:08:50Z</dc:date>
    </item>
  </channel>
</rss>

