<?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: Why Output data column sequence different? in SAS Studio</title>
    <link>https://communities.sas.com/t5/SAS-Studio/Why-Output-data-column-sequence-different/m-p/648483#M9170</link>
    <description>&lt;P&gt;Without seeing the source data AND how you import and merge things this question really can't be answered.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you use proc import and the order of columns in the original files is the same what you state is very unlikely to happen though the specific syntax of how you "merge" the data may have an affect.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If the columns of data in different files, the CSV and XLSX, are in different order than that would be a very likely cause.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;People creating XLSX files are pretty notorious for having orders of columns change without notice&lt;/P&gt;</description>
    <pubDate>Mon, 18 May 2020 05:26:13 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2020-05-18T05:26:13Z</dc:date>
    <item>
      <title>Why Output data column sequence different?</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Why-Output-data-column-sequence-different/m-p/648482#M9169</link>
      <description>&lt;P&gt;I have 2 set of data, 1 in CSV and 1 in XLSX.&lt;/P&gt;&lt;P&gt;Would like to know same data but data type different (CSV vs. XLSX), but why SAS output columns sequence different?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;CSV format:&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;&lt;P&gt;I import 3 CSV data in SAS and perform data merging into 1.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;output result:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Column a b c&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;XLSX format:&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;&lt;P&gt;I import 2 XLSX data in SAS and perform data merging into 1.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;output result:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Column b c a&lt;/P&gt;</description>
      <pubDate>Mon, 18 May 2020 05:16:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Why-Output-data-column-sequence-different/m-p/648482#M9169</guid>
      <dc:creator>CHEESE123</dc:creator>
      <dc:date>2020-05-18T05:16:11Z</dc:date>
    </item>
    <item>
      <title>Re: Why Output data column sequence different?</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Why-Output-data-column-sequence-different/m-p/648483#M9170</link>
      <description>&lt;P&gt;Without seeing the source data AND how you import and merge things this question really can't be answered.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you use proc import and the order of columns in the original files is the same what you state is very unlikely to happen though the specific syntax of how you "merge" the data may have an affect.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If the columns of data in different files, the CSV and XLSX, are in different order than that would be a very likely cause.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;People creating XLSX files are pretty notorious for having orders of columns change without notice&lt;/P&gt;</description>
      <pubDate>Mon, 18 May 2020 05:26:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Why-Output-data-column-sequence-different/m-p/648483#M9170</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-05-18T05:26:13Z</dc:date>
    </item>
    <item>
      <title>Re: Why Output data column sequence different?</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Why-Output-data-column-sequence-different/m-p/648484#M9171</link>
      <description>yes... I am use proc import.&lt;BR /&gt;&lt;BR /&gt;May I know is there any way for me to reorder the output column?&lt;BR /&gt;&lt;BR /&gt;I have arrange the column seq in SAS(column a b c), then perform output the result in excel. But the column is back to the incorrect order (column b c a).</description>
      <pubDate>Mon, 18 May 2020 06:02:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Why-Output-data-column-sequence-different/m-p/648484#M9171</guid>
      <dc:creator>CHEESE123</dc:creator>
      <dc:date>2020-05-18T06:02:32Z</dc:date>
    </item>
    <item>
      <title>Re: Why Output data column sequence different?</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Why-Output-data-column-sequence-different/m-p/648486#M9172</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/326247"&gt;@CHEESE123&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;yes... I am use proc import.&lt;BR /&gt;&lt;BR /&gt;May I know is there any way for me to reorder the output column?&lt;BR /&gt;&lt;BR /&gt;I have arrange the column seq in SAS(column a b c), then perform output the result in excel. But the column is back to the incorrect order (column b c a).&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Show the code you are using.&lt;/P&gt;
&lt;P&gt;I suspect that your "arrange the column seq" isn't doing what you think but I'm not going to guess what you may have tried.&lt;/P&gt;</description>
      <pubDate>Mon, 18 May 2020 06:20:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Why-Output-data-column-sequence-different/m-p/648486#M9172</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-05-18T06:20:12Z</dc:date>
    </item>
    <item>
      <title>Re: Why Output data column sequence different?</title>
      <link>https://communities.sas.com/t5/SAS-Studio/Why-Output-data-column-sequence-different/m-p/648488#M9173</link>
      <description>&lt;P&gt;You can force order of variable by entering a statement next to DATA statement,&lt;/P&gt;
&lt;P&gt;either:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data &amp;lt;output&amp;gt;;
    retain &amp;lt;list of variables in desired order);
   .....
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;or:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data &amp;lt;output&amp;gt;;
     format &amp;lt;ordered list&amp;gt;; /* without assigning formats */&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;thus, by mentioning the variable names as first statement, the output should be in same order.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 18 May 2020 06:28:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/Why-Output-data-column-sequence-different/m-p/648488#M9173</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2020-05-18T06:28:54Z</dc:date>
    </item>
  </channel>
</rss>

