<?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: Create a variable with two rows for each row in another variable in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Create-a-variable-with-two-rows-for-each-row-in-another-variable/m-p/702788#M25945</link>
    <description>&lt;P&gt;Thanks a lot for your quick reply!&lt;/P&gt;&lt;P&gt;The code that you have suggested worked for both this issue and another table that I was having trouble creating&lt;/P&gt;</description>
    <pubDate>Tue, 01 Dec 2020 12:27:49 GMT</pubDate>
    <dc:creator>mariapf</dc:creator>
    <dc:date>2020-12-01T12:27:49Z</dc:date>
    <item>
      <title>Create a variable with two rows for each row in another variable</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Create-a-variable-with-two-rows-for-each-row-in-another-variable/m-p/702770#M25943</link>
      <description>&lt;P&gt;Hello all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a task that I am having trouble carrying out being a SAS novice but it may be simple after all.&lt;/P&gt;&lt;P&gt;I have some curve names and for each of them I have to create a variable containing two points of the curve. The names of the points are simple to create using a cat function but I cannot figure out how to program an efficient process that creates a new variable with two observations for each observation in the input variable.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thus, in my input table I have:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;CURVE&lt;/P&gt;&lt;P&gt;curve1&lt;/P&gt;&lt;P&gt;curve2&lt;/P&gt;&lt;P&gt;curve3&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And I need:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;CURVE_POINT&lt;/P&gt;&lt;P&gt;curve1_0&lt;/P&gt;&lt;P&gt;curve1_1200&lt;/P&gt;&lt;P&gt;curve2_0&lt;/P&gt;&lt;P&gt;curve2_1200&lt;/P&gt;&lt;P&gt;curve3_0&lt;/P&gt;&lt;P&gt;curve3_1200&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Should I do this with a loop? If so, how do I specify the need to do the loop for all rows of the curve variable? Counting the number of rows seems to be not so simple in SAS...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you so much for your time, it is not easy to be starting out in SAS programming.&lt;/P&gt;</description>
      <pubDate>Tue, 01 Dec 2020 10:09:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Create-a-variable-with-two-rows-for-each-row-in-another-variable/m-p/702770#M25943</guid>
      <dc:creator>mariapf</dc:creator>
      <dc:date>2020-12-01T10:09:09Z</dc:date>
    </item>
    <item>
      <title>Re: Create a variable with two rows for each row in another variable</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Create-a-variable-with-two-rows-for-each-row-in-another-variable/m-p/702772#M25944</link>
      <description>&lt;P&gt;Try this&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input CURVE $;
datalines;
curve1
curve2
curve3
;

data want(drop = point);
   set have;
   do point = 1, 1200;
      curve_point = catx('_', curve, point);
      output;
   end;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 01 Dec 2020 10:13:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Create-a-variable-with-two-rows-for-each-row-in-another-variable/m-p/702772#M25944</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2020-12-01T10:13:07Z</dc:date>
    </item>
    <item>
      <title>Re: Create a variable with two rows for each row in another variable</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Create-a-variable-with-two-rows-for-each-row-in-another-variable/m-p/702788#M25945</link>
      <description>&lt;P&gt;Thanks a lot for your quick reply!&lt;/P&gt;&lt;P&gt;The code that you have suggested worked for both this issue and another table that I was having trouble creating&lt;/P&gt;</description>
      <pubDate>Tue, 01 Dec 2020 12:27:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Create-a-variable-with-two-rows-for-each-row-in-another-variable/m-p/702788#M25945</guid>
      <dc:creator>mariapf</dc:creator>
      <dc:date>2020-12-01T12:27:49Z</dc:date>
    </item>
  </channel>
</rss>

