<?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: separate dataset with 1 column into different columns in SAS Data Management</title>
    <link>https://communities.sas.com/t5/SAS-Data-Management/separate-dataset-with-1-column-into-different-columns/m-p/442476#M13655</link>
    <description>&lt;P&gt;I appreciate Reeza but I have 1.5 million observation. It makes SAS slower if I past all the observations as a dateline in the code.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There should be some other way as well.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
    <pubDate>Mon, 05 Mar 2018 19:01:21 GMT</pubDate>
    <dc:creator>runn</dc:creator>
    <dc:date>2018-03-05T19:01:21Z</dc:date>
    <item>
      <title>separate dataset with 1 column into different columns</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/separate-dataset-with-1-column-into-different-columns/m-p/442168#M13641</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;I have ad a data with observations as:&lt;/P&gt;&lt;P&gt;2160048011442.293800000 -87.951300000&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i want to separate each observation into different variable colums&lt;/P&gt;&lt;P&gt;2#1#60048#0#11#4#42.293800000 #-87.951300000# (DATA do NOT have this "#"). I cannot put this # for each observation as there are millions of observations.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;var 1&lt;BR /&gt;1-1 (position)&lt;BR /&gt;1 (length)&lt;BR /&gt;var2&lt;BR /&gt;2-2&lt;BR /&gt;1&lt;BR /&gt;var3&lt;BR /&gt;3-7&lt;BR /&gt;5&lt;BR /&gt;var4&lt;BR /&gt;8-8&lt;BR /&gt;1&lt;BR /&gt;var5&lt;BR /&gt;9-10&lt;BR /&gt;2&lt;BR /&gt;var6&lt;BR /&gt;11-11&lt;BR /&gt;1&lt;BR /&gt;var7&lt;BR /&gt;12-24&lt;BR /&gt;13.7&lt;BR /&gt;var8&lt;BR /&gt;25-37&lt;BR /&gt;13.7&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;how should I code?&lt;/P&gt;&lt;P&gt;I appreciate your input.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;</description>
      <pubDate>Sun, 04 Mar 2018 19:53:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/separate-dataset-with-1-column-into-different-columns/m-p/442168#M13641</guid>
      <dc:creator>runn</dc:creator>
      <dc:date>2018-03-04T19:53:44Z</dc:date>
    </item>
    <item>
      <title>Re: separate dataset with 1 column into different columns</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/separate-dataset-with-1-column-into-different-columns/m-p/442176#M13642</link>
      <description>&lt;P&gt;You likely have what's known as a fixed width file.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Assuming your record layout as posted, try the following, tested code:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
infile cards;
input  var1  1-1
       var2  2-2  
       var3  3-7
       var4  8-8
       var5  9-10
       var6  11-11
       var7  12-24
       var8  25-37;
cards;
2160048011442.293800000 -87.951300000
;;;;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/196926"&gt;@runn&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;I have ad a data with observations as:&lt;/P&gt;
&lt;P&gt;2160048011442.293800000 -87.951300000&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;i want to separate each observation into different variable colums&lt;/P&gt;
&lt;P&gt;2#1#60048#0#11#4#42.293800000 #-87.951300000# (DATA do NOT have this "#"). I cannot put this # for each observation as there are millions of observations.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;var 1&lt;BR /&gt;1-1 (position)&lt;BR /&gt;1 (length)&lt;BR /&gt;var2&lt;BR /&gt;2-2&lt;BR /&gt;1&lt;BR /&gt;var3&lt;BR /&gt;3-7&lt;BR /&gt;5&lt;BR /&gt;var4&lt;BR /&gt;8-8&lt;BR /&gt;1&lt;BR /&gt;var5&lt;BR /&gt;9-10&lt;BR /&gt;2&lt;BR /&gt;var6&lt;BR /&gt;11-11&lt;BR /&gt;1&lt;BR /&gt;var7&lt;BR /&gt;12-24&lt;BR /&gt;13.7&lt;BR /&gt;var8&lt;BR /&gt;25-37&lt;BR /&gt;13.7&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;how should I code?&lt;/P&gt;
&lt;P&gt;I appreciate your input.&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 04 Mar 2018 20:38:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/separate-dataset-with-1-column-into-different-columns/m-p/442176#M13642</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-03-04T20:38:27Z</dc:date>
    </item>
    <item>
      <title>Re: separate dataset with 1 column into different columns</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/separate-dataset-with-1-column-into-different-columns/m-p/442476#M13655</link>
      <description>&lt;P&gt;I appreciate Reeza but I have 1.5 million observation. It makes SAS slower if I past all the observations as a dateline in the code.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There should be some other way as well.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Mon, 05 Mar 2018 19:01:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/separate-dataset-with-1-column-into-different-columns/m-p/442476#M13655</guid>
      <dc:creator>runn</dc:creator>
      <dc:date>2018-03-05T19:01:21Z</dc:date>
    </item>
    <item>
      <title>Re: separate dataset with 1 column into different columns</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/separate-dataset-with-1-column-into-different-columns/m-p/442478#M13656</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/196926"&gt;@runn&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;I appreciate Reeza but I have 1.5 million observation. It makes SAS slower if I past all the observations as a dateline in the code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There should be some other way as well.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Why would you post the data lines in the code????&lt;/P&gt;
&lt;P&gt;If you have the data in a text file then use a INFILE statement to tell SAS where to read the data.&lt;/P&gt;
&lt;P&gt;Reeza's example is just to show you how your INPUT statement should look based on your description of your record layout.&lt;/P&gt;</description>
      <pubDate>Mon, 05 Mar 2018 19:08:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/separate-dataset-with-1-column-into-different-columns/m-p/442478#M13656</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2018-03-05T19:08:36Z</dc:date>
    </item>
  </channel>
</rss>

