<?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: appending graphs for each customer to each page in pdf in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/appending-graphs-for-each-customer-to-each-page-in-pdf/m-p/417516#M26885</link>
    <description>&lt;P&gt;I have tried this below code&amp;nbsp; with do loop , but need to find a&amp;nbsp; way on how to append the graph per page for each customer.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%MACRO GRAPH;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;%do i=1 %to &amp;amp;COUNT1. %by 1;&lt;BR /&gt;%put &amp;amp;&amp;amp;CASE_OWNER&amp;amp;i;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;options symbolgen;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;%macro delcat(catname);&lt;BR /&gt;&lt;BR /&gt;%if %sysfunc(cexist(&amp;amp;catname))&lt;BR /&gt;%then %do;&lt;BR /&gt;proc greplay nofs igout=&amp;amp;catname;&lt;BR /&gt;delete _all_;&lt;BR /&gt;run;&lt;BR /&gt;quit;&lt;BR /&gt;%end;&lt;BR /&gt;%mend delcat;&lt;BR /&gt;&lt;BR /&gt;%delcat(work.gseg)&lt;/P&gt;&lt;P&gt;%let outdir=%trim(%sysfunc(pathname(work)));&lt;/P&gt;&lt;P&gt;options orientation=landscape nodate nonumber;&lt;/P&gt;&lt;P&gt;goptions reset=all;&lt;BR /&gt;title 5 'Graph for &amp;amp;&amp;amp;CASE_OWNER&amp;amp;i';&lt;/P&gt;&lt;P&gt;/* This step uses multiple PROC SGPLOT procedures */&lt;BR /&gt;/* to write multiple PNG files to disk. Note that */&lt;BR /&gt;/* this step uses the IMAGENAME= option on the ODS */&lt;BR /&gt;/* GRAPHICS ON statement to name each PNG file */&lt;BR /&gt;/* that is written to disk. */&lt;/P&gt;&lt;P&gt;ods _all_ close;&lt;BR /&gt;ods listing gpath="&amp;amp;outdir" image_dpi=300;&lt;/P&gt;&lt;P&gt;ods graphics on / reset=index imagename='sgplot1'&lt;BR /&gt;width=5in height=3.8in;&lt;/P&gt;&lt;P&gt;title1 'First SGPLOT Output';&lt;BR /&gt;proc sgplot data=final_v3;&lt;BR /&gt;title 'Active Status by Month Created';&lt;BR /&gt;vbar CREATED_MONTH / group=REALTIME_OPEN_CASESTATUS groupdisplay=cluster dataskin=gloss;&lt;BR /&gt;where case_owner=&amp;amp;&amp;amp;CASE_OWNER&amp;amp;i;&lt;BR /&gt;xaxis display=(nolabel);&lt;BR /&gt;yaxis grid;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;ods graphics on / reset=index imagename='sgplot2'&lt;BR /&gt;width=5in height=3.8in;&lt;/P&gt;&lt;P&gt;title1 'Second SGPLOT Output';&lt;BR /&gt;proc sgplot data=final_v3;&lt;BR /&gt;title 'Case Status by Created Month';&lt;BR /&gt;vbar CREATED_MONTH / group=STATUS groupdisplay=cluster dataskin=gloss;&lt;BR /&gt;where case_owner=&amp;amp;I;&lt;BR /&gt;xaxis display=(nolabel);&lt;BR /&gt;yaxis grid;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;ods graphics on / reset=index imagename='sgplot3'&lt;BR /&gt;width=5in height=3.8in;&lt;/P&gt;&lt;P&gt;title1 'Third SGPLOT Output';&lt;/P&gt;&lt;P&gt;proc sgplot data=final_v3;&lt;BR /&gt;title 'Case Reason Distribution';&lt;BR /&gt;vbar CASE_REASON / group=REALTIME_OPEN_CASESTATUS groupdisplay=cluster dataskin=gloss;&lt;BR /&gt;where case_owner=&amp;amp;I;&lt;BR /&gt;xaxis display=(nolabel);&lt;BR /&gt;yaxis grid;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;/*ods graphics on / reset=index imagename='sgplot4' */&lt;BR /&gt;/* width=5in height=3.8in;*/&lt;BR /&gt;/**/&lt;BR /&gt;/*title1 'Fourth SGPLOT Output';*/&lt;BR /&gt;/*proc sgplot data=sashelp.class; */&lt;BR /&gt;/* vbar age / response=height stat=mean; */&lt;BR /&gt;/* where sex="M"; */&lt;BR /&gt;/*run; */&lt;/P&gt;&lt;P&gt;ods listing;&lt;BR /&gt;&lt;BR /&gt;/* This step uses PROC GSLIDE with the IBACK= and */&lt;BR /&gt;/* IMAGESTYLE= graphics options to read the PNG */&lt;BR /&gt;/* files created in step 1 back into SAS. */&lt;BR /&gt;goptions reset=all device=png300 nodisplay&lt;BR /&gt;xmax=5in ymax=3.8in;&lt;/P&gt;&lt;P&gt;goptions iback="&amp;amp;outdir./sgplot1.png" imagestyle=fit;&lt;BR /&gt;proc gslide;&lt;BR /&gt;run;&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;goptions iback="&amp;amp;outdir./sgplot2.png" imagestyle=fit;&lt;BR /&gt;proc gslide;&lt;BR /&gt;run;&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;goptions iback="&amp;amp;outdir./sgplot3.png" imagestyle=fit;&lt;BR /&gt;proc gslide;&lt;BR /&gt;run;&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;/*goptions iback="&amp;amp;outdir./sgplot4.png" imagestyle=fit; */&lt;BR /&gt;/*proc gslide; */&lt;BR /&gt;/*run;*/&lt;BR /&gt;/*quit;*/&lt;/P&gt;&lt;P&gt;/* This final step uses PROC GREPLAY to put four */&lt;BR /&gt;/* SGPLOT outputs on the same PDF page. */&lt;BR /&gt;goptions reset=all device=sasprtc;&lt;/P&gt;&lt;P&gt;ods listing close;&lt;BR /&gt;ods pdf file="&amp;amp;outdir./greplay_sgplot.pdf" notoc dpi=300;&lt;/P&gt;&lt;P&gt;proc greplay igout=work.gseg nofs tc=sashelp.templt&lt;BR /&gt;template= U2D1;&lt;BR /&gt;treplay 1:1 2:3 3:2 ;&lt;BR /&gt;run;&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;ods pdf close;&lt;BR /&gt;ods listing;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;%END;&lt;/P&gt;&lt;P&gt;%MEND GRAPH;&lt;/P&gt;&lt;P&gt;%GRAPH;&lt;/P&gt;</description>
    <pubDate>Thu, 30 Nov 2017 18:52:48 GMT</pubDate>
    <dc:creator>Deepti44</dc:creator>
    <dc:date>2017-11-30T18:52:48Z</dc:date>
    <item>
      <title>appending graphs for each customer to each page in pdf</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/appending-graphs-for-each-customer-to-each-page-in-pdf/m-p/417513#M26883</link>
      <description>&lt;P&gt;SAS Experts&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have&amp;nbsp; around 3 graphs created in each page for each customer, now i have around 25 customers where i need to create 3 graphs per page per customer.I tried to use do loops but it is not working.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can i know how to append the graphs to each individual page ( 3 graphs Per page) per customer.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Appreciate your help on this.&lt;/P&gt;</description>
      <pubDate>Thu, 30 Nov 2017 18:44:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/appending-graphs-for-each-customer-to-each-page-in-pdf/m-p/417513#M26883</guid>
      <dc:creator>Deepti44</dc:creator>
      <dc:date>2017-11-30T18:44:51Z</dc:date>
    </item>
    <item>
      <title>Re: appending graphs for each customer to each page in pdf</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/appending-graphs-for-each-customer-to-each-page-in-pdf/m-p/417514#M26884</link>
      <description>&lt;P&gt;Post what you've tried so far. Maybe you're really close.&lt;/P&gt;</description>
      <pubDate>Thu, 30 Nov 2017 18:46:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/appending-graphs-for-each-customer-to-each-page-in-pdf/m-p/417514#M26884</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-11-30T18:46:44Z</dc:date>
    </item>
    <item>
      <title>Re: appending graphs for each customer to each page in pdf</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/appending-graphs-for-each-customer-to-each-page-in-pdf/m-p/417516#M26885</link>
      <description>&lt;P&gt;I have tried this below code&amp;nbsp; with do loop , but need to find a&amp;nbsp; way on how to append the graph per page for each customer.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%MACRO GRAPH;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;%do i=1 %to &amp;amp;COUNT1. %by 1;&lt;BR /&gt;%put &amp;amp;&amp;amp;CASE_OWNER&amp;amp;i;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;options symbolgen;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;%macro delcat(catname);&lt;BR /&gt;&lt;BR /&gt;%if %sysfunc(cexist(&amp;amp;catname))&lt;BR /&gt;%then %do;&lt;BR /&gt;proc greplay nofs igout=&amp;amp;catname;&lt;BR /&gt;delete _all_;&lt;BR /&gt;run;&lt;BR /&gt;quit;&lt;BR /&gt;%end;&lt;BR /&gt;%mend delcat;&lt;BR /&gt;&lt;BR /&gt;%delcat(work.gseg)&lt;/P&gt;&lt;P&gt;%let outdir=%trim(%sysfunc(pathname(work)));&lt;/P&gt;&lt;P&gt;options orientation=landscape nodate nonumber;&lt;/P&gt;&lt;P&gt;goptions reset=all;&lt;BR /&gt;title 5 'Graph for &amp;amp;&amp;amp;CASE_OWNER&amp;amp;i';&lt;/P&gt;&lt;P&gt;/* This step uses multiple PROC SGPLOT procedures */&lt;BR /&gt;/* to write multiple PNG files to disk. Note that */&lt;BR /&gt;/* this step uses the IMAGENAME= option on the ODS */&lt;BR /&gt;/* GRAPHICS ON statement to name each PNG file */&lt;BR /&gt;/* that is written to disk. */&lt;/P&gt;&lt;P&gt;ods _all_ close;&lt;BR /&gt;ods listing gpath="&amp;amp;outdir" image_dpi=300;&lt;/P&gt;&lt;P&gt;ods graphics on / reset=index imagename='sgplot1'&lt;BR /&gt;width=5in height=3.8in;&lt;/P&gt;&lt;P&gt;title1 'First SGPLOT Output';&lt;BR /&gt;proc sgplot data=final_v3;&lt;BR /&gt;title 'Active Status by Month Created';&lt;BR /&gt;vbar CREATED_MONTH / group=REALTIME_OPEN_CASESTATUS groupdisplay=cluster dataskin=gloss;&lt;BR /&gt;where case_owner=&amp;amp;&amp;amp;CASE_OWNER&amp;amp;i;&lt;BR /&gt;xaxis display=(nolabel);&lt;BR /&gt;yaxis grid;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;ods graphics on / reset=index imagename='sgplot2'&lt;BR /&gt;width=5in height=3.8in;&lt;/P&gt;&lt;P&gt;title1 'Second SGPLOT Output';&lt;BR /&gt;proc sgplot data=final_v3;&lt;BR /&gt;title 'Case Status by Created Month';&lt;BR /&gt;vbar CREATED_MONTH / group=STATUS groupdisplay=cluster dataskin=gloss;&lt;BR /&gt;where case_owner=&amp;amp;I;&lt;BR /&gt;xaxis display=(nolabel);&lt;BR /&gt;yaxis grid;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;ods graphics on / reset=index imagename='sgplot3'&lt;BR /&gt;width=5in height=3.8in;&lt;/P&gt;&lt;P&gt;title1 'Third SGPLOT Output';&lt;/P&gt;&lt;P&gt;proc sgplot data=final_v3;&lt;BR /&gt;title 'Case Reason Distribution';&lt;BR /&gt;vbar CASE_REASON / group=REALTIME_OPEN_CASESTATUS groupdisplay=cluster dataskin=gloss;&lt;BR /&gt;where case_owner=&amp;amp;I;&lt;BR /&gt;xaxis display=(nolabel);&lt;BR /&gt;yaxis grid;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;/*ods graphics on / reset=index imagename='sgplot4' */&lt;BR /&gt;/* width=5in height=3.8in;*/&lt;BR /&gt;/**/&lt;BR /&gt;/*title1 'Fourth SGPLOT Output';*/&lt;BR /&gt;/*proc sgplot data=sashelp.class; */&lt;BR /&gt;/* vbar age / response=height stat=mean; */&lt;BR /&gt;/* where sex="M"; */&lt;BR /&gt;/*run; */&lt;/P&gt;&lt;P&gt;ods listing;&lt;BR /&gt;&lt;BR /&gt;/* This step uses PROC GSLIDE with the IBACK= and */&lt;BR /&gt;/* IMAGESTYLE= graphics options to read the PNG */&lt;BR /&gt;/* files created in step 1 back into SAS. */&lt;BR /&gt;goptions reset=all device=png300 nodisplay&lt;BR /&gt;xmax=5in ymax=3.8in;&lt;/P&gt;&lt;P&gt;goptions iback="&amp;amp;outdir./sgplot1.png" imagestyle=fit;&lt;BR /&gt;proc gslide;&lt;BR /&gt;run;&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;goptions iback="&amp;amp;outdir./sgplot2.png" imagestyle=fit;&lt;BR /&gt;proc gslide;&lt;BR /&gt;run;&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;goptions iback="&amp;amp;outdir./sgplot3.png" imagestyle=fit;&lt;BR /&gt;proc gslide;&lt;BR /&gt;run;&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;/*goptions iback="&amp;amp;outdir./sgplot4.png" imagestyle=fit; */&lt;BR /&gt;/*proc gslide; */&lt;BR /&gt;/*run;*/&lt;BR /&gt;/*quit;*/&lt;/P&gt;&lt;P&gt;/* This final step uses PROC GREPLAY to put four */&lt;BR /&gt;/* SGPLOT outputs on the same PDF page. */&lt;BR /&gt;goptions reset=all device=sasprtc;&lt;/P&gt;&lt;P&gt;ods listing close;&lt;BR /&gt;ods pdf file="&amp;amp;outdir./greplay_sgplot.pdf" notoc dpi=300;&lt;/P&gt;&lt;P&gt;proc greplay igout=work.gseg nofs tc=sashelp.templt&lt;BR /&gt;template= U2D1;&lt;BR /&gt;treplay 1:1 2:3 3:2 ;&lt;BR /&gt;run;&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;ods pdf close;&lt;BR /&gt;ods listing;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;%END;&lt;/P&gt;&lt;P&gt;%MEND GRAPH;&lt;/P&gt;&lt;P&gt;%GRAPH;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Nov 2017 18:52:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/appending-graphs-for-each-customer-to-each-page-in-pdf/m-p/417516#M26885</guid>
      <dc:creator>Deepti44</dc:creator>
      <dc:date>2017-11-30T18:52:48Z</dc:date>
    </item>
    <item>
      <title>Re: appending graphs for each customer to each page in pdf</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/appending-graphs-for-each-customer-to-each-page-in-pdf/m-p/417533#M26888</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You should start with working code for one customer and then create the macro from there ideally.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Add a WHERE statement to filter each plot for each customer&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then add another loop to create the graphs for each customer. This assumes your previous loop works and was doing something specific.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Make sure the ODS PDF statement has the customer ID in it as well, to generate a new file for each customer.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Nov 2017 19:51:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/appending-graphs-for-each-customer-to-each-page-in-pdf/m-p/417533#M26888</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-11-30T19:51:40Z</dc:date>
    </item>
  </channel>
</rss>

