<?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: How to load tables one below the other in an excel spreadsheet dynamically in SAS? in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-load-tables-one-below-the-other-in-an-excel-spreadsheet/m-p/834172#M25936</link>
    <description>&lt;P&gt;Using a macro is one way to reduce the code required.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro Make_Report (dataset = );

ODS EXCEL OPTIONS(    
						SHEET_INTERVAL 		= "NONE"
						START_AT 			= "2,10"
						EMBEDDED_TITLES 	= "NO"
						SHEET_LABEL 		= "NA"
						SHEET_NAME 			= "NA"
						ABSOLUTE_ROW_HEIGHT = "15"
						ZOOM 				= "100");

		PROC REPORT DATA= &amp;amp;dataset. NOWD; 
			COLUMN ('TABLE2'(COLUMN_A COLUMN_B COLUMN_C));
			DEFINE COLUMN_A	/ "COLUMN_A";
			DEFINE COLUMN_B / "COLUMN_B";
			DEFINE COLUMN_C	/ "COLUMN_C";
		RUN;

%mend Make_Report;

%Make_Report (dataset = WORK.TEMP);
%Make_Report (dataset = WORK.TEMP2);
%Make_Report (dataset = WORK.TEMP3);
%Make_Report (dataset = WORK.TEMP4);
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 19 Sep 2022 20:21:04 GMT</pubDate>
    <dc:creator>SASKiwi</dc:creator>
    <dc:date>2022-09-19T20:21:04Z</dc:date>
    <item>
      <title>How to load tables one below the other in an excel spreadsheet dynamically in SAS?</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-load-tables-one-below-the-other-in-an-excel-spreadsheet/m-p/834167#M25935</link>
      <description>&lt;P&gt;Hi All, I'm looking for a solution where multiple tables are loaded one below the other dynamically.&lt;/P&gt;
&lt;P&gt;Here is an Output example;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Banana19_0-1663617413594.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/75380iC34AA7110609936F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Banana19_0-1663617413594.png" alt="Banana19_0-1663617413594.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Attached is the code I used&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ODS EXCEL FILE = "&amp;amp;LOCATION/ODS_TEST1.XLSX"; 
	ODS EXCEL OPTIONS(    
						SHEET_INTERVAL 		= "NONE"
						START_AT 			= "2,2"
						EMBEDDED_TITLES 	= "NO"
						SHEET_LABEL 		= "NA"
						SHEET_NAME 			= "NA"
						ABSOLUTE_ROW_HEIGHT = "15"
						ZOOM 				= "100");

		PROC REPORT DATA=WORK.TEMP NOWD; 
			COLUMN ('TABLE1'(COLUMN_A COLUMN_B COLUMN_C));
			DEFINE COLUMN_A	/ "COLUMN_A";
			DEFINE COLUMN_B / "COLUMN_B";
			DEFINE COLUMN_C	/ "COLUMN_C";
		RUN; 

	ODS EXCEL OPTIONS(    
						SHEET_INTERVAL 		= "NONE"
						START_AT 			= "2,10"
						EMBEDDED_TITLES 	= "NO"
						SHEET_LABEL 		= "NA"
						SHEET_NAME 			= "NA"
						ABSOLUTE_ROW_HEIGHT = "15"
						ZOOM 				= "100");

		PROC REPORT DATA=WORK.TEMP2 NOWD; 
			COLUMN ('TABLE2'(COLUMN_A COLUMN_B COLUMN_C));
			DEFINE COLUMN_A	/ "COLUMN_A";
			DEFINE COLUMN_B / "COLUMN_B";
			DEFINE COLUMN_C	/ "COLUMN_C";
		RUN;

ODS EXCEL CLOSE;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;In the above code there are only 2 proc reports. As shown in O/P example, I have 4 different datasets and I only want to use the mentioned 2 proc report&amp;nbsp; codes to generate 4 different tables one below the other dynamically without adding more proc reports.&lt;/P&gt;
&lt;P&gt;It would be good if some one could help me with this issue and let me know if you need anything else.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;BD&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Sep 2022 20:07:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-load-tables-one-below-the-other-in-an-excel-spreadsheet/m-p/834167#M25935</guid>
      <dc:creator>Banana19</dc:creator>
      <dc:date>2022-09-19T20:07:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to load tables one below the other in an excel spreadsheet dynamically in SAS?</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-load-tables-one-below-the-other-in-an-excel-spreadsheet/m-p/834172#M25936</link>
      <description>&lt;P&gt;Using a macro is one way to reduce the code required.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro Make_Report (dataset = );

ODS EXCEL OPTIONS(    
						SHEET_INTERVAL 		= "NONE"
						START_AT 			= "2,10"
						EMBEDDED_TITLES 	= "NO"
						SHEET_LABEL 		= "NA"
						SHEET_NAME 			= "NA"
						ABSOLUTE_ROW_HEIGHT = "15"
						ZOOM 				= "100");

		PROC REPORT DATA= &amp;amp;dataset. NOWD; 
			COLUMN ('TABLE2'(COLUMN_A COLUMN_B COLUMN_C));
			DEFINE COLUMN_A	/ "COLUMN_A";
			DEFINE COLUMN_B / "COLUMN_B";
			DEFINE COLUMN_C	/ "COLUMN_C";
		RUN;

%mend Make_Report;

%Make_Report (dataset = WORK.TEMP);
%Make_Report (dataset = WORK.TEMP2);
%Make_Report (dataset = WORK.TEMP3);
%Make_Report (dataset = WORK.TEMP4);
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 19 Sep 2022 20:21:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-load-tables-one-below-the-other-in-an-excel-spreadsheet/m-p/834172#M25936</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2022-09-19T20:21:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to load tables one below the other in an excel spreadsheet dynamically in SAS?</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-load-tables-one-below-the-other-in-an-excel-spreadsheet/m-p/834179#M25937</link>
      <description>&lt;P&gt;Quick FYI - START_AT only works for the first table. Every reference afterwards is ignored and location is in reference to the first table.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;That being said, this is a simple layout that can be accomplished within ODS EXCEL.&lt;/P&gt;</description>
      <pubDate>Mon, 19 Sep 2022 21:24:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-load-tables-one-below-the-other-in-an-excel-spreadsheet/m-p/834179#M25937</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2022-09-19T21:24:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to load tables one below the other in an excel spreadsheet dynamically in SAS?</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-load-tables-one-below-the-other-in-an-excel-spreadsheet/m-p/834196#M25938</link>
      <description>&lt;P&gt;You need EMBEDDED_TITLES=ON since you have them shown in the sheet.&lt;/P&gt;
&lt;P&gt;Closer to what you want.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro report(n=);
 title "Report &amp;amp;n";
 proc print data=sashelp.class (obs=3) label noobs;
 var name age sex;
 run;
 
%mend;

ods excel file = '/home/fkhurshed/Demo1/demo.xlsx'  OPTIONS(    
						SHEET_INTERVAL 		= "NONE"
						EMBEDDED_TITLES 	= "ON"
						SHEET_LABEL 		= "NA"
						SHEET_NAME 			= "NA"
						ABSOLUTE_ROW_HEIGHT = "15"
						ZOOM 				= "100");
						
%report(n=1);
%report(n=2);
%report(n=3);
%report(n=4);

ods excel close;		&lt;/CODE&gt;&lt;/PRE&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/89915"&gt;@Banana19&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi All, I'm looking for a solution where multiple tables are loaded one below the other dynamically.&lt;/P&gt;
&lt;P&gt;Here is an Output example;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Banana19_0-1663617413594.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/75380iC34AA7110609936F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Banana19_0-1663617413594.png" alt="Banana19_0-1663617413594.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Attached is the code I used&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ODS EXCEL FILE = "&amp;amp;LOCATION/ODS_TEST1.XLSX"; 
	ODS EXCEL OPTIONS(    
						SHEET_INTERVAL 		= "NONE"
						START_AT 			= "2,2"
						EMBEDDED_TITLES 	= "NO"
						SHEET_LABEL 		= "NA"
						SHEET_NAME 			= "NA"
						ABSOLUTE_ROW_HEIGHT = "15"
						ZOOM 				= "100");

		PROC REPORT DATA=WORK.TEMP NOWD; 
			COLUMN ('TABLE1'(COLUMN_A COLUMN_B COLUMN_C));
			DEFINE COLUMN_A	/ "COLUMN_A";
			DEFINE COLUMN_B / "COLUMN_B";
			DEFINE COLUMN_C	/ "COLUMN_C";
		RUN; 

	ODS EXCEL OPTIONS(    
						SHEET_INTERVAL 		= "NONE"
						START_AT 			= "2,10"
						EMBEDDED_TITLES 	= "NO"
						SHEET_LABEL 		= "NA"
						SHEET_NAME 			= "NA"
						ABSOLUTE_ROW_HEIGHT = "15"
						ZOOM 				= "100");

		PROC REPORT DATA=WORK.TEMP2 NOWD; 
			COLUMN ('TABLE2'(COLUMN_A COLUMN_B COLUMN_C));
			DEFINE COLUMN_A	/ "COLUMN_A";
			DEFINE COLUMN_B / "COLUMN_B";
			DEFINE COLUMN_C	/ "COLUMN_C";
		RUN;

ODS EXCEL CLOSE;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;In the above code there are only 2 proc reports. As shown in O/P example, I have 4 different datasets and I only want to use the mentioned 2 proc report&amp;nbsp; codes to generate 4 different tables one below the other dynamically without adding more proc reports.&lt;/P&gt;
&lt;P&gt;It would be good if some one could help me with this issue and let me know if you need anything else.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;BD&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Sep 2022 23:01:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-load-tables-one-below-the-other-in-an-excel-spreadsheet/m-p/834196#M25938</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2022-09-19T23:01:11Z</dc:date>
    </item>
  </channel>
</rss>

