<?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: Order of columns -create data set in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Order-of-columns-create-data-set/m-p/789895#M252837</link>
    <description>&lt;P&gt;Since the variable "transfer_description" is created first in the informat statement line, the order of the variables becomes transfer_description,ID,amount.&lt;/P&gt;
&lt;P&gt;To prevent this from happening, use the length statement first to define the variables.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
length id 8 transfer_description $200 amount 8;/* add this statement. */
infile datalines delimiter='|';
informat transfer_description $200.;
input ID  transfer_description  amount;
datalines;
111|Transfer to my friend Joe Kaplan|1000 
111|Salary IBM|2000
111|Salary WIZZ|3980
111|Transfer to my father|500
333|Transfer to my gf|4000
333|Son help|3000
222|Salary IBM|1500
222|Charity|2500
222|Charity|3000
222|transfer to my friend Jula|8000
;
Run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 13 Jan 2022 06:57:42 GMT</pubDate>
    <dc:creator>japelin</dc:creator>
    <dc:date>2022-01-13T06:57:42Z</dc:date>
    <item>
      <title>Order of columns -create data set</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Order-of-columns-create-data-set/m-p/789892#M252834</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;
&lt;P&gt;I am creating a data set .&lt;/P&gt;
&lt;P&gt;Why the order of columns is :&amp;nbsp;transfer_description,ID,amount&amp;nbsp;&lt;/P&gt;
&lt;P&gt;and not: ID ,transfer_description,amount?&lt;/P&gt;
&lt;P&gt;How can I change the order without using Retain?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
infile datalines delimiter='|';
informat transfer_description $200.;
input ID  transfer_description  amount;
datalines;
111|Transfer to my friend Joe Kaplan|1000 
111|Salary IBM|2000
111|Salary WIZZ|3980
111|Transfer to my father|500
333|Transfer to my gf|4000
333|Son help|3000
222|Salary IBM|1500
222|Charity|2500
222|Charity|3000
222|transfer to my friend Jula|8000
;
Run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 13 Jan 2022 06:44:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Order-of-columns-create-data-set/m-p/789892#M252834</guid>
      <dc:creator>Ronein</dc:creator>
      <dc:date>2022-01-13T06:44:38Z</dc:date>
    </item>
    <item>
      <title>Re: Order of columns -create data set</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Order-of-columns-create-data-set/m-p/789895#M252837</link>
      <description>&lt;P&gt;Since the variable "transfer_description" is created first in the informat statement line, the order of the variables becomes transfer_description,ID,amount.&lt;/P&gt;
&lt;P&gt;To prevent this from happening, use the length statement first to define the variables.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
length id 8 transfer_description $200 amount 8;/* add this statement. */
infile datalines delimiter='|';
informat transfer_description $200.;
input ID  transfer_description  amount;
datalines;
111|Transfer to my friend Joe Kaplan|1000 
111|Salary IBM|2000
111|Salary WIZZ|3980
111|Transfer to my father|500
333|Transfer to my gf|4000
333|Son help|3000
222|Salary IBM|1500
222|Charity|2500
222|Charity|3000
222|transfer to my friend Jula|8000
;
Run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 13 Jan 2022 06:57:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Order-of-columns-create-data-set/m-p/789895#M252837</guid>
      <dc:creator>japelin</dc:creator>
      <dc:date>2022-01-13T06:57:42Z</dc:date>
    </item>
    <item>
      <title>Re: Order of columns -create data set</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Order-of-columns-create-data-set/m-p/789903#M252843</link>
      <description>&lt;P&gt;The order of variables in the PDV is determined by the order in which the variables are encountered by the data step compiler, so transfer_description is first.&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jan 2022 07:07:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Order-of-columns-create-data-set/m-p/789903#M252843</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2022-01-13T07:07:33Z</dc:date>
    </item>
  </channel>
</rss>

