<?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: How to transform a column of a file in different lines in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-transform-a-column-of-a-file-in-different-lines/m-p/508547#M136588</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/243288"&gt;@Maider&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I have a DO loop where I obtain a value and I write it&amp;nbsp; in a different file, so I obtain something like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1 0&lt;BR /&gt;1 63&lt;BR /&gt;1 41&lt;BR /&gt;2 39&lt;BR /&gt;2 84&lt;BR /&gt;2 105&lt;BR /&gt;3 87&lt;BR /&gt;3 117&lt;BR /&gt;3 105&lt;/P&gt;
&lt;P&gt;4 147&lt;BR /&gt;4 74&lt;BR /&gt;4 14&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How can I separate this second column in different lines to obtain another file like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1 0&amp;nbsp;63&amp;nbsp;41&lt;BR /&gt;2 39&amp;nbsp;84&amp;nbsp;105&lt;/P&gt;
&lt;P&gt;3 87&amp;nbsp;117&amp;nbsp;105&lt;/P&gt;
&lt;P&gt;4 147&amp;nbsp;74&amp;nbsp;14&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;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;It would really help to show the code you used as it is very likely to be a simple modification of that.&lt;/P&gt;
&lt;P&gt;By "file" do you mean a SAS data set or an external text file or similar?&lt;/P&gt;</description>
    <pubDate>Mon, 29 Oct 2018 23:48:51 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2018-10-29T23:48:51Z</dc:date>
    <item>
      <title>How to transform a column of a file in different lines</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-transform-a-column-of-a-file-in-different-lines/m-p/508488#M136568</link>
      <description>&lt;P&gt;I have a DO loop where I obtain a value and I write it&amp;nbsp; in a different file, so I obtain something like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1 0&lt;BR /&gt;1 63&lt;BR /&gt;1 41&lt;BR /&gt;2 39&lt;BR /&gt;2 84&lt;BR /&gt;2 105&lt;BR /&gt;3 87&lt;BR /&gt;3 117&lt;BR /&gt;3 105&lt;/P&gt;&lt;P&gt;4 147&lt;BR /&gt;4 74&lt;BR /&gt;4 14&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can I separate this second column in different lines to obtain another file like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1 0&amp;nbsp;63&amp;nbsp;41&lt;BR /&gt;2 39&amp;nbsp;84&amp;nbsp;105&lt;/P&gt;&lt;P&gt;3 87&amp;nbsp;117&amp;nbsp;105&lt;/P&gt;&lt;P&gt;4 147&amp;nbsp;74&amp;nbsp;14&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;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 29 Oct 2018 19:42:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-transform-a-column-of-a-file-in-different-lines/m-p/508488#M136568</guid>
      <dc:creator>Maider</dc:creator>
      <dc:date>2018-10-29T19:42:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to transform a column of a file in different lines</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-transform-a-column-of-a-file-in-different-lines/m-p/508489#M136569</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input var var2;
cards;
1 0
1 63
1 41
2 39
2 84
2 105
3 87
3 117
3 105
4 147
4 74
4 14
;

proc transpose data=have out=want;
by var;
var var2;
run;

&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;straight forward proc transpose&lt;/P&gt;</description>
      <pubDate>Mon, 29 Oct 2018 19:45:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-transform-a-column-of-a-file-in-different-lines/m-p/508489#M136569</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-10-29T19:45:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to transform a column of a file in different lines</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-transform-a-column-of-a-file-in-different-lines/m-p/508522#M136577</link>
      <description>&lt;P&gt;If it's raw data and always comes in 3-line sets for each id, you can use some of the features of the INPUT statement:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have (drop=_:);
  input var1 var2_1 / _dummy var2_2 / _dummy var2_3;
cards;
1 0
1 63
1 41
2 39
2 84
2 105
3 87
3 117
3 105
4 147
4 74
4 14
;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The '/' tells the input statement to go to the next line.&amp;nbsp; The variable _DUMMY, which is dropped from the output,&amp;nbsp;is read as the first value of lines 2 and 3.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If it's already a SAS data set, then use the proc transpose as per &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/138205"&gt;@novinosrin&lt;/a&gt;'s suggestion.&lt;/P&gt;</description>
      <pubDate>Mon, 29 Oct 2018 21:32:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-transform-a-column-of-a-file-in-different-lines/m-p/508522#M136577</guid>
      <dc:creator>mkeintz</dc:creator>
      <dc:date>2018-10-29T21:32:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to transform a column of a file in different lines</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-transform-a-column-of-a-file-in-different-lines/m-p/508547#M136588</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/243288"&gt;@Maider&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I have a DO loop where I obtain a value and I write it&amp;nbsp; in a different file, so I obtain something like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1 0&lt;BR /&gt;1 63&lt;BR /&gt;1 41&lt;BR /&gt;2 39&lt;BR /&gt;2 84&lt;BR /&gt;2 105&lt;BR /&gt;3 87&lt;BR /&gt;3 117&lt;BR /&gt;3 105&lt;/P&gt;
&lt;P&gt;4 147&lt;BR /&gt;4 74&lt;BR /&gt;4 14&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How can I separate this second column in different lines to obtain another file like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1 0&amp;nbsp;63&amp;nbsp;41&lt;BR /&gt;2 39&amp;nbsp;84&amp;nbsp;105&lt;/P&gt;
&lt;P&gt;3 87&amp;nbsp;117&amp;nbsp;105&lt;/P&gt;
&lt;P&gt;4 147&amp;nbsp;74&amp;nbsp;14&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;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;It would really help to show the code you used as it is very likely to be a simple modification of that.&lt;/P&gt;
&lt;P&gt;By "file" do you mean a SAS data set or an external text file or similar?&lt;/P&gt;</description>
      <pubDate>Mon, 29 Oct 2018 23:48:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-transform-a-column-of-a-file-in-different-lines/m-p/508547#M136588</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-10-29T23:48:51Z</dc:date>
    </item>
  </channel>
</rss>

