<?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: Extract single plots from proc irt output as .png files in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/Extract-single-plots-from-proc-irt-output-as-png-files/m-p/827313#M23080</link>
    <description>&lt;P&gt;That worked just perfectly even though the .png files have not the same names as the variable names. But that will not be a big deal to fix. Thank you so much Reeza!&lt;/P&gt;</description>
    <pubDate>Fri, 05 Aug 2022 09:00:49 GMT</pubDate>
    <dc:creator>_Manhattan</dc:creator>
    <dc:date>2022-08-05T09:00:49Z</dc:date>
    <item>
      <title>Extract single plots from proc irt output as .png files</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Extract-single-plots-from-proc-irt-output-as-png-files/m-p/827126#M23072</link>
      <description>&lt;P&gt;Dear community,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to extract single plots from my proc irt output as .png files. Best case scenario would be to save the plots under the same name as the variable names in a folder on my computer (so that there is a folder with the png files and with the varnames (var1 var2 var3) --&amp;gt; see example screenshot). I attached some example code and data to generate the wanted plots. Does anyone know how to do this? It seems to be quite simple, but I did not manage to find a solution yet.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kind regards,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Jakob&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;proc import datafile="J:/Learning SAS/SmallIRT.xls"
        out=SIRT
        dbms=xls
        replace;
run;


ods graphics on;
proc irt data=SIRT resfunc=rasch plots=icc(unpack); 
run;
ods graphics off;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="example screenshots.JPG" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/74131i25F5F963E9406E09/image-size/medium?v=v2&amp;amp;px=400" role="button" title="example screenshots.JPG" alt="example screenshots.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Aug 2022 14:01:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Extract-single-plots-from-proc-irt-output-as-png-files/m-p/827126#M23072</guid>
      <dc:creator>_Manhattan</dc:creator>
      <dc:date>2022-08-04T14:01:49Z</dc:date>
    </item>
    <item>
      <title>Re: Extract single plots from proc irt output as .png files</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Extract-single-plots-from-proc-irt-output-as-png-files/m-p/827153#M23076</link>
      <description>&lt;P&gt;Not sure if there's an easier method, but if you pipe the output to an HTML file it will generate the PNG that the HTML file links to in a specified folder.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Something like this (tested) - images are in the GPATH specified folder:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods html body='/home/fkhurshed/Demo1/example.html' gpath='/home/fkhurshed/Demo1/Reports/';
ods graphics on;
proc irt data=IrtUni link=probit resfunc=graded plots=icc(unpack);
   var item1-item8;
   model item1-item4/resfunc=twop, item5-item8/resfunc=graded;
run;
ods html close;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 04 Aug 2022 15:57:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Extract-single-plots-from-proc-irt-output-as-png-files/m-p/827153#M23076</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2022-08-04T15:57:44Z</dc:date>
    </item>
    <item>
      <title>Re: Extract single plots from proc irt output as .png files</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Extract-single-plots-from-proc-irt-output-as-png-files/m-p/827313#M23080</link>
      <description>&lt;P&gt;That worked just perfectly even though the .png files have not the same names as the variable names. But that will not be a big deal to fix. Thank you so much Reeza!&lt;/P&gt;</description>
      <pubDate>Fri, 05 Aug 2022 09:00:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Extract-single-plots-from-proc-irt-output-as-png-files/m-p/827313#M23080</guid>
      <dc:creator>_Manhattan</dc:creator>
      <dc:date>2022-08-05T09:00:49Z</dc:date>
    </item>
    <item>
      <title>Re: Extract single plots from proc irt output as .png files</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Extract-single-plots-from-proc-irt-output-as-png-files/m-p/827317#M23081</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/418960"&gt;@_Manhattan&lt;/a&gt;,&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/418960"&gt;@_Manhattan&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;That worked just perfectly even though the .png files have not the same names as the variable names. But that will not be a big deal to fix.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Exactly. If needed, the renaming could be automated based on the HTML file, as it contains lines starting like&lt;/P&gt;
&lt;PRE&gt;&amp;lt;img alt="&lt;STRONG&gt;var1&lt;/STRONG&gt;" src="/home/fkhurshed/Demo1/Reports/&lt;STRONG&gt;ItemCharCurve1.png&lt;/STRONG&gt;" &lt;/PRE&gt;
&lt;P&gt;i.e., providing the relevant information: variable name and full path of the corresponding PNG file. This information could be retrieved in a DATA step and used, e.g., in an &lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/lestmtsglobal/p11ba12uypvfazn1jk7acffuzlbl.htm" target="_blank" rel="noopener"&gt;X statement&lt;/A&gt; to submit a rename command to the operating system.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm surprised that there doesn't seem to be an easier way to achieve your goal because naming the PNG files after the analysis variables seems quite natural, not only in PROC IRT, but in virtually all other statistical procedures producing ODS graphics as well. Yet, as far as I see, SAS currently offers only limited naming options:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;A "&lt;SPAN&gt;base image file name&lt;/SPAN&gt;" can be specified in the IMAGENAME= option of the &lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/odsug/p0kroq43yu0lspn16hk1u4c65lti.htm" target="_blank" rel="noopener"&gt;ODS GRAPHICS statement&lt;/A&gt; and this name would be suffixed automatically with an "index counter" (whose start value can be defined in the RESET= option). See section &lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/odsug/p0kroq43yu0lspn16hk1u4c65lti.htm#n0khp63r0z8rxen12nu04qizd0hg" target="_blank" rel="noopener"&gt;Specifying and Resetting the Image Name&lt;/A&gt; of the documentation. This might work for your&amp;nbsp;&lt;FONT face="courier new,courier"&gt;var1&lt;/FONT&gt;, &lt;FONT face="courier new,courier"&gt;var2&lt;/FONT&gt;, &lt;FONT face="courier new,courier"&gt;var3&lt;/FONT&gt;, but not for arbitrary variable names.&lt;/LI&gt;
&lt;LI&gt;Only since SAS 9.4M5 there is an additional option: using &lt;EM&gt;BY-variable&lt;/EM&gt; names and values in the image file name (see&amp;nbsp;&lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/odsug/p0kroq43yu0lspn16hk1u4c65lti.htm#n0drluxi0h55rvn196twk01sq1yc" target="_blank" rel="noopener"&gt;Substituting BY Line Values in the Image Name&lt;/A&gt;). But this doesn't apply to your PROC IRT step, which doesn't contain a BY statement.&lt;/LI&gt;
&lt;/OL&gt;</description>
      <pubDate>Fri, 05 Aug 2022 10:12:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Extract-single-plots-from-proc-irt-output-as-png-files/m-p/827317#M23081</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2022-08-05T10:12:43Z</dc:date>
    </item>
    <item>
      <title>Re: Extract single plots from proc irt output as .png files</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Extract-single-plots-from-proc-irt-output-as-png-files/m-p/827331#M23082</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods listing gpath='c:\temp\a\'  style=htmlblue;
ods graphics on;
proc logistic data=sashelp.class plots=all;
model sex=weight height;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 05 Aug 2022 12:02:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Extract-single-plots-from-proc-irt-output-as-png-files/m-p/827331#M23082</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2022-08-05T12:02:27Z</dc:date>
    </item>
  </channel>
</rss>

