<?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: Header and Segment by Variable in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Header-and-Segment-by-Variable/m-p/788048#M251883</link>
    <description>&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;SPAN&gt;The desire is a csv file however it saves as an excel. I dont know why&lt;/SPAN&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;SPAN&gt;Your code creates a csv file, but Windows thinks all csv files are meant to be opened with Excel. That's all.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Make it a habit to set Windiws Explorer to show&lt;/SPAN&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;SPAN&gt;all files&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN&gt;all directories&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN&gt;all file extensions&lt;/SPAN&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&lt;SPAN&gt;so that you see all pertinent information for a file, regardless of its association.&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Sun, 02 Jan 2022 23:58:31 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2022-01-02T23:58:31Z</dc:date>
    <item>
      <title>Header and Segment by Variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Header-and-Segment-by-Variable/m-p/788045#M251880</link>
      <description>&lt;PRE&gt;%Let pth     = /share/sas_tmp;

data have;
length
  dept $25 
  month_ 4
  count_ 8
  current 8
;
input dept month_ :monyy5. count_ current;
format month_ yymmd7.;
datalines;
Atlantic JAN20 1 1 
Atlantic JAN20 1 0 
Central FEB20 1 1  
Central APR20 1 1   
Central MAR20 1 0 
Pacific APR20 1 0   
Pacific FEB20 1 1
;
run;

proc sql;
create table have2 as
select dept label = 'Department',
		month_  label = 'Month',
		count_  label = 'Count',
		current  label = 'Current'
from have
;quit;

proc export data=work.have2
    outfile="/&amp;amp;pth./have3.csv"
	label
    dbms=csv;
run;&lt;/PRE&gt;
&lt;P&gt;1. Files successfully writes to the sharefolder location. The desire is a csv file however it saves as an excel. I dont know why&lt;BR /&gt;2. I want one output file however I want to separate into tabs based on the Department&lt;BR /&gt;3. I need a header in the first two rows so the actual data should start on the third row&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Desired output in my export is as follows with a separate tab based on the Department:&lt;/P&gt;
&lt;TABLE width="338"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="82"&gt;7&lt;/TD&gt;
&lt;TD width="64"&gt;3&lt;/TD&gt;
&lt;TD width="64"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD colspan="2" width="128"&gt;Data Needed&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;Key&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD&gt;Loan Data&lt;/TD&gt;
&lt;TD colspan="2"&gt;Current Data&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;Department&lt;/TD&gt;
&lt;TD&gt;Month&lt;/TD&gt;
&lt;TD&gt;Count&lt;/TD&gt;
&lt;TD&gt;Current&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;Atlantic&lt;/TD&gt;
&lt;TD&gt;2020-01&lt;/TD&gt;
&lt;TD&gt;1&lt;/TD&gt;
&lt;TD&gt;1&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;Atlantic&lt;/TD&gt;
&lt;TD&gt;2020-01&lt;/TD&gt;
&lt;TD&gt;1&lt;/TD&gt;
&lt;TD&gt;0&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;Central&lt;/TD&gt;
&lt;TD&gt;2020-02&lt;/TD&gt;
&lt;TD&gt;1&lt;/TD&gt;
&lt;TD&gt;1&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;Central&lt;/TD&gt;
&lt;TD&gt;2020-04&lt;/TD&gt;
&lt;TD&gt;1&lt;/TD&gt;
&lt;TD&gt;1&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;Central&lt;/TD&gt;
&lt;TD&gt;2020-03&lt;/TD&gt;
&lt;TD&gt;1&lt;/TD&gt;
&lt;TD&gt;0&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;Pacific&lt;/TD&gt;
&lt;TD&gt;2020-04&lt;/TD&gt;
&lt;TD&gt;1&lt;/TD&gt;
&lt;TD&gt;0&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;Pacific&lt;/TD&gt;
&lt;TD&gt;2020-02&lt;/TD&gt;
&lt;TD&gt;1&lt;/TD&gt;
&lt;TD&gt;1&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;</description>
      <pubDate>Sun, 02 Jan 2022 23:03:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Header-and-Segment-by-Variable/m-p/788045#M251880</guid>
      <dc:creator>Q1983</dc:creator>
      <dc:date>2022-01-02T23:03:50Z</dc:date>
    </item>
    <item>
      <title>Re: Header and Segment by Variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Header-and-Segment-by-Variable/m-p/788047#M251882</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/5629"&gt;@Q1983&lt;/a&gt;&amp;nbsp;wrote:1&lt;BR /&gt;.....&lt;BR /&gt;1. Files successfully writes to the sharefolder location. The desire is a csv file however it saves as an excel. I dont know why&lt;BR /&gt;2. I want one output file however I want to separate into tabs based on the Department&lt;BR /&gt;3. I need a header in the first two rows so the actual data should start on the third row&lt;/BLOCKQUOTE&gt;
&lt;P&gt;- Your code strongly suggests that you're creating a .csv file.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;- A .csv file is just a text file where you can't have things like tabs. If you want tabs then the output format should become an actual Excel file.&lt;/P&gt;
&lt;P&gt;- ODS EXCEL should allow you to do all you need. There are quite a few examples out there already which should give you all the pointers you need.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 02 Jan 2022 23:29:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Header-and-Segment-by-Variable/m-p/788047#M251882</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2022-01-02T23:29:13Z</dc:date>
    </item>
    <item>
      <title>Re: Header and Segment by Variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Header-and-Segment-by-Variable/m-p/788048#M251883</link>
      <description>&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;SPAN&gt;The desire is a csv file however it saves as an excel. I dont know why&lt;/SPAN&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;SPAN&gt;Your code creates a csv file, but Windows thinks all csv files are meant to be opened with Excel. That's all.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Make it a habit to set Windiws Explorer to show&lt;/SPAN&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;SPAN&gt;all files&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN&gt;all directories&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN&gt;all file extensions&lt;/SPAN&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&lt;SPAN&gt;so that you see all pertinent information for a file, regardless of its association.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 02 Jan 2022 23:58:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Header-and-Segment-by-Variable/m-p/788048#M251883</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2022-01-02T23:58:31Z</dc:date>
    </item>
  </channel>
</rss>

