<?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 Report dataset to Excel in specific format. in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Report-dataset-to-Excel-in-specific-format/m-p/721427#M223598</link>
    <description>&lt;P&gt;&amp;nbsp;I am trying to achieve specific format from&amp;nbsp; dataset ( Sashelp.cars) only using Asia origin reporting into excel sheet in the format&amp;nbsp; mentioned in the Image.&amp;nbsp; how I can&amp;nbsp; achieve this, is there any obstacles to achieve in this format?. Any suggestions greatly appreciated&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SASuserlot_0-1614122104975.png" style="width: 769px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/55099i18866BBE9251CB17/image-dimensions/769x125?v=v2" width="769" height="125" role="button" title="SASuserlot_0-1614122104975.png" alt="SASuserlot_0-1614122104975.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13549"&gt;@Cynthia_sas&lt;/a&gt;&amp;nbsp; I saw you given so many solutions for Excel output in the past. I really appreciate if you can help with this.&lt;/P&gt;</description>
    <pubDate>Wed, 24 Feb 2021 00:17:45 GMT</pubDate>
    <dc:creator>SASuserlot</dc:creator>
    <dc:date>2021-02-24T00:17:45Z</dc:date>
    <item>
      <title>Report dataset to Excel in specific format.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Report-dataset-to-Excel-in-specific-format/m-p/721427#M223598</link>
      <description>&lt;P&gt;&amp;nbsp;I am trying to achieve specific format from&amp;nbsp; dataset ( Sashelp.cars) only using Asia origin reporting into excel sheet in the format&amp;nbsp; mentioned in the Image.&amp;nbsp; how I can&amp;nbsp; achieve this, is there any obstacles to achieve in this format?. Any suggestions greatly appreciated&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SASuserlot_0-1614122104975.png" style="width: 769px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/55099i18866BBE9251CB17/image-dimensions/769x125?v=v2" width="769" height="125" role="button" title="SASuserlot_0-1614122104975.png" alt="SASuserlot_0-1614122104975.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13549"&gt;@Cynthia_sas&lt;/a&gt;&amp;nbsp; I saw you given so many solutions for Excel output in the past. I really appreciate if you can help with this.&lt;/P&gt;</description>
      <pubDate>Wed, 24 Feb 2021 00:17:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Report-dataset-to-Excel-in-specific-format/m-p/721427#M223598</guid>
      <dc:creator>SASuserlot</dc:creator>
      <dc:date>2021-02-24T00:17:45Z</dc:date>
    </item>
    <item>
      <title>Re: Export dataset to Excel in specific format.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Report-dataset-to-Excel-in-specific-format/m-p/721429#M223600</link>
      <description>&lt;P&gt;That is not an EXPORT.&amp;nbsp; That is a REPORT.&lt;/P&gt;
&lt;P&gt;Use a reporting tool like PROC REPORT or perhaps PROC TABULATE with ODS EXCEL output destination.&lt;/P&gt;</description>
      <pubDate>Wed, 24 Feb 2021 00:14:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Report-dataset-to-Excel-in-specific-format/m-p/721429#M223600</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-02-24T00:14:47Z</dc:date>
    </item>
    <item>
      <title>Re: Report dataset to Excel in specific format.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Report-dataset-to-Excel-in-specific-format/m-p/721430#M223601</link>
      <description>&lt;P&gt;Thanks Tom,&amp;nbsp; Sorry for the confusion. I corrected it. Yes I do understand it can be done by proc report, but I am kind of stuck&amp;nbsp; how to achieve the horizontal headers with in the headers part.&lt;/P&gt;</description>
      <pubDate>Wed, 24 Feb 2021 00:19:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Report-dataset-to-Excel-in-specific-format/m-p/721430#M223601</guid>
      <dc:creator>SASuserlot</dc:creator>
      <dc:date>2021-02-24T00:19:33Z</dc:date>
    </item>
    <item>
      <title>Re: Report dataset to Excel in specific format.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Report-dataset-to-Excel-in-specific-format/m-p/721431#M223602</link>
      <description>&lt;P&gt;The process works a lot better when you show what code you have tried and explain it what ways it does not meet your needs.&lt;/P&gt;</description>
      <pubDate>Wed, 24 Feb 2021 00:22:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Report-dataset-to-Excel-in-specific-format/m-p/721431#M223602</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-02-24T00:22:49Z</dc:date>
    </item>
    <item>
      <title>Re: Report dataset to Excel in specific format.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Report-dataset-to-Excel-in-specific-format/m-p/721435#M223606</link>
      <description>&lt;P&gt;I am kind of new to SAS. I tried the basic code, Please guide.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data cars;
set sashelp.cars;
where origin="Asia" and Make = "Acura" and type= "Sedan";
styl= "Drive train";
run;
ods ESCAPECHAR = '^';
ods excel file='C:\Users\xxu\Desktop\xxr\cars.xlsx' options(sheet_name = "Asia"
 sheet_interval='none');


   PROC REPORT data= cars nowindows
					      style(report)=[font=("Times New Roman", 11pt) protectspecialchars=on]
					      style(header)=[font=("Times New Roman", 11pt, bold) just=center protectspecialchars=on]
					      style(column)=[font=("Times New Roman", 11pt) protectspecialchars=on];
      COLUMN  origin make  styl  type   drivetrain model cylinders wheelbase mpg_city enginesize Horsepower;
      DEFINE origin / order  NOPRINT style=[font=("Times New Roman",11pt)just=c vjust=t vjust=t cellwidth=2.745cm tagattr='type:String format:Text'];
      DEFINE make /  order  "make" display style=[just=l vjust=t cellwidth=2cm tagattr='type:String format:Text'];
      DEFINE styl/  "style" display style=[just=c vjust=t cellwidth=3.882cm tagattr='type:String format:Text'];
      DEFINE type/  order  "type" display style=[just=c vjust=t cellwidth=8.882cm tagattr='type:String format:Text'];
      DEFINE drivetrain/"drivetrain" display style=[just=c vjust=t cellwidth=2.718cm tagattr='type:String format:Text'];
      DEFINE model /"model" display style=[just=c vjust=t cellwidth=2.818cm tagattr='type:String format:Text'];
      DEFINE Cylinders /"cylinders" display style=[just=c vjust=t cellwidth=3.212cm tagattr='type:String format:Text'];
      DEFINE wheelbase /"wheelbase" display style=[just=c vjust=t cellwidth=3.212cm tagattr='type:String format:Text'];
	  DEFINE mpg_city /"mpg_city" display style=[just=c vjust=t cellwidth=4.643cm tagattr='type:String format:Text'];
	  DEFINE EngineSize/"Engine Size" display style=[just=c vjust=t cellwidth=4.643cm tagattr='type:String format:Text'];
	  DEFINE Horsepower /"Horsepower" display style=[just=c vjust=t cellwidth=4.643cm tagattr='type:String format:Text'];

	  compute before origin/ style=[font=("Times New Roman", 11pt, bold ) background=grey ];
		line origin $varying80. ;
	  endcomp;

run;
ods excel close;
ods listing close;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 24 Feb 2021 01:04:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Report-dataset-to-Excel-in-specific-format/m-p/721435#M223606</guid>
      <dc:creator>SASuserlot</dc:creator>
      <dc:date>2021-02-24T01:04:32Z</dc:date>
    </item>
    <item>
      <title>Re: Report dataset to Excel in specific format.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Report-dataset-to-Excel-in-specific-format/m-p/721478#M223631</link>
      <description>&lt;P&gt;To move the origin above the table header replace "origin" by "_page_" in the compute statement:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;compute before _page_ / ...;
  ...
endcomp;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I have no idea how to output "drivetrain" the way you want it.&lt;/P&gt;</description>
      <pubDate>Wed, 24 Feb 2021 05:32:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Report-dataset-to-Excel-in-specific-format/m-p/721478#M223631</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2021-02-24T05:32:14Z</dc:date>
    </item>
    <item>
      <title>Re: Report dataset to Excel in specific format.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Report-dataset-to-Excel-in-specific-format/m-p/721579#M223681</link>
      <description>&lt;P&gt;Hi:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; I'm not sure I understand this report. Here are some first thoughts:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Cynthia_sas_0-1614176407123.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/55115i8E9BFDBC8B4E86C5/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Cynthia_sas_0-1614176407123.png" alt="Cynthia_sas_0-1614176407123.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I thought that seeing your code might help, but that leads to more questions. Here are some other thoughts:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Cynthia_sas_2-1614176996685.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/55117i42288860669B49DE/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Cynthia_sas_2-1614176996685.png" alt="Cynthia_sas_2-1614176996685.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; It doesn't look to me like the code you posted produces the picture you posted. So I am curious how you got the word Front into your posted picture and where that came from. Also curious about the variable "styl" and why both MAKE and TYPE have 2 usages and whether you want ORDER or DISPLAY for the usage.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cynthia&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Feb 2021 14:30:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Report-dataset-to-Excel-in-specific-format/m-p/721579#M223681</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2021-02-24T14:30:15Z</dc:date>
    </item>
    <item>
      <title>Re: Report dataset to Excel in specific format.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Report-dataset-to-Excel-in-specific-format/m-p/721596#M223687</link>
      <description>&lt;P&gt;Thanks for you valuable suggestions Cynthia. the top pic, its the template they given in excel how they want the output of dataset. its not produced using the SAS. I requested how to produce that output, since I don't have much knowledge in producing excel especially this many horizontal headers. Some&amp;nbsp; fellow member asked me just post code I used&amp;nbsp; whatever I started so, I posted my sas code( I got some inputs from you because of that , Thanks). I believe my code not at all useful for the report I am looking to produce after reading your inputs. Varaible "Styl" I created because I am not sure how to bring "Drive Train" in the excel under style. Thanks for your inputs let me know if you have any questions.&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Cynthia_sas_0-1614176407123.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/55120iDBB728E23A3890FE/image-size/large?v=v2&amp;amp;px=999" role="button" title="Cynthia_sas_0-1614176407123.png" alt="Cynthia_sas_0-1614176407123.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Feb 2021 15:33:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Report-dataset-to-Excel-in-specific-format/m-p/721596#M223687</guid>
      <dc:creator>SASuserlot</dc:creator>
      <dc:date>2021-02-24T15:33:06Z</dc:date>
    </item>
    <item>
      <title>Re: Report dataset to Excel in specific format.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Report-dataset-to-Excel-in-specific-format/m-p/721654#M223702</link>
      <description>&lt;P&gt;Hi:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; I'm not going to get into any examples of ODS EXCEL. I always like to see what PROC REPORT gives by default before involving other destinations or trying to over control things like fonts and cellwidths and using options like PROTECTSPECIALCHARS which do not seem required for the output you describe. Also before I move heaven and earth to try to insert text strings into arbitrary places, or conform to possibly arbitrary cosmetic "requirements", I generally, like to make sure that people are aware of the formatting that can be done easily before jumping straight into formatting that seems arbitrary or unreasonable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; So, with extremely simplified code and taking the default HTML output, this is what I can get out of SASHELP.CARS without making any other variables in a DATA step:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Cynthia_sas_0-1614190166734.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/55125i2E05D02622D250C6/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Cynthia_sas_0-1614190166734.png" alt="Cynthia_sas_0-1614190166734.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;As you can see, there are 2 possible options for the placement of the value for DRIVETRAIN, either in a COMPUTE BEFORE _PAGE_ or COMPUTE BEFORE DRIVETRAIN. The odd row arrangement you showed in your shot does not make sense to me. I did turn SPANROWS on in my code and stripped everything down in the code to the bare minimum. I am unable to force myself to use a style override without an area in parentheses, as you showed for your original DEFINE statements, so I removed most of them partly in the interests of simplification and partly because for testing purposes the over-abundance of overrides were not needed.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; This program might not format or break as you want when you get more MAKEs, DRIVETRAINs or ORIGINs on the report. So if you envision more values for these variables on a final report or in a final Excel sheet, then I recommend sticking with the simplified program and get it working on your real data or with more groups.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Hope this helps,&lt;/P&gt;
&lt;P&gt;Cynthia&lt;/P&gt;</description>
      <pubDate>Wed, 24 Feb 2021 18:17:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Report-dataset-to-Excel-in-specific-format/m-p/721654#M223702</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2021-02-24T18:17:47Z</dc:date>
    </item>
    <item>
      <title>Re: Report dataset to Excel in specific format.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Report-dataset-to-Excel-in-specific-format/m-p/721656#M223704</link>
      <description>&lt;P&gt;Thank you so much&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13549"&gt;@Cynthia_sas&lt;/a&gt;&amp;nbsp;. It helped me a lot. I will keep your suggestions in mind when I am trying to output something through ODS instead of doing complicated things. Thanks again&lt;/P&gt;</description>
      <pubDate>Wed, 24 Feb 2021 18:30:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Report-dataset-to-Excel-in-specific-format/m-p/721656#M223704</guid>
      <dc:creator>SASuserlot</dc:creator>
      <dc:date>2021-02-24T18:30:54Z</dc:date>
    </item>
  </channel>
</rss>

