<?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: ODS EXCEL - sheet interval options in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-EXCEL-sheet-interval-options/m-p/728546#M24927</link>
    <description>&lt;P&gt;I need to edit myself too much.&lt;/P&gt;</description>
    <pubDate>Tue, 23 Mar 2021 20:13:56 GMT</pubDate>
    <dc:creator>PhilC</dc:creator>
    <dc:date>2021-03-23T20:13:56Z</dc:date>
    <item>
      <title>ODS EXCEL - sheet interval options</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-EXCEL-sheet-interval-options/m-p/728536#M24921</link>
      <description>&lt;P&gt;Not sure if I'm missing something obvious here or if there's a bug in ODS EXCEL but this seems to generate an Excel file with two sheets for Asia and then one sheet for each other region.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;*sorts your data to use BY logic;
proc sort data=sashelp.cars out=cars;
by origin;
run;



%macro create_report(origin = );
 
 
ods excel options(sheet_interval="NOW" sheet_name = "&amp;amp;origin.");
 
*displays data in Excel sheet;
proc print data=cars;
where origin = "&amp;amp;origin.";
run;

ods excel options(sheet_interval="NONE" sheet_name = "&amp;amp;origin.");

proc sgplot data=cars;
where origin = "&amp;amp;origin.";
scatter x=mpg_city y=mpg_highway / group = type;
run;

%mend;



*removes proc title and by line which are usually printed by default;
ods noptitle;
options nobyline;
options mprint;

*sets file options - notice use of #BYVAL1 in Sheet Name to control sheet names;
ods excel file='/home/fkhurshed/ODS_Example2.xlsx' style=meadow;
 

*create list of origins to run this for;
proc sql;
create table report_list_origins as
select distinct origin
from cars;
quit;

*call macro for each origin;
data _null_;
set report_list_origins;
	str = catt('%create_report(origin=', origin, ');');
	call execute(str);
run;


*closes file;
ods excel close;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Using SAS Academics On Demand, SAS 9.4M6&lt;/P&gt;</description>
      <pubDate>Tue, 23 Mar 2021 19:44:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-EXCEL-sheet-interval-options/m-p/728536#M24921</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-03-23T19:44:29Z</dc:date>
    </item>
    <item>
      <title>Re: ODS EXCEL - sheet interval options</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-EXCEL-sheet-interval-options/m-p/728540#M24922</link>
      <description>&lt;P&gt;I dont think its a bug.&amp;nbsp; ODS EXCEL is just weird.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;*sorts your data to use BY logic;
proc sort data=sashelp.cars out=cars;
by origin;
run;

%macro create_report(origin = );

ods excel options( sheet_name = "&amp;amp;origin.");
 
*displays data in Excel sheet;
proc print data=cars;
where origin = "&amp;amp;origin.";
run;

proc sgplot data=cars;
where origin = "&amp;amp;origin.";
scatter x=mpg_city y=mpg_highway / group = type;
run;

%mend;



*removes proc title and by line which are usually printed by default;
ods noptitle;
options nobyline;
options mprint;

*sets file options - notice use of #BYVAL1 in Sheet Name to control sheet names;
ods excel file='ODS_Example2.xlsx' style=meadow options(sheet_interval="NONE");
 

*create list of origins to run this for;
proc sql;
create table report_list_origins as
select distinct origin
from cars;
quit;

*call macro for each origin;
data _null_;
set report_list_origins end=eof;
  length str $300;
	str = catt('%create_report(origin=', origin, ');');
  if eof=0
    then str=catt(str,'ods excel options(sheet_interval="NOW");');
  call execute(str);

run;


*closes file;
ods excel close;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 23 Mar 2021 20:07:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-EXCEL-sheet-interval-options/m-p/728540#M24922</guid>
      <dc:creator>PhilC</dc:creator>
      <dc:date>2021-03-23T20:07:08Z</dc:date>
    </item>
    <item>
      <title>Re: ODS EXCEL - sheet interval options</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-EXCEL-sheet-interval-options/m-p/728541#M24923</link>
      <description>&lt;P&gt;This seems to work, I moved the SHEET_INTERVAL=NOW to the end of the first set of code so it's just before the new set starts. I would have expected the code posted to work though. It almost seems like it's evaluating the ODS options statement AFTER the PROC for some reason, even though there's another options statement.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;*sorts your data to use BY logic;
proc sort data=sashelp.cars out=cars;
by origin;
run;



%macro create_report(origin = );
 
 
ods excel options( sheet_name = "&amp;amp;origin.");
 
*displays data in Excel sheet;
proc print data=cars;
where origin = "&amp;amp;origin.";
run;

ods excel options(sheet_interval="NONE" sheet_name = "&amp;amp;origin.");

proc sgplot data=cars;
where origin = "&amp;amp;origin.";
scatter x=mpg_city y=mpg_highway / group = type;
run;

ods excel options(sheet_interval="NOW" sheet_name = "&amp;amp;origin.");

%mend;



*removes proc title and by line which are usually printed by default;
ods noptitle;
options nobyline;
options mprint;

*sets file options - notice use of #BYVAL1 in Sheet Name to control sheet names;
ods excel file='/home/fkhurshed/ODS_Example2.xlsx' style=meadow options(Sheet_interval = "NONE");
 

*create list of origins to run this for;
proc sql;
create table report_list_origins as
select distinct origin
from cars;
quit;

*call macro for each origin;
data _null_;
set report_list_origins;
	str = catt('%create_report(origin=', origin, ');');
	call execute(str);
run;


*closes file;
ods excel close;


&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 23 Mar 2021 20:08:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-EXCEL-sheet-interval-options/m-p/728541#M24923</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-03-23T20:08:29Z</dc:date>
    </item>
    <item>
      <title>Re: ODS EXCEL - sheet interval options</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-EXCEL-sheet-interval-options/m-p/728542#M24924</link>
      <description>It seems like a bug to me, but I did find a workaround.&lt;BR /&gt;It almost seems like the options statement is being executed AFTER the procedure since the graph has a NONE right before it.</description>
      <pubDate>Tue, 23 Mar 2021 20:09:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-EXCEL-sheet-interval-options/m-p/728542#M24924</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-03-23T20:09:51Z</dc:date>
    </item>
    <item>
      <title>Re: ODS EXCEL - sheet interval options</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-EXCEL-sheet-interval-options/m-p/728543#M24925</link>
      <description>And thanks for the solution!</description>
      <pubDate>Tue, 23 Mar 2021 20:10:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-EXCEL-sheet-interval-options/m-p/728543#M24925</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-03-23T20:10:09Z</dc:date>
    </item>
    <item>
      <title>Re: ODS EXCEL - sheet interval options</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-EXCEL-sheet-interval-options/m-p/728544#M24926</link>
      <description>&lt;P&gt;IMO,&amp;nbsp;The first sheet_interval "NOW" had to be resolved.&amp;nbsp; I believe one handles this problem like one programs the placing of commas in a string in between items of a list.&lt;/P&gt;</description>
      <pubDate>Tue, 23 Mar 2021 20:13:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-EXCEL-sheet-interval-options/m-p/728544#M24926</guid>
      <dc:creator>PhilC</dc:creator>
      <dc:date>2021-03-23T20:13:14Z</dc:date>
    </item>
    <item>
      <title>Re: ODS EXCEL - sheet interval options</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-EXCEL-sheet-interval-options/m-p/728546#M24927</link>
      <description>&lt;P&gt;I need to edit myself too much.&lt;/P&gt;</description>
      <pubDate>Tue, 23 Mar 2021 20:13:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/ODS-EXCEL-sheet-interval-options/m-p/728546#M24927</guid>
      <dc:creator>PhilC</dc:creator>
      <dc:date>2021-03-23T20:13:56Z</dc:date>
    </item>
  </channel>
</rss>

