<?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: sgplot with empty data in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/sgplot-with-empty-data/m-p/389804#M93485</link>
    <description>&lt;PRE&gt;
You can make a MACRO:


%let dsid=%sysfunc(open(input));
%let nobs=%sysfunc(attrn(&amp;amp;dsid,nlobs));
%let dsid=%sysfunc(close(&amp;amp;dsid));

%if &amp;amp;nobs ne 0 %then %do;
  ods graphics / reset=INDEX height=5in width=6in imagefmt=png imagename="F" border=off;
  proc sgplot data=input ...........................
%end;
%else %do;
  proc sgplot data=DUMMY..............
%end;

&lt;/PRE&gt;</description>
    <pubDate>Tue, 22 Aug 2017 13:10:53 GMT</pubDate>
    <dc:creator>Ksharp</dc:creator>
    <dc:date>2017-08-22T13:10:53Z</dc:date>
    <item>
      <title>sgplot with empty data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/sgplot-with-empty-data/m-p/389557#M93403</link>
      <description>&lt;P&gt;I'm using sgplot to produce some figures. &amp;nbsp;Sometimes the input data is empty so sgplot won't produce an output figure. &amp;nbsp;However, I want to use the output figure to proc report. &amp;nbsp;If no figure&amp;nbsp;is produced, the proc report will use previous sgplot figure. &amp;nbsp;This is not I wanted.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can you output an empty figure so my proc report won't use previous figures.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for the help&lt;/P&gt;</description>
      <pubDate>Mon, 21 Aug 2017 15:29:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/sgplot-with-empty-data/m-p/389557#M93403</guid>
      <dc:creator>mmzz</dc:creator>
      <dc:date>2017-08-21T15:29:00Z</dc:date>
    </item>
    <item>
      <title>Re: sgplot with empty data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/sgplot-with-empty-data/m-p/389558#M93404</link>
      <description>&lt;BLOCKQUOTE&gt;
&lt;P&gt;However, I want to use the output figure to proc report&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;More information is needed. Do you mean "However, I want to use the output figure &lt;EM&gt;in&lt;/EM&gt; proc report"? If so, how are you doing this? Show us the parts of your code that are relevant to using an output figure&amp;nbsp;in PROC REPORT.&lt;/P&gt;</description>
      <pubDate>Mon, 21 Aug 2017 15:34:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/sgplot-with-empty-data/m-p/389558#M93404</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2017-08-21T15:34:04Z</dc:date>
    </item>
    <item>
      <title>Re: sgplot with empty data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/sgplot-with-empty-data/m-p/389560#M93405</link>
      <description>&lt;P&gt;ods listing gpath='location' ; &amp;nbsp;* store sgplot output in a folder&lt;/P&gt;&lt;P&gt;ods graphics / reset height=5in width=6in imagefmt=png imagename="F" border=off;&lt;/P&gt;&lt;P&gt;proc sgplot data=input &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;* sometimes input is empty&lt;/P&gt;&lt;P&gt;ods listing close;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data image;&lt;/P&gt;&lt;P&gt;image="location\F1.png"; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; * BTW why I delcated my figure name as F, but the output name is F1?&lt;/P&gt;&lt;P&gt;run; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; * This is where the problem occurs, if no figure output from sgplot. &amp;nbsp;it will take an old F1.png&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc report data=image&lt;/P&gt;</description>
      <pubDate>Mon, 21 Aug 2017 15:45:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/sgplot-with-empty-data/m-p/389560#M93405</guid>
      <dc:creator>mmzz</dc:creator>
      <dc:date>2017-08-21T15:45:26Z</dc:date>
    </item>
    <item>
      <title>Re: sgplot with empty data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/sgplot-with-empty-data/m-p/389564#M93408</link>
      <description>&lt;P&gt;Not sure I follow, you can put graphs and reports in a file, but you can't proc report a graph?? &amp;nbsp;If you want an empty graph if there is no data, just add a rows where there is data, but with 0,0 or whatever the lowest is so it has a point to plot.&lt;/P&gt;
&lt;PRE&gt;ods rtf file="Final.rtf";

ods graphics...;

/* If nobs is zero then create a file with one row of 0,0 */
data _null_;
  set sashelp.vtable (where=(libname="&amp;lt;yourlib&amp;gt;" and memname="&amp;lt;your ds&amp;gt;" and nobs=0));
  call execute('data  &amp;lt;yourlib&amp;gt;.&amp;lt;memname&amp;gt;; x=0; y=0; run;');
run;

proc sgplot data=&amp;lt;yourlib&amp;gt;.&amp;lt;your ds&amp;gt;...;
run;

proc report data=somethingelse...;
run;

ods rtf close;
&lt;/PRE&gt;
&lt;P&gt;Note, replace yourlib and your ds with the relevant names of your libs and datasets, for where's it should be upper case.&lt;/P&gt;</description>
      <pubDate>Mon, 21 Aug 2017 15:52:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/sgplot-with-empty-data/m-p/389564#M93408</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2017-08-21T15:52:23Z</dc:date>
    </item>
    <item>
      <title>Re: sgplot with empty data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/sgplot-with-empty-data/m-p/389804#M93485</link>
      <description>&lt;PRE&gt;
You can make a MACRO:


%let dsid=%sysfunc(open(input));
%let nobs=%sysfunc(attrn(&amp;amp;dsid,nlobs));
%let dsid=%sysfunc(close(&amp;amp;dsid));

%if &amp;amp;nobs ne 0 %then %do;
  ods graphics / reset=INDEX height=5in width=6in imagefmt=png imagename="F" border=off;
  proc sgplot data=input ...........................
%end;
%else %do;
  proc sgplot data=DUMMY..............
%end;

&lt;/PRE&gt;</description>
      <pubDate>Tue, 22 Aug 2017 13:10:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/sgplot-with-empty-data/m-p/389804#M93485</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2017-08-22T13:10:53Z</dc:date>
    </item>
  </channel>
</rss>

