<?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: Multiple Lines into one line in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Multiple-Lines-into-one-line/m-p/326776#M72838</link>
    <description>&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/4954"&gt;@Astounding&lt;/a&gt;: How can I think up variable names if the number of variables needs to be detemined dynamically (depending on the frequency) of a particular value of the ID variable?</description>
    <pubDate>Mon, 23 Jan 2017 16:50:27 GMT</pubDate>
    <dc:creator>FK1</dc:creator>
    <dc:date>2017-01-23T16:50:27Z</dc:date>
    <item>
      <title>Multiple Lines into one line</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Multiple-Lines-into-one-line/m-p/326753#M72826</link>
      <description>&lt;P&gt;Hello Folks,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a sas table "HAVE", which has an ID variable in it&amp;nbsp; and several numeric as well as character variables. Now, I want for each value of ID exactly ONE obsservation in my output dataset "WANT". Here is an example. This is my "Have" dataset:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/6845iEFAE8676EE1DAA0C/image-size/large?v=1.0&amp;amp;px=-1" alt="Have.JPG" title="Have.JPG" border="0" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And this is what I want as output:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/6847iD0BCF2B0DA343F13/image-size/original?v=1.0&amp;amp;px=-1" alt="want.JPG" title="want.JPG" border="0" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does anybody have an idea how I get this output?&lt;/P&gt;&lt;P&gt;Thanks in advance Folks!&lt;/P&gt;</description>
      <pubDate>Mon, 23 Jan 2017 15:47:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Multiple-Lines-into-one-line/m-p/326753#M72826</guid>
      <dc:creator>FK1</dc:creator>
      <dc:date>2017-01-23T15:47:59Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple Lines into one line</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Multiple-Lines-into-one-line/m-p/326755#M72827</link>
      <description>&lt;P&gt;Use PROC TRANSPOSE &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;reading this should give you the answer:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.ats.ucla.edu/stat/sas/modules/ltow_transpose.htm" target="_blank"&gt;http://www.ats.ucla.edu/stat/sas/modules/ltow_transpose.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 23 Jan 2017 15:50:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Multiple-Lines-into-one-line/m-p/326755#M72827</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2017-01-23T15:50:28Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple Lines into one line</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Multiple-Lines-into-one-line/m-p/326759#M72829</link>
      <description>&lt;P&gt;What will you do with the resulting data? Or is the result supposed to be a report of some kind?&lt;/P&gt;
&lt;P&gt;What you are doing is often referred as going from long to wide format. The long format is often easier for many operations as you know how many variables to process for each record. The wide format often has issues with varying numbers of Variable1 values that can get a bit challenging to do anything with.&lt;/P&gt;</description>
      <pubDate>Mon, 23 Jan 2017 15:59:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Multiple-Lines-into-one-line/m-p/326759#M72829</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-01-23T15:59:18Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple Lines into one line</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Multiple-Lines-into-one-line/m-p/326763#M72832</link>
      <description>Hi ballardw,&lt;BR /&gt;&lt;BR /&gt;you are exactly pointing out the issue of using wide format. However in the aboce mentioned case I do not want to further use the data in order to calcualte anything. But I want to merge the "Want" dataset with the "ID" as a unique key onto another dataset. Therefore I do not want to have repeating by values in the "ID" variable.....</description>
      <pubDate>Mon, 23 Jan 2017 16:05:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Multiple-Lines-into-one-line/m-p/326763#M72832</guid>
      <dc:creator>FK1</dc:creator>
      <dc:date>2017-01-23T16:05:19Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple Lines into one line</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Multiple-Lines-into-one-line/m-p/326774#M72837</link>
      <description>&lt;P&gt;For each new column you create, you will need to think up a variable name.&amp;nbsp; SAS doesn't let you keep data within a data set unless there is a variable name attached to it.&amp;nbsp; If you spell out what the variable names should be, the rest is relatively easy.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 23 Jan 2017 16:41:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Multiple-Lines-into-one-line/m-p/326774#M72837</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2017-01-23T16:41:50Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple Lines into one line</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Multiple-Lines-into-one-line/m-p/326776#M72838</link>
      <description>&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/4954"&gt;@Astounding&lt;/a&gt;: How can I think up variable names if the number of variables needs to be detemined dynamically (depending on the frequency) of a particular value of the ID variable?</description>
      <pubDate>Mon, 23 Jan 2017 16:50:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Multiple-Lines-into-one-line/m-p/326776#M72838</guid>
      <dc:creator>FK1</dc:creator>
      <dc:date>2017-01-23T16:50:27Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple Lines into one line</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Multiple-Lines-into-one-line/m-p/326781#M72842</link>
      <description>&lt;P&gt;You have to have names for each variable.&amp;nbsp; There is no way around it.&amp;nbsp; However, you don't necessarily need to know all the names ahead of time.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;One usual way would use PROC TRANSPOSE to follow this plan ...&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Take a variable named TEXT, and from it create TEXT1, TEXT2, TEXT3, etc. (as many as needed).&amp;nbsp; TEXT3 might be blank for some IDs if that ID only started with 2 observations.&amp;nbsp; This plan is compatible with the way PROC TRANSPOSE would handle the problem.&amp;nbsp; You don't know how many variables would be created, and you don't have to know.&amp;nbsp; You only have to agree that the original variable name, with a numbered suffix added, would fit your needs here.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 23 Jan 2017 18:26:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Multiple-Lines-into-one-line/m-p/326781#M72842</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2017-01-23T18:26:14Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple Lines into one line</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Multiple-Lines-into-one-line/m-p/327098#M72942</link>
      <description>&lt;P&gt;Thank you all very much for your comments.&lt;/P&gt;</description>
      <pubDate>Tue, 24 Jan 2017 16:10:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Multiple-Lines-into-one-line/m-p/327098#M72942</guid>
      <dc:creator>FK1</dc:creator>
      <dc:date>2017-01-24T16:10:31Z</dc:date>
    </item>
  </channel>
</rss>

