<?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 column order in output in Developers</title>
    <link>https://communities.sas.com/t5/Developers/Change-column-order-in-output/m-p/2259#M1624</link>
    <description>Brilliant thanks Oliver. Obviously, you gave the right answer but got distracted when you wrote out the code (LENGTH rather than LABEL).&lt;BR /&gt;
&lt;BR /&gt;
I appreciate that a lot &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;</description>
    <pubDate>Wed, 07 Feb 2007 12:31:27 GMT</pubDate>
    <dc:creator>deleted_user</dc:creator>
    <dc:date>2007-02-07T12:31:27Z</dc:date>
    <item>
      <title>Change column order in output</title>
      <link>https://communities.sas.com/t5/Developers/Change-column-order-in-output/m-p/2257#M1622</link>
      <description>Hi&lt;BR /&gt;
&lt;BR /&gt;
No idea if this is the right place to put this - please let me know where if not.&lt;BR /&gt;
&lt;BR /&gt;
New to SAS (new gig, new tools). I am trying to adjust a macro that takes input from a delimited, variable length file and spits it into a SAS output file. I want to select a subset of columns and change the order. How might I do this please? Below indicative of what I am trying to do. I would like the output columns to be THATCOLUMN and then THISCOLUMN. Any help &lt;I&gt;very&lt;/I&gt; gratefully received.&lt;BR /&gt;
&lt;BR /&gt;
%macro test_macro (indset =, outdset =);&lt;BR /&gt;
	data	&amp;amp;outdset (keep = THATCOLUMN THISCOLUMN);&lt;BR /&gt;
	infile	&amp;amp;indset delimiter = '|' dsd truncover lrecl = 1500;&lt;BR /&gt;
	input	THISCOLUMN	:     	9.&lt;BR /&gt;
		THATCOLUMN	:	9.&lt;BR /&gt;
		ANOTHERCOLUMN	:	9.;&lt;BR /&gt;
	run;&lt;BR /&gt;
%mend test_macro;&lt;BR /&gt;
&lt;BR /&gt;
Thanks</description>
      <pubDate>Wed, 07 Feb 2007 10:54:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/Change-column-order-in-output/m-p/2257#M1622</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2007-02-07T10:54:31Z</dc:date>
    </item>
    <item>
      <title>Re: Change column order in output</title>
      <link>https://communities.sas.com/t5/Developers/Change-column-order-in-output/m-p/2258#M1623</link>
      <description>Just add a LABEL statement for your variable &lt;I&gt;between&lt;/I&gt; the DATA and the INFILE statement ; in that LABEL, give the names of the columns in the order that you want them at the end...&lt;BR /&gt;
&lt;BR /&gt;
%macro test_macro (indset =, outdset =);&lt;BR /&gt;
data &amp;amp;outdset (keep = THATCOLUMN THISCOLUMN);&lt;BR /&gt;
LENGTH THATCOLUMN = "That column" THISCOLUMN = "This column" ;&lt;BR /&gt;
infile &amp;amp;indset delimiter = '|' dsd truncover lrecl = 1500;&lt;BR /&gt;
input THISCOLUMN : 9.&lt;BR /&gt;
THATCOLUMN : 9.&lt;BR /&gt;
ANOTHERCOLUMN : 9.;&lt;BR /&gt;
run;&lt;BR /&gt;
%mend test_macro;</description>
      <pubDate>Wed, 07 Feb 2007 11:58:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/Change-column-order-in-output/m-p/2258#M1623</guid>
      <dc:creator>Olivier</dc:creator>
      <dc:date>2007-02-07T11:58:44Z</dc:date>
    </item>
    <item>
      <title>Re: Change column order in output</title>
      <link>https://communities.sas.com/t5/Developers/Change-column-order-in-output/m-p/2259#M1624</link>
      <description>Brilliant thanks Oliver. Obviously, you gave the right answer but got distracted when you wrote out the code (LENGTH rather than LABEL).&lt;BR /&gt;
&lt;BR /&gt;
I appreciate that a lot &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;</description>
      <pubDate>Wed, 07 Feb 2007 12:31:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/Change-column-order-in-output/m-p/2259#M1624</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2007-02-07T12:31:27Z</dc:date>
    </item>
  </channel>
</rss>

