<?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: Changing EXCEL output in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Changing-EXCEL-output/m-p/805863#M25679</link>
    <description>&lt;P&gt;The problem is that I need this to basically show up on one page.&amp;nbsp;&lt;/P&gt;&lt;P&gt;So instead of one row with 33 variables I would need like 8 rows with 4 variables and one row of 1.&lt;/P&gt;</description>
    <pubDate>Mon, 04 Apr 2022 14:35:57 GMT</pubDate>
    <dc:creator>DanielQuay</dc:creator>
    <dc:date>2022-04-04T14:35:57Z</dc:date>
    <item>
      <title>Changing EXCEL output</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Changing-EXCEL-output/m-p/805852#M25677</link>
      <description>&lt;P&gt;Hello All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So I have a lot of variables that I am needing to print out using a BY variable.&lt;/P&gt;&lt;P&gt;The problem is that when it goes to the Excel file, I wind up with a single row that is going from A to EQ.&lt;/P&gt;&lt;P&gt;I'd rather have this print as columns or like, A - G then go down a row and repeat.&lt;/P&gt;&lt;P&gt;I've been trying to research this but I haven't found the solution yet.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Here is my code (abbreviated):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ods excel file="H:\PAMR Program\SAS Codes\Certificate Data\Birth Certificate Data_&amp;amp;sysdate..xlsx" ;&lt;BR /&gt;proc print data = PAMR_CERT noobs;&lt;BR /&gt;var &amp;nbsp;nchsap5 nchsap10 livedep brefed ctrans ctranslit forcep&lt;BR /&gt;vacuum fetpres delroute trial vent surf seiz ventl6 nicuadm newbanti bthinj nchs_abcond&lt;BR /&gt;anenc cyanotic omph limbred cleflip downsyn hypspad spina hern gastro clefpal suspchrom&lt;BR /&gt;cgaoth nchs_cgana ;&lt;BR /&gt;by patnm;&lt;BR /&gt;format CDOB mmddyy10. fdob mmddyy10. mdob mmddyy10. lldob mmddyy10. lodob monyy7. nchsbpt $nchsbpt. Attend_Type $Attend_Type.&lt;BR /&gt;MOM_XFER $MOM_XFER. vrfac $Fac2020a. nchsfedu $educ. marrever $marrever. pataff $pataff. nchsmedu $educ.;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Am I wanting to do the impossible here?&lt;/P&gt;</description>
      <pubDate>Mon, 04 Apr 2022 13:47:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Changing-EXCEL-output/m-p/805852#M25677</guid>
      <dc:creator>DanielQuay</dc:creator>
      <dc:date>2022-04-04T13:47:13Z</dc:date>
    </item>
    <item>
      <title>Re: Changing EXCEL output</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Changing-EXCEL-output/m-p/805861#M25678</link>
      <description>&lt;P&gt;I don't understand.&amp;nbsp; You printed 33 variables.&amp;nbsp; So you get 33 columns in the spreadsheet.&lt;/P&gt;
&lt;P&gt;What it is that you want instead?&lt;/P&gt;</description>
      <pubDate>Mon, 04 Apr 2022 14:32:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Changing-EXCEL-output/m-p/805861#M25678</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2022-04-04T14:32:29Z</dc:date>
    </item>
    <item>
      <title>Re: Changing EXCEL output</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Changing-EXCEL-output/m-p/805863#M25679</link>
      <description>&lt;P&gt;The problem is that I need this to basically show up on one page.&amp;nbsp;&lt;/P&gt;&lt;P&gt;So instead of one row with 33 variables I would need like 8 rows with 4 variables and one row of 1.&lt;/P&gt;</description>
      <pubDate>Mon, 04 Apr 2022 14:35:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Changing-EXCEL-output/m-p/805863#M25679</guid>
      <dc:creator>DanielQuay</dc:creator>
      <dc:date>2022-04-04T14:35:57Z</dc:date>
    </item>
    <item>
      <title>Re: Changing EXCEL output</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Changing-EXCEL-output/m-p/805866#M25680</link>
      <description>&lt;P&gt;If you want 8 rows then re-organize the dataset to reflect the new structure.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It would help a lot if you posted some example input data and what you want the output to look like.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But remember that SAS is dealing with datasets, not cells in a spreadsheet.&amp;nbsp; So if you can design a dataset structure that reflects what you want then PROC PRINT or PROC REPORT will work.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But if you want very fine grained support for report generating then look at the tools for generating ODS output from a data step.&lt;/P&gt;</description>
      <pubDate>Mon, 04 Apr 2022 14:41:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Changing-EXCEL-output/m-p/805866#M25680</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2022-04-04T14:41:47Z</dc:date>
    </item>
    <item>
      <title>Re: Changing EXCEL output</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Changing-EXCEL-output/m-p/806315#M25685</link>
      <description>&lt;P&gt;One approach would be to read your data into a matrix using proc iml.&amp;nbsp; then you can reshape it into the dimension you want for your Excel sheet.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Below is a rough code to display 32 vars into a 4x8 table.&amp;nbsp; if you need to add another row say with just one var, you could append another matrix using the "//" operator (vertical concatenation).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this helps&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/* Create a dummy dataset that represents your PAMR_CERT */
proc iml;
  mydat=(1:32);
  create PAMR_CERT from mydat;
    append from mydat;
  close;
quit;

/* Your code starts here */
/* reshape the data into 4 x 8  */
proc iml;
  use PAMR_CERT; /* Here use your actual dataset   */
  read all var _NUM_ into x[colname=NumNames];
  print x;
  close PAMR_CERT;
  z=shape(x,8,4);  
  print z;
  create PAMR_CERT2 from z[colname={'A' 'B' 'C' 'D'}];	
	append from z;
  close;
quit;
filename xlout '~/test/reshaped.xlsx';
ods excel file=xlout;
proc print;
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="ghosh_0-1649256848306.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/70170i344D7347625F2B1C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ghosh_0-1649256848306.png" alt="ghosh_0-1649256848306.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Apr 2022 15:01:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Changing-EXCEL-output/m-p/806315#M25685</guid>
      <dc:creator>ghosh</dc:creator>
      <dc:date>2022-04-06T15:01:57Z</dc:date>
    </item>
    <item>
      <title>Re: Changing EXCEL output</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Changing-EXCEL-output/m-p/808560#M25722</link>
      <description>&lt;P&gt;Have a look at the report writing interface (RWI). It is used in a dataset and allows nearly full control over the output format.&lt;/P&gt;</description>
      <pubDate>Tue, 19 Apr 2022 13:50:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Changing-EXCEL-output/m-p/808560#M25722</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2022-04-19T13:50:29Z</dc:date>
    </item>
  </channel>
</rss>

