<?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: how to create boxplot referencing multiple variables of a %let statement in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/how-to-create-boxplot-referencing-multiple-variables-of-a-let/m-p/842504#M36527</link>
    <description>&lt;P&gt;Thank you for the help. Actually, I have already run this code for singular variables and it works&lt;/P&gt;</description>
    <pubDate>Fri, 04 Nov 2022 13:58:17 GMT</pubDate>
    <dc:creator>ari2495</dc:creator>
    <dc:date>2022-11-04T13:58:17Z</dc:date>
    <item>
      <title>how to create boxplot referencing multiple variables of a %let statement</title>
      <link>https://communities.sas.com/t5/New-SAS-User/how-to-create-boxplot-referencing-multiple-variables-of-a-let/m-p/842502#M36525</link>
      <description>&lt;P&gt;Hi! I run my code correctly, the i created a macro with let statement, and the other commands work. The only one which does not work is boxplot. please, help is welcome.&lt;/P&gt;&lt;P&gt;here is the code&lt;/P&gt;&lt;P&gt;proc import&lt;BR /&gt;datafile="file"&lt;BR /&gt;dbms= xlsx&lt;BR /&gt;out=pdrating;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;/*macro*/&lt;BR /&gt;%let vars= mean_PD loss_days;&lt;/P&gt;&lt;P&gt;/*proc freq variabili */&lt;/P&gt;&lt;P&gt;proc freq data=pdrating;&lt;BR /&gt;tables &amp;amp;vars./missing;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;/*Boxplot verticale e orizzontale*/&lt;/P&gt;&lt;P&gt;proc sgplot data= pdrating;&lt;BR /&gt;vbox &amp;amp;vars.;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;here's log:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ari2495_0-1667569751256.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/76941iC8275D7258ADB58E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ari2495_0-1667569751256.png" alt="ari2495_0-1667569751256.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;what is the error of the second variable about?&lt;/P&gt;</description>
      <pubDate>Fri, 04 Nov 2022 13:49:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/how-to-create-boxplot-referencing-multiple-variables-of-a-let/m-p/842502#M36525</guid>
      <dc:creator>ari2495</dc:creator>
      <dc:date>2022-11-04T13:49:49Z</dc:date>
    </item>
    <item>
      <title>Re: how to create boxplot referencing multiple variables of a %let statement</title>
      <link>https://communities.sas.com/t5/New-SAS-User/how-to-create-boxplot-referencing-multiple-variables-of-a-let/m-p/842503#M36526</link>
      <description>&lt;P&gt;Unlike the TABLES statement in PROC FREQ, the VBOX statement in PROC SGPLOT only accepts ONE variable.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/grstatproc/n1waawwbez01ppn15dn9ehmxzihf.htm" target="_blank"&gt;https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/grstatproc/n1waawwbez01ppn15dn9ehmxzihf.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You could try issue multiple VBOX statements?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Get the actual SAS code working without macro logic first.&amp;nbsp; Then figure out how to get the macro to generate that code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So what PROC SGPLOT code do you want to run when you have multiple analysis variables?&lt;/P&gt;</description>
      <pubDate>Fri, 04 Nov 2022 13:55:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/how-to-create-boxplot-referencing-multiple-variables-of-a-let/m-p/842503#M36526</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2022-11-04T13:55:01Z</dc:date>
    </item>
    <item>
      <title>Re: how to create boxplot referencing multiple variables of a %let statement</title>
      <link>https://communities.sas.com/t5/New-SAS-User/how-to-create-boxplot-referencing-multiple-variables-of-a-let/m-p/842504#M36527</link>
      <description>&lt;P&gt;Thank you for the help. Actually, I have already run this code for singular variables and it works&lt;/P&gt;</description>
      <pubDate>Fri, 04 Nov 2022 13:58:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/how-to-create-boxplot-referencing-multiple-variables-of-a-let/m-p/842504#M36527</guid>
      <dc:creator>ari2495</dc:creator>
      <dc:date>2022-11-04T13:58:17Z</dc:date>
    </item>
    <item>
      <title>Re: how to create boxplot referencing multiple variables of a %let statement</title>
      <link>https://communities.sas.com/t5/New-SAS-User/how-to-create-boxplot-referencing-multiple-variables-of-a-let/m-p/842519#M36528</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/436841"&gt;@ari2495&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Thank you for the help. Actually, I have already run this code for singular variables and it works&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Like I said, try creating the PROC SGPLOT code manually first.&amp;nbsp; Once you have code that works then you can see how to get the macro to generate it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So if you have a macro variable named VARS you and want to do something with each name in the list you would use code like this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%do index=1 %to %sysfunc(countw(&amp;amp;vars,%str( )));
   %let varname=%scan(&amp;amp;vars,&amp;amp;index,%str( ));
.... code that uses &amp;amp;VARNAME ....
%end;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 04 Nov 2022 14:50:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/how-to-create-boxplot-referencing-multiple-variables-of-a-let/m-p/842519#M36528</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2022-11-04T14:50:26Z</dc:date>
    </item>
    <item>
      <title>Re: how to create boxplot referencing multiple variables of a %let statement</title>
      <link>https://communities.sas.com/t5/New-SAS-User/how-to-create-boxplot-referencing-multiple-variables-of-a-let/m-p/842549#M36529</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/436841"&gt;@ari2495&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Thank you for the help. Actually, I have already run this code for singular variables and it works&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;And did you try it for multiple variables or not?&lt;BR /&gt;Does something like this do what you want?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sgplot data=sashelp.class;
  vbox age;
  vbox height;
run;
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Or do you want something like this instead?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sgplot data=sashelp.class;
  vbox age;
run;
  vbox height;
run;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 04 Nov 2022 18:24:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/how-to-create-boxplot-referencing-multiple-variables-of-a-let/m-p/842549#M36529</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2022-11-04T18:24:11Z</dc:date>
    </item>
    <item>
      <title>Re: how to create boxplot referencing multiple variables of a %let statement</title>
      <link>https://communities.sas.com/t5/New-SAS-User/how-to-create-boxplot-referencing-multiple-variables-of-a-let/m-p/842832#M36543</link>
      <description>&lt;PRE class=""&gt;&lt;CODE&gt;proc sgplot data=sashelp.class;
  vbox age;
  vbox height;
run;
quit;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;this one does not work for me because I need a code that generates a single boxplot for every single variable.&lt;/P&gt;&lt;PRE class=""&gt;&lt;CODE&gt;proc sgplot data=sashelp.class;
  vbox age;
run;
  vbox height;
run;
quit;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;with regard to this one, I run this too but it only gave me boxplot for age variable.&lt;/P&gt;</description>
      <pubDate>Mon, 07 Nov 2022 09:18:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/how-to-create-boxplot-referencing-multiple-variables-of-a-let/m-p/842832#M36543</guid>
      <dc:creator>ari2495</dc:creator>
      <dc:date>2022-11-07T09:18:43Z</dc:date>
    </item>
    <item>
      <title>Re: how to create boxplot referencing multiple variables of a %let statement</title>
      <link>https://communities.sas.com/t5/New-SAS-User/how-to-create-boxplot-referencing-multiple-variables-of-a-let/m-p/842858#M36544</link>
      <description>&lt;P&gt;So did you try a separate PROC step for each one?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sgplot data=sashelp.class;
  vbox age;
run;
proc sgplot data=sashelp.class;
  vbox height;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 07 Nov 2022 13:47:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/how-to-create-boxplot-referencing-multiple-variables-of-a-let/m-p/842858#M36544</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2022-11-07T13:47:06Z</dc:date>
    </item>
    <item>
      <title>Re: how to create boxplot referencing multiple variables of a %let statement</title>
      <link>https://communities.sas.com/t5/New-SAS-User/how-to-create-boxplot-referencing-multiple-variables-of-a-let/m-p/842862#M36545</link>
      <description>yes and it worked but I need an automatized code</description>
      <pubDate>Mon, 07 Nov 2022 14:02:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/how-to-create-boxplot-referencing-multiple-variables-of-a-let/m-p/842862#M36545</guid>
      <dc:creator>ari2495</dc:creator>
      <dc:date>2022-11-07T14:02:51Z</dc:date>
    </item>
    <item>
      <title>Re: how to create boxplot referencing multiple variables of a %let statement</title>
      <link>https://communities.sas.com/t5/New-SAS-User/how-to-create-boxplot-referencing-multiple-variables-of-a-let/m-p/842865#M36546</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/436841"&gt;@ari2495&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;yes and it worked but I need an automatized code&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;This was already posted by&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159"&gt;@Tom&lt;/a&gt;&amp;nbsp;earlier in this thread at&amp;nbsp;&lt;A href="https://communities.sas.com/t5/New-SAS-User/how-to-create-boxplot-referencing-multiple-variables-of-a-let/m-p/842519#M36528" target="_blank" rel="noopener"&gt;https://communities.sas.com/t5/New-SAS-User/how-to-create-boxplot-referencing-multiple-variables-of-a-let/m-p/842519#M36528&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Nov 2022 14:12:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/how-to-create-boxplot-referencing-multiple-variables-of-a-let/m-p/842865#M36546</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-11-07T14:12:06Z</dc:date>
    </item>
  </channel>
</rss>

