<?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: Change the order of the variable to merge two data sets in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Change-the-order-of-the-variable-to-merge-two-data-sets/m-p/729660#M227112</link>
    <description>&lt;P&gt;I assume your title should say "Change the order of OBSERVATIONS", not "change the order of variables", as the order of variables would not affect a merge.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In any event, I think your two PROC IMPORTs wind up causing errors and don't create data sets. But as stated by &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13976"&gt;@SASKiwi&lt;/a&gt; , show us the LOG of this entire section of code, all of the LOG, that's 100%, every single character in the LOG for this part of the code, with nothing chopped out, and without you selecting parts to show us and not showing us other parts.&lt;/P&gt;</description>
    <pubDate>Sun, 28 Mar 2021 20:11:27 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2021-03-28T20:11:27Z</dc:date>
    <item>
      <title>Change the order of the variable to merge two data sets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Change-the-order-of-the-variable-to-merge-two-data-sets/m-p/729657#M227109</link>
      <description>&lt;P&gt;This code doesn't work why?&lt;/P&gt;
&lt;DIV&gt;
&lt;DIV class="question-details--answer-container--3tEfY"&gt;
&lt;DIV class="answer--answer--NVnBe"&gt;
&lt;DIV class="answer--info--1D783"&gt;
&lt;DIV class="answer--body--2d8Ux" data-purpose="safely-set-inner-html:rich-text-viewer:html"&gt;
&lt;DIV class="ud-component--base-components--code-block"&gt;
&lt;DIV&gt;
&lt;OL class="linenums"&gt;
&lt;LI class="L0"&gt;&lt;SPAN class="pln"&gt;PROC IMPORT OUT&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;=&lt;/SPAN&gt;&lt;SPAN class="typ"&gt;Balance_Bank1&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI class="L1"&gt;&lt;SPAN class="typ"&gt;DataFile&lt;/SPAN&gt; &lt;SPAN class="pun"&gt;=&lt;/SPAN&gt; &lt;SPAN class="str"&gt;"/home/nguityn0/Balance_Bank.xlsx"&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI class="L2"&gt;&lt;SPAN class="pln"&gt;dbms&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;=&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;xlsx REPLACE&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI class="L3"&gt;&lt;SPAN class="typ"&gt;Sheet&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;=&lt;/SPAN&gt;&lt;SPAN class="str"&gt;"Sheet1"&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI class="L4"&gt;&lt;SPAN class="pln"&gt;INPUT &lt;/SPAN&gt;&lt;SPAN class="typ"&gt;Acc_Number$&lt;/SPAN&gt; &lt;SPAN class="typ"&gt;Date&lt;/SPAN&gt; &lt;SPAN class="typ"&gt;Debit&lt;/SPAN&gt; &lt;SPAN class="typ"&gt;Credit&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI class="L5"&gt;&lt;SPAN class="pln"&gt;getnames&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;=&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;NO&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI class="L6"&gt;&lt;SPAN class="pln"&gt;RUN&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI class="L2"&gt;&lt;SPAN class="typ"&gt;Proc&lt;/SPAN&gt; &lt;SPAN class="typ"&gt;Sort&lt;/SPAN&gt; &lt;SPAN class="typ"&gt;Data&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;=&lt;/SPAN&gt;&lt;SPAN class="typ"&gt;Balance_Bank1&lt;/SPAN&gt;&lt;SPAN class="pln"&gt; OUT&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;=&lt;/SPAN&gt;&lt;SPAN class="typ"&gt;Balance_Bank1Sorted&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI class="L3"&gt;&lt;SPAN class="pln"&gt;BY &lt;/SPAN&gt;&lt;SPAN class="typ"&gt;Acc_number&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI class="L4"&gt;&lt;SPAN class="pln"&gt;RUN&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI class="L5"&gt;&lt;SPAN class="pln"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI class="L6"&gt;&lt;SPAN class="pln"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI class="L7"&gt;&lt;SPAN class="pln"&gt;PROC IMPORT OUT&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;=&lt;/SPAN&gt;&lt;SPAN class="typ"&gt;Balance_Bank2&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI class="L8"&gt;&lt;SPAN class="typ"&gt;DataFile&lt;/SPAN&gt; &lt;SPAN class="pun"&gt;=&lt;/SPAN&gt; &lt;SPAN class="str"&gt;"/home/nguityn0/Balance_Bank.xlsx"&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI class="L9"&gt;&lt;SPAN class="pln"&gt;dbms&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;=&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;xlsx REPLACE&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI class="L0"&gt;&lt;SPAN class="typ"&gt;Sheet&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;=&lt;/SPAN&gt;&lt;SPAN class="str"&gt;"Sheet2"&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI class="L1"&gt;&lt;SPAN class="pln"&gt;INPUT &lt;/SPAN&gt;&lt;SPAN class="typ"&gt;Acc_Number$&lt;/SPAN&gt; &lt;SPAN class="typ"&gt;Date&lt;/SPAN&gt; &lt;SPAN class="typ"&gt;Debit&lt;/SPAN&gt; &lt;SPAN class="typ"&gt;Credit&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI class="L2"&gt;&lt;SPAN class="pln"&gt;getnames&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;=&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;NO&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI class="L3"&gt;&lt;SPAN class="typ"&gt;Run&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI class="L4"&gt;&lt;SPAN class="pln"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI class="L5"&gt;&lt;SPAN class="typ"&gt;Proc&lt;/SPAN&gt; &lt;SPAN class="typ"&gt;Sort&lt;/SPAN&gt; &lt;SPAN class="typ"&gt;Data&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;=&lt;/SPAN&gt;&lt;SPAN class="typ"&gt;Balance_Bank2&lt;/SPAN&gt;&lt;SPAN class="pln"&gt; OUT&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;=&lt;/SPAN&gt;&lt;SPAN class="typ"&gt;Balance_Bank2Sorted&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI class="L6"&gt;&lt;SPAN class="pln"&gt;BY &lt;/SPAN&gt;&lt;SPAN class="typ"&gt;Acc_number&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI class="L7"&gt;&lt;SPAN class="pln"&gt;RUN&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI class="L8"&gt;&lt;SPAN class="pln"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI class="L9"&gt;&lt;SPAN class="typ"&gt;Data&lt;/SPAN&gt; &lt;SPAN class="typ"&gt;NewCollection&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI class="L0"&gt;&lt;SPAN class="pln"&gt;MERGE &lt;/SPAN&gt;&lt;SPAN class="typ"&gt;Balance_Bank1Sorted&lt;/SPAN&gt; &lt;SPAN class="typ"&gt;Balance_Bank2Sorted&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI class="L1"&gt;&lt;SPAN class="pln"&gt;BY ACC_Number&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI class="L2"&gt;&lt;SPAN class="pln"&gt;RUN&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;/OL&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV class="question-details--dummy-answer-input-container--18VUQ"&gt;
&lt;DIV class="user-avatar user-avatar--initials" role="img" aria-label="Guity Niamanesh" data-purpose="user-avatar"&gt;
&lt;DIV class="user-avatar__inner fx-c"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="user-avatar__inner fx-c"&gt;&lt;SPAN class="user-initials"&gt;What is the problem?&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV class="user-avatar__inner fx-c"&gt;&lt;SPAN class="user-initials"&gt;Blue Sky&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Sun, 28 Mar 2021 19:12:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Change-the-order-of-the-variable-to-merge-two-data-sets/m-p/729657#M227109</guid>
      <dc:creator>GN0001</dc:creator>
      <dc:date>2021-03-28T19:12:15Z</dc:date>
    </item>
    <item>
      <title>Re: Change the order of the variable to merge two data sets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Change-the-order-of-the-variable-to-merge-two-data-sets/m-p/729658#M227110</link>
      <description>&lt;P&gt;Please post your SAS log including any notes. Without this evidence we don't know what your problem is.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 28 Mar 2021 19:23:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Change-the-order-of-the-variable-to-merge-two-data-sets/m-p/729658#M227110</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2021-03-28T19:23:48Z</dc:date>
    </item>
    <item>
      <title>Re: Change the order of the variable to merge two data sets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Change-the-order-of-the-variable-to-merge-two-data-sets/m-p/729660#M227112</link>
      <description>&lt;P&gt;I assume your title should say "Change the order of OBSERVATIONS", not "change the order of variables", as the order of variables would not affect a merge.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In any event, I think your two PROC IMPORTs wind up causing errors and don't create data sets. But as stated by &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13976"&gt;@SASKiwi&lt;/a&gt; , show us the LOG of this entire section of code, all of the LOG, that's 100%, every single character in the LOG for this part of the code, with nothing chopped out, and without you selecting parts to show us and not showing us other parts.&lt;/P&gt;</description>
      <pubDate>Sun, 28 Mar 2021 20:11:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Change-the-order-of-the-variable-to-merge-two-data-sets/m-p/729660#M227112</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-03-28T20:11:27Z</dc:date>
    </item>
    <item>
      <title>Re: Change the order of the variable to merge two data sets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Change-the-order-of-the-variable-to-merge-two-data-sets/m-p/729661#M227113</link>
      <description>&lt;P&gt;Doesn't work is awful vague.&lt;BR /&gt;&lt;BR /&gt;Are there errors in the log?: Post the code and log in a code box opened with the "&amp;lt;/&amp;gt;" icon to maintain formatting of error messages.&lt;BR /&gt;&lt;BR /&gt;No output? Post any log in a code box.&lt;BR /&gt;&lt;BR /&gt;Unexpected output? Provide input data in the form of data step code pasted into a code box, the actual results and the expected results. Instructions here: &lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-data-AKA-generate/ta-p/258712" target="_blank"&gt;https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-data-AKA-generate/ta-p/258712&lt;/A&gt; will show how to turn an existing SAS data set into data step code that can be pasted into a forum code box using the "&amp;lt;/&amp;gt;" icon or attached as text to show exactly what you have and that we can test code against.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;With that in mind, Proc Import makes guesses as to variable type and length separately for each file.&lt;/P&gt;
&lt;P&gt;So depending on the actual values present in the two files your &lt;SPAN class="typ"&gt;Acc_number could be character in one file and numeric in the other which would have a note in the log about mismatched data type.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="typ"&gt;Another possibility is that if both are character the lengths are different which could lead to values you expect to match not matching as 'A0123' is not the same as 'A01234'. &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="typ"&gt;Another possibility if the variables are character is that values are entered differently. Something in one set might be entered as 'a0123' and 'A0123' in the others. So the case of the letter A doesn't match. There are quite a number of possible value mismatches in this sort of scenario, leading zeroes in one file and not in the other, all upper case, mixed case, lower case and spelling such as 'ABC Co.' 'ABC Co' 'ABC Company' and such, none of these match the others.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 28 Mar 2021 20:15:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Change-the-order-of-the-variable-to-merge-two-data-sets/m-p/729661#M227113</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-03-28T20:15:27Z</dc:date>
    </item>
    <item>
      <title>Re: Change the order of the variable to merge two data sets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Change-the-order-of-the-variable-to-merge-two-data-sets/m-p/729691#M227135</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/202329"&gt;@GN0001&lt;/a&gt;&amp;nbsp;:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As others have pointed out, simply saying your code "doesn't work", ... doesn't work.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Show the log at least, and describe what you got vs what you expected.&lt;/P&gt;</description>
      <pubDate>Mon, 29 Mar 2021 04:15:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Change-the-order-of-the-variable-to-merge-two-data-sets/m-p/729691#M227135</guid>
      <dc:creator>mkeintz</dc:creator>
      <dc:date>2021-03-29T04:15:04Z</dc:date>
    </item>
    <item>
      <title>Re: Change the order of the variable to merge two data sets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Change-the-order-of-the-variable-to-merge-two-data-sets/m-p/729692#M227136</link>
      <description>&lt;P&gt;This is the code:&lt;/P&gt;
&lt;PRE&gt;PROC IMPORT OUT=Balance_Bank1&lt;BR /&gt;DataFile = "/home/nguityn0/Balance_Bank.xlsx"&lt;BR /&gt;dbms=xlsx REPLACE;&lt;BR /&gt;Sheet="Sheet1";&lt;BR /&gt;getnames=NO;&lt;BR /&gt;RUN;&lt;BR /&gt;DAtA  Balance_Bank3;&lt;BR /&gt;Format Acc_Number Date Debit Credit;&lt;BR /&gt;SET balance_bank1;&lt;BR /&gt;RUN;&lt;/PRE&gt;
&lt;P&gt;This is the log:&lt;/P&gt;
&lt;P&gt;&amp;lt;/&lt;/P&gt;
&lt;DIV class="sasSource"&gt;1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;&lt;/DIV&gt;
&lt;DIV class="sasSource"&gt;72&lt;/DIV&gt;
&lt;DIV class="sasSource"&gt;73 PROC IMPORT OUT=Balance_Bank1&lt;/DIV&gt;
&lt;DIV class="sasSource"&gt;74 DataFile = "/home/nguityn0/Balance_Bank.xlsx"&lt;/DIV&gt;
&lt;DIV class="sasSource"&gt;75 dbms=xlsx REPLACE;&lt;/DIV&gt;
&lt;DIV class="sasSource"&gt;76 Sheet="Sheet1";&lt;/DIV&gt;
&lt;DIV class="sasSource"&gt;77 getnames=NO;&lt;/DIV&gt;
&lt;DIV class="sasSource"&gt;78 RUN;&lt;/DIV&gt;
&lt;DIV class="sasNote"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV id="sasLogNote1_1616991388206" class="sasNote"&gt;NOTE: One or more variables were converted because the data type is not supported by the V9 engine. For more details, run with&lt;/DIV&gt;
&lt;DIV class="sasNote"&gt;options MSGLEVEL=I.&lt;/DIV&gt;
&lt;DIV id="sasLogNote2_1616991388206" class="sasNote focus-line"&gt;NOTE: The import data set has 5 observations and 4 variables.&lt;/DIV&gt;
&lt;DIV id="sasLogNote3_1616991388206" class="sasNote"&gt;NOTE: WORK.BALANCE_BANK1 data set was successfully created.&lt;/DIV&gt;
&lt;DIV id="sasLogNote4_1616991388206" class="sasNote"&gt;NOTE: PROCEDURE IMPORT used (Total process time):&lt;/DIV&gt;
&lt;DIV class="sasNote"&gt;real time 0.00 seconds&lt;/DIV&gt;
&lt;DIV class="sasNote"&gt;user cpu time 0.01 seconds&lt;/DIV&gt;
&lt;DIV class="sasNote"&gt;system cpu time 0.00 seconds&lt;/DIV&gt;
&lt;DIV class="sasNote"&gt;memory 2809.84k&lt;/DIV&gt;
&lt;DIV class="sasNote"&gt;OS Memory 33192.00k&lt;/DIV&gt;
&lt;DIV class="sasNote"&gt;Timestamp 03/29/2021 04:16:28 AM&lt;/DIV&gt;
&lt;DIV class="sasNote"&gt;Step Count 243 Switch Count 4&lt;/DIV&gt;
&lt;DIV class="sasNote"&gt;Page Faults 0&lt;/DIV&gt;
&lt;DIV class="sasNote"&gt;Page Reclaims 667&lt;/DIV&gt;
&lt;DIV class="sasNote"&gt;Page Swaps 0&lt;/DIV&gt;
&lt;DIV class="sasNote"&gt;Voluntary Context Switches 25&lt;/DIV&gt;
&lt;DIV class="sasNote"&gt;Involuntary Context Switches 0&lt;/DIV&gt;
&lt;DIV class="sasNote"&gt;Block Input Operations 0&lt;/DIV&gt;
&lt;DIV class="sasNote"&gt;Block Output Operations 264&lt;/DIV&gt;
&lt;DIV class="sasNote"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="sasNote"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="sasSource"&gt;79 DAtA Balance_Bank3;&lt;/DIV&gt;
&lt;DIV class="sasSource"&gt;80 Format Acc_Number Date Debit Credit;&lt;/DIV&gt;
&lt;DIV class="sasSource"&gt;81 SET balance_bank1;&lt;/DIV&gt;
&lt;DIV class="sasSource"&gt;82 RUN;&lt;/DIV&gt;
&lt;DIV class="sasNote"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV id="sasLogNote5_1616991388206" class="sasNote"&gt;NOTE: Variable Acc_Number is uninitialized.&lt;/DIV&gt;
&lt;DIV id="sasLogNote6_1616991388206" class="sasNote"&gt;NOTE: Variable Date is uninitialized.&lt;/DIV&gt;
&lt;DIV id="sasLogNote7_1616991388206" class="sasNote"&gt;NOTE: Variable Debit is uninitialized.&lt;/DIV&gt;
&lt;DIV id="sasLogNote8_1616991388206" class="sasNote"&gt;NOTE: Variable Credit is uninitialized.&lt;/DIV&gt;
&lt;DIV id="sasLogNote9_1616991388206" class="sasNote"&gt;NOTE: There were 5 observations read from the data set WORK.BALANCE_BANK1.&lt;/DIV&gt;
&lt;DIV id="sasLogNote10_1616991388206" class="sasNote"&gt;NOTE: The data set WORK.BALANCE_BANK3 has 5 observations and 4 variables.&lt;/DIV&gt;
&lt;DIV id="sasLogNote11_1616991388206" class="sasNote"&gt;NOTE: DATA statement used (Total process time):&lt;/DIV&gt;
&lt;DIV class="sasNote"&gt;real time 0.00 seconds&lt;/DIV&gt;
&lt;DIV class="sasNote"&gt;user cpu time 0.00 seconds&lt;/DIV&gt;
&lt;DIV class="sasNote"&gt;system cpu time 0.00 seconds&lt;/DIV&gt;
&lt;DIV class="sasNote"&gt;memory 1168.43k&lt;/DIV&gt;
&lt;DIV class="sasNote"&gt;OS Memory 31660.00k&lt;/DIV&gt;
&lt;DIV class="sasNote"&gt;Timestamp 03/29/2021 04:16:28 AM&lt;/DIV&gt;
&lt;DIV class="sasNote"&gt;Step Count 244 Switch Count 2&lt;/DIV&gt;
&lt;DIV class="sasNote"&gt;Page Faults 0&lt;/DIV&gt;
&lt;DIV class="sasNote"&gt;Page Reclaims 130&lt;/DIV&gt;
&lt;DIV class="sasNote"&gt;Page Swaps 0&lt;/DIV&gt;
&lt;DIV class="sasNote"&gt;Voluntary Context Switches 10&lt;/DIV&gt;
&lt;DIV class="sasNote"&gt;Involuntary Context Switches 0&lt;/DIV&gt;
&lt;DIV class="sasNote"&gt;Block Input Operations 0&lt;/DIV&gt;
&lt;DIV class="sasNote"&gt;Block Output Operations 264&lt;/DIV&gt;
&lt;DIV class="sasNote"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="sasNote"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="sasSource"&gt;83&lt;/DIV&gt;
&lt;DIV class="sasSource"&gt;84 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;&amp;gt;&lt;/DIV&gt;
&lt;DIV class="sasSource"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="sasSource"&gt;Regards,&lt;/DIV&gt;
&lt;DIV class="sasSource"&gt;Blue&lt;/DIV&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 29 Mar 2021 04:40:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Change-the-order-of-the-variable-to-merge-two-data-sets/m-p/729692#M227136</guid>
      <dc:creator>GN0001</dc:creator>
      <dc:date>2021-03-29T04:40:18Z</dc:date>
    </item>
    <item>
      <title>Re: Change the order of the variable to merge two data sets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Change-the-order-of-the-variable-to-merge-two-data-sets/m-p/729693#M227137</link>
      <description>&lt;P&gt;Hello PaigeMiller,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Variables are columns or fields and observations are rows.&lt;/P&gt;
&lt;P&gt;I need to change the order of variables.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Respectfully,&lt;/P&gt;
&lt;P&gt;Blue Sky&lt;/P&gt;</description>
      <pubDate>Mon, 29 Mar 2021 04:43:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Change-the-order-of-the-variable-to-merge-two-data-sets/m-p/729693#M227137</guid>
      <dc:creator>GN0001</dc:creator>
      <dc:date>2021-03-29T04:43:17Z</dc:date>
    </item>
    <item>
      <title>Re: Change the order of the variable to merge two data sets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Change-the-order-of-the-variable-to-merge-two-data-sets/m-p/729695#M227138</link>
      <description>Hello ballardw,&lt;BR /&gt;Thanks for the response. It is interesting to know these codes. The first one gave me an error and I am not able to fix it.&lt;BR /&gt;The second one created a data set which is different than mine.&lt;BR /&gt;I use merge to append the data sets and I think the order of variable are important. The data type is not important because I heard that SAS accepts mixed data types in one variable.&lt;BR /&gt;I posted my code and my log any way. The code doesn't arrange the variables on the order that I need for merging.&lt;BR /&gt;I might get a job to write SAS programming. It has been for two days that I am trying to merge to data sets and even my proc sort doesn't sort properly. I told them that I don't have any experience and I am working on it. If if is going to be this hard and challenging, I am going to let this job go.&lt;BR /&gt;Regards,&lt;BR /&gt;Blue Sky</description>
      <pubDate>Mon, 29 Mar 2021 05:02:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Change-the-order-of-the-variable-to-merge-two-data-sets/m-p/729695#M227138</guid>
      <dc:creator>GN0001</dc:creator>
      <dc:date>2021-03-29T05:02:19Z</dc:date>
    </item>
    <item>
      <title>Re: Change the order of the variable to merge two data sets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Change-the-order-of-the-variable-to-merge-two-data-sets/m-p/729696#M227139</link>
      <description>&lt;P&gt;I posted the code and the log.&lt;/P&gt;
&lt;P&gt;Thanks for the response.&lt;/P&gt;
&lt;P&gt;Blue Sky&lt;/P&gt;</description>
      <pubDate>Mon, 29 Mar 2021 05:03:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Change-the-order-of-the-variable-to-merge-two-data-sets/m-p/729696#M227139</guid>
      <dc:creator>GN0001</dc:creator>
      <dc:date>2021-03-29T05:03:04Z</dc:date>
    </item>
    <item>
      <title>Re: Change the order of the variable to merge two data sets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Change-the-order-of-the-variable-to-merge-two-data-sets/m-p/729697#M227140</link>
      <description>&lt;P&gt;You need to examine the data in your dataset WORK.BALANCE_BANK1. It contains 4 variables and 5 observations. Has it been populated as you expect? The notes in the following DATA step suggest you aren't getting the expected variable names and that may have something to do with the GETNAMES = NO statement. What happens if you try GETNAMES = YES?&lt;/P&gt;</description>
      <pubDate>Mon, 29 Mar 2021 05:14:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Change-the-order-of-the-variable-to-merge-two-data-sets/m-p/729697#M227140</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2021-03-29T05:14:32Z</dc:date>
    </item>
    <item>
      <title>Re: Change the order of the variable to merge two data sets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Change-the-order-of-the-variable-to-merge-two-data-sets/m-p/729702#M227141</link>
      <description>&lt;P&gt;The program is different from the first post. I thought the merging process didn't work properly?&lt;/P&gt;
&lt;P&gt;Also, what are the variable names in Balance_Bank1 after import?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm guessing that the variables such as Acc_Number are probably not assigned correctly and thus cannot be merged.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc contents data=Balance_Bank1 varnum;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Run this and show us the list of variables.&lt;/P&gt;</description>
      <pubDate>Mon, 29 Mar 2021 05:21:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Change-the-order-of-the-variable-to-merge-two-data-sets/m-p/729702#M227141</guid>
      <dc:creator>japelin</dc:creator>
      <dc:date>2021-03-29T05:21:04Z</dc:date>
    </item>
    <item>
      <title>Re: Change the order of the variable to merge two data sets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Change-the-order-of-the-variable-to-merge-two-data-sets/m-p/729703#M227142</link>
      <description>&lt;P&gt;I changed the GETName = Yes. It doesn't give me the order that I want.&lt;/P&gt;
&lt;P&gt;Yes, I have four varialbes: Acc_Number Date Debit Credit and 5 observations.&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Blue Skey&lt;/P&gt;</description>
      <pubDate>Mon, 29 Mar 2021 05:21:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Change-the-order-of-the-variable-to-merge-two-data-sets/m-p/729703#M227142</guid>
      <dc:creator>GN0001</dc:creator>
      <dc:date>2021-03-29T05:21:13Z</dc:date>
    </item>
    <item>
      <title>Re: Change the order of the variable to merge two data sets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Change-the-order-of-the-variable-to-merge-two-data-sets/m-p/729705#M227143</link>
      <description>&lt;P&gt;I have not learned the code you put here. I am a new learner and I need to stick to the codes that the instructor is teaching us.&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Blue Sky&lt;/P&gt;</description>
      <pubDate>Mon, 29 Mar 2021 05:23:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Change-the-order-of-the-variable-to-merge-two-data-sets/m-p/729705#M227143</guid>
      <dc:creator>GN0001</dc:creator>
      <dc:date>2021-03-29T05:23:18Z</dc:date>
    </item>
    <item>
      <title>Re: Change the order of the variable to merge two data sets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Change-the-order-of-the-variable-to-merge-two-data-sets/m-p/729707#M227145</link>
      <description>&lt;P&gt;copy and paste, then submit.&lt;/P&gt;
&lt;P&gt;It will work.&lt;/P&gt;</description>
      <pubDate>Mon, 29 Mar 2021 05:36:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Change-the-order-of-the-variable-to-merge-two-data-sets/m-p/729707#M227145</guid>
      <dc:creator>japelin</dc:creator>
      <dc:date>2021-03-29T05:36:27Z</dc:date>
    </item>
    <item>
      <title>Re: Change the order of the variable to merge two data sets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Change-the-order-of-the-variable-to-merge-two-data-sets/m-p/729711#M227148</link>
      <description>&lt;P&gt;Well your program doesn't include PROC SORT if you are referring to row order.&lt;/P&gt;</description>
      <pubDate>Mon, 29 Mar 2021 06:32:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Change-the-order-of-the-variable-to-merge-two-data-sets/m-p/729711#M227148</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2021-03-29T06:32:07Z</dc:date>
    </item>
    <item>
      <title>Re: Change the order of the variable to merge two data sets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Change-the-order-of-the-variable-to-merge-two-data-sets/m-p/729764#M227172</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/202329"&gt;@GN0001&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hello PaigeMiller,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Variables are columns or fields and observations are rows.&lt;/P&gt;
&lt;P&gt;I need to change the order of variables.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Respectfully,&lt;/P&gt;
&lt;P&gt;Blue Sky&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;So you say you get errors, but you haven't shown us the errors in the LOG you provided.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You don't need to change the order of variables to achieve a merge. None of what you said or showed us makes sense.&lt;/P&gt;</description>
      <pubDate>Mon, 29 Mar 2021 12:43:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Change-the-order-of-the-variable-to-merge-two-data-sets/m-p/729764#M227172</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-03-29T12:43:52Z</dc:date>
    </item>
    <item>
      <title>Re: Change the order of the variable to merge two data sets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Change-the-order-of-the-variable-to-merge-two-data-sets/m-p/729779#M227175</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/202329"&gt;@GN0001&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I posted the code and the log.&lt;/P&gt;
&lt;P&gt;Thanks for the response.&lt;/P&gt;
&lt;P&gt;Blue Sky&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;After so many posts it is still not clear what does not work.&lt;/P&gt;
&lt;P&gt;proc import reads the variable in the order they have in file it processes. The procedure has no parameters to change the order of variables. Btw. afaik only one procedure needs variables in a certain order: proc export. For anything else the order of variable is hardly relevant.&lt;/P&gt;</description>
      <pubDate>Mon, 29 Mar 2021 13:29:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Change-the-order-of-the-variable-to-merge-two-data-sets/m-p/729779#M227175</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2021-03-29T13:29:47Z</dc:date>
    </item>
    <item>
      <title>Re: Change the order of the variable to merge two data sets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Change-the-order-of-the-variable-to-merge-two-data-sets/m-p/729783#M227177</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/202329"&gt;@GN0001&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I posted the code and the log.&lt;/P&gt;
&lt;P&gt;Thanks for the response.&lt;/P&gt;
&lt;P&gt;Blue Sky&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;The log you posted does not show errors. You need to post a log that shows the ERRORs you mentioned in your first post. That is what we need to see.&lt;/P&gt;</description>
      <pubDate>Mon, 29 Mar 2021 13:33:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Change-the-order-of-the-variable-to-merge-two-data-sets/m-p/729783#M227177</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-03-29T13:33:53Z</dc:date>
    </item>
    <item>
      <title>Re: Change the order of the variable to merge two data sets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Change-the-order-of-the-variable-to-merge-two-data-sets/m-p/729803#M227183</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/202329"&gt;@GN0001&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;Hello ballardw,&lt;BR /&gt;Thanks for the response. It is interesting to know these codes. The first one gave me an error and I am not able to fix it.&lt;BR /&gt;The second one created a data set which is different than mine.&lt;BR /&gt;I use merge to append the data sets and I think the order of variable are important.&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;&lt;FONT size="5"&gt; The data type is not important because I heard that SAS accepts mixed data types in one variable.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;I posted my code and my log any way. The code doesn't arrange the variables on the order that I need for merging.&lt;BR /&gt;I might get a job to write SAS programming. It has been for two days that I am trying to merge to data sets and even my proc sort doesn't sort properly. I told them that I don't have any experience and I am working on it. If if is going to be this hard and challenging, I am going to let this job go.&lt;BR /&gt;Regards,&lt;BR /&gt;Blue Sky&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Highlighted text is false, at least once data is in a SAS data set. One example that creates two data sets with the same named variable of different types. Note the error when combining data.&lt;/P&gt;
&lt;PRE&gt;12   data one;
13      x='1';
14   run;

NOTE: The data set WORK.ONE has 1 observations and 1 variables.
NOTE: DATA statement used (Total process time):
      real time           0.01 seconds
      cpu time            0.00 seconds


15
16   data two;
17      x=1;
18   run;

NOTE: The data set WORK.TWO has 1 observations and 1 variables.
NOTE: DATA statement used (Total process time):
      real time           0.01 seconds
      cpu time            0.01 seconds


19
20   data combined;
21     set one two;
ERROR: Variable x has been defined as both character and numeric.
22   run;

NOTE: The SAS System stopped processing this step because of errors.
WARNING: The data set WORK.COMBINED may be incomplete.  When this step was stopped there were 0
         observations and 1 variables.
&lt;/PRE&gt;
&lt;P&gt;SAS will assign one of two variable types when reading data: character or numeric. There is no "mixed" data type.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And an example of different length variables.&lt;/P&gt;
&lt;PRE&gt;24   data three;
25      x='a longer value for x';
26   run;

NOTE: The data set WORK.THREE has 1 observations and 1 variables.
NOTE: DATA statement used (Total process time):
      real time           0.01 seconds
      cpu time            0.00 seconds


27
28   data combined2;
29     set one three;
30   run;

WARNING: Multiple lengths were specified for the variable x by input data set(s). This can cause
         truncation of data.
NOTE: There were 1 observations read from the data set WORK.ONE.
NOTE: There were 1 observations read from the data set WORK.THREE.
NOTE: The data set WORK.COMBINED2 has 2 observations and 1 variables.

&lt;/PRE&gt;
&lt;P&gt;When you look at combined2 data set you will see the values of x are '1' and 'a'.&lt;/P&gt;
&lt;P&gt;So it is critical to look at your log when combining data sets for messages like the "defined as both character and numeric" as that is an error and the "multiple lengths" can mean the your data is truncated.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Which is why showing a LOG is important when we ask for one. It is clear in the two examples what could be a couple of the "didn't work" scenarios.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 29 Mar 2021 14:21:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Change-the-order-of-the-variable-to-merge-two-data-sets/m-p/729803#M227183</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-03-29T14:21:49Z</dc:date>
    </item>
    <item>
      <title>Re: Change the order of the variable to merge two data sets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Change-the-order-of-the-variable-to-merge-two-data-sets/m-p/729811#M227186</link>
      <description>&lt;P&gt;This code as posted cannot work.&amp;nbsp; In the PROC IMPORT steps you are telling it NOT to use the first row in the spreadsheet as the names of the variables.&amp;nbsp; So there cannot be a variable named&amp;nbsp;&lt;SPAN&gt;Acc_number in either SAS dataset.&amp;nbsp; When you tell PROC IMPORT that the source does not include names it will either name the variables A, B, C, .... or VAR1, VAR2, VAR3, ... depending on the type of DBMS you are reading from.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;PROC IMPORT does not support the INPUT statement.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Are you sure your assignment is to read from an XLSX file?&amp;nbsp; Perhaps you are instead supposed to be reading from text files, like comma separated values (aka CSV) files?&amp;nbsp; In that case uses a data step and not proc import to read the file. Then you can have complete control over the names, types, length and even the order of the variables.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 29 Mar 2021 14:57:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Change-the-order-of-the-variable-to-merge-two-data-sets/m-p/729811#M227186</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-03-29T14:57:37Z</dc:date>
    </item>
  </channel>
</rss>

