<?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: [SAS Macro] Will the macro change data's order in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/SAS-Macro-Will-the-macro-change-data-s-order/m-p/300051#M63336</link>
    <description>&lt;P&gt;So, the question is, which ERROR are you getting?&lt;/P&gt;
&lt;P&gt;And can you supply some test data (&lt;A href="http://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;in a data step&lt;/A&gt;) so we can reproduce the behaviour?&lt;/P&gt;</description>
    <pubDate>Thu, 22 Sep 2016 08:12:38 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2016-09-22T08:12:38Z</dc:date>
    <item>
      <title>[SAS Macro] Will the macro change data's order</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Macro-Will-the-macro-change-data-s-order/m-p/300042#M63331</link>
      <description>&lt;P&gt;Under Enterprise Guide 7.11 (7.100.1.2711) 64 bit, with WIndows 7 SP1.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm using the following sas macro:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%macro a(factor)&lt;/P&gt;&lt;P&gt;data input;&lt;/P&gt;&lt;P&gt;informat &amp;amp;factor._C best12.;&lt;/P&gt;&lt;P&gt;set input;&lt;/P&gt;&lt;P&gt;&amp;amp;factor_C=&amp;amp;factor;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc univariate data=input;&lt;/P&gt;&lt;P&gt;var &amp;amp;factor._C;&lt;/P&gt;&lt;P&gt;histogram &amp;amp;factor._C/normal(noprint) cbarline=grey;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;%mend;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It worked properly, but in the log, it returns me the error with the wrong column (compared to the original dataset input).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ex:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;the observation's column was 257 (which has the issue), but the log of the macro returns my column 27 (which doesn't have an issue).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So, why does this macro change the order of my observations? Or does the macro change the order in general?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Thu, 22 Sep 2016 07:35:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Macro-Will-the-macro-change-data-s-order/m-p/300042#M63331</guid>
      <dc:creator>JinZhou</dc:creator>
      <dc:date>2016-09-22T07:35:14Z</dc:date>
    </item>
    <item>
      <title>Re: [SAS Macro] Will the macro change data's order</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Macro-Will-the-macro-change-data-s-order/m-p/300046#M63333</link>
      <description>&lt;P&gt;You are inconsistent in your question.&lt;/P&gt;
&lt;P&gt;Do ask about the order of the &lt;U&gt;columns&lt;/U&gt;, or the order of the &lt;U&gt;observations?&lt;/U&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Creating a new variable in a statement &lt;U&gt;after&lt;/U&gt; the set statement will have this new column appear last within the observations, naming it &lt;U&gt;before&lt;/U&gt; the set statement will put it first in the PDV and therefore in the output dataset.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;A simple data step like yours will not change the order of &lt;U&gt;observations&lt;/U&gt;.&lt;/P&gt;</description>
      <pubDate>Thu, 22 Sep 2016 07:52:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Macro-Will-the-macro-change-data-s-order/m-p/300046#M63333</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2016-09-22T07:52:46Z</dc:date>
    </item>
    <item>
      <title>Re: [SAS Macro] Will the macro change data's order</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Macro-Will-the-macro-change-data-s-order/m-p/300050#M63335</link>
      <description>&lt;P&gt;Sorry about the messed up, I'm always a little bit messed up with the rows/columns with the observations/factors.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And yes, I'm asking about the rows/observations.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was wondering if this is because of the default ASC/DSC options with the new factors created in the macro?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Will this changed the order of my observations?(Since I added one new factors for all observations)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Jin&lt;/P&gt;</description>
      <pubDate>Thu, 22 Sep 2016 08:06:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Macro-Will-the-macro-change-data-s-order/m-p/300050#M63335</guid>
      <dc:creator>JinZhou</dc:creator>
      <dc:date>2016-09-22T08:06:34Z</dc:date>
    </item>
    <item>
      <title>Re: [SAS Macro] Will the macro change data's order</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-Macro-Will-the-macro-change-data-s-order/m-p/300051#M63336</link>
      <description>&lt;P&gt;So, the question is, which ERROR are you getting?&lt;/P&gt;
&lt;P&gt;And can you supply some test data (&lt;A href="http://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;in a data step&lt;/A&gt;) so we can reproduce the behaviour?&lt;/P&gt;</description>
      <pubDate>Thu, 22 Sep 2016 08:12:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-Macro-Will-the-macro-change-data-s-order/m-p/300051#M63336</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2016-09-22T08:12:38Z</dc:date>
    </item>
  </channel>
</rss>

