<?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 Export proc report into XLSX -sheets names in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Export-proc-report-into-XLSX-sheets-names/m-p/935100#M367656</link>
    <description>&lt;P&gt;Hello&lt;/P&gt;
&lt;P&gt;I want to export reports to 4 XLSX sheets.&lt;/P&gt;
&lt;P&gt;Sheet1 name is "F"&lt;/P&gt;
&lt;P&gt;Sheet2 name is "M"&lt;/P&gt;
&lt;P&gt;I want that sheet3 name be "Female"&lt;/P&gt;
&lt;P&gt;and sheet4 name be "Male"&lt;/P&gt;
&lt;P&gt;However this code provide sheet 3 name "M2" and sheet4 name "M3"&lt;/P&gt;
&lt;P&gt;What is the way to&amp;nbsp; provide sheets names is I ask?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
ods excel file="/usr/local/SAS/SASUsers/LabRet/UserDir/udclk79/_Class_Report_.xlsx" ;
ods excel options (sheet_name='F');
proc report data=sashelp.class;
where sex='F';
column name age height weight;
define name / group;
run;
ods excel options (sheet_name='M');
proc report data=sashelp.class;
where sex='M';
column name age height weight;
define name / group;
run;
ods excel options (sheet_interval='bygroup');
proc sort data=sashelp.class out=class;by sex;Run;
proc report data=class;
by sex;
columns name age height weight ratio;
define name/display;
define age/display;
define weight/display;
define height/display;
define ratio/computed format=percent8.2;
compute ratio;
ratio=height/weight;
endcompute;
run;
ods excel close;

&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 09 Jul 2024 06:58:47 GMT</pubDate>
    <dc:creator>Ronein</dc:creator>
    <dc:date>2024-07-09T06:58:47Z</dc:date>
    <item>
      <title>Export proc report into XLSX -sheets names</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Export-proc-report-into-XLSX-sheets-names/m-p/935100#M367656</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;
&lt;P&gt;I want to export reports to 4 XLSX sheets.&lt;/P&gt;
&lt;P&gt;Sheet1 name is "F"&lt;/P&gt;
&lt;P&gt;Sheet2 name is "M"&lt;/P&gt;
&lt;P&gt;I want that sheet3 name be "Female"&lt;/P&gt;
&lt;P&gt;and sheet4 name be "Male"&lt;/P&gt;
&lt;P&gt;However this code provide sheet 3 name "M2" and sheet4 name "M3"&lt;/P&gt;
&lt;P&gt;What is the way to&amp;nbsp; provide sheets names is I ask?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
ods excel file="/usr/local/SAS/SASUsers/LabRet/UserDir/udclk79/_Class_Report_.xlsx" ;
ods excel options (sheet_name='F');
proc report data=sashelp.class;
where sex='F';
column name age height weight;
define name / group;
run;
ods excel options (sheet_name='M');
proc report data=sashelp.class;
where sex='M';
column name age height weight;
define name / group;
run;
ods excel options (sheet_interval='bygroup');
proc sort data=sashelp.class out=class;by sex;Run;
proc report data=class;
by sex;
columns name age height weight ratio;
define name/display;
define age/display;
define weight/display;
define height/display;
define ratio/computed format=percent8.2;
compute ratio;
ratio=height/weight;
endcompute;
run;
ods excel close;

&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 09 Jul 2024 06:58:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Export-proc-report-into-XLSX-sheets-names/m-p/935100#M367656</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2024-07-09T06:58:47Z</dc:date>
    </item>
    <item>
      <title>Re: Export proc report into XLSX -sheets names</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Export-proc-report-into-XLSX-sheets-names/m-p/935104#M367659</link>
      <description>&lt;P&gt;You need to make a new variable to contain 'Female' and 'Male ' to be used as Sheet name.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;options nobyline;

ods excel file="c:\temp\_Class_Report_.xlsx" ;
ods excel options (sheet_name='F');
proc report data=sashelp.class;
where sex='F';
column name age height weight;
define name / group;
run;
ods excel options (sheet_name='M');
proc report data=sashelp.class;
where sex='M';
column name age height weight;
define name / group;
run;

proc sort data=sashelp.class out=class;by sex;Run;
data class;set class; _sex=ifc(sex='F','Female','Male  ');run;
ods excel options (sheet_interval='bygroup' sheet_name='#byval1');
proc report data=class;
by _sex;
columns name age height weight ratio;
define name/display;
define age/display;
define weight/display;
define height/display;
define ratio/computed format=percent8.2;
compute ratio;
ratio=height/weight;
endcomp;
run;
ods excel close;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ksharp_0-1720510235428.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/98244iBD237925D7D9C976/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ksharp_0-1720510235428.png" alt="Ksharp_0-1720510235428.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jul 2024 07:30:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Export-proc-report-into-XLSX-sheets-names/m-p/935104#M367659</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2024-07-09T07:30:56Z</dc:date>
    </item>
  </channel>
</rss>

