<?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 copy rows of a SAS data table on an iterative manner? in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/how-to-copy-rows-of-a-SAS-data-table-on-an-iterative-manner/m-p/55017#M15294</link>
    <description>This task can be accomplished with  DATA step programming in SAS.  You have available to you (and it's free!) a vast amount of supplemental sample code, SAS-hosted DOC, and technical / conference topic material available to you at the SAS support &lt;A href="http://support.sas.com/" target="_blank"&gt;http://support.sas.com/&lt;/A&gt;  website, in addition to the SAS discussion forum archives.  Suggest you consider starting with the available SAS documentation, to build upon a SAS DATA step approach, adding IF &lt;EXPRESSION&gt; / THEN &lt;ASSIGNMENT&gt;;  logic, with INPUT statement to read up your file (if not already in SAS), and use OUTPUT statement logic as needed.&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.&lt;BR /&gt;
&lt;BR /&gt;
Suggested Google advanced search arguments, this topic / post:&lt;BR /&gt;
&lt;BR /&gt;
data step programming introduction site:sas.com&lt;BR /&gt;
&lt;BR /&gt;
step by step programming site:sas.com&lt;BR /&gt;
&lt;BR /&gt;
sas programming examples site:sas.com&lt;/ASSIGNMENT&gt;&lt;/EXPRESSION&gt;</description>
    <pubDate>Fri, 23 Jul 2010 16:37:33 GMT</pubDate>
    <dc:creator>sbb</dc:creator>
    <dc:date>2010-07-23T16:37:33Z</dc:date>
    <item>
      <title>how to copy rows of a SAS data table on an iterative manner?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/how-to-copy-rows-of-a-SAS-data-table-on-an-iterative-manner/m-p/55016#M15293</link>
      <description>Hi all,&lt;BR /&gt;
&lt;BR /&gt;
I am a beginner on SAS and need your help.&lt;BR /&gt;
&lt;BR /&gt;
I have a dataset consisting of 100 observations and 3 variables, where these three variables take a value of either 0 or 1 (they are binary). Suppose these three variables are v1, v2, and v3 respectively. I want to update my table considering the following conditions (where the column v4 has been created in advance): &lt;BR /&gt;
&lt;BR /&gt;
For each single observation, I want to repeat the following action (beginning with the first one until the last observation):&lt;BR /&gt;
&lt;BR /&gt;
Step1: Copy the row and paste it to the end of the table. If v1 is 0, assign 0 to v4  and jump to the next step. If v1 is 1, assign 1 to v4 and skip all the remaining steps (jump to the next observation).&lt;BR /&gt;
&lt;BR /&gt;
Step2: Copy the row and paste it to the end of the table. If v2 is 0, assign 0 to v4 and jump to the next step. If v2 is 1, assign 1 to v4 and skip all the remaining steps (jump to the next observation).&lt;BR /&gt;
&lt;BR /&gt;
Step3: Copy the row and paste it to the end of the table. If v3 is 0, assign 0 to v4 else assign 1 to v4. Jump to the next observation.&lt;BR /&gt;
&lt;BR /&gt;
After the copy-paste operations, I also want to get rid off the first 100 rows (those rows which constitute the raw data).&lt;BR /&gt;
&lt;BR /&gt;
I thank you in advance for your support. I hope that I did explain my problem explicitly.&lt;BR /&gt;
&lt;BR /&gt;
Umut&lt;BR /&gt;
&lt;BR /&gt;
Message was edited by: umutari

Message was edited by: umutari</description>
      <pubDate>Fri, 23 Jul 2010 16:03:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/how-to-copy-rows-of-a-SAS-data-table-on-an-iterative-manner/m-p/55016#M15293</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2010-07-23T16:03:49Z</dc:date>
    </item>
    <item>
      <title>Re: how to copy rows of a SAS data table on an iterative manner?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/how-to-copy-rows-of-a-SAS-data-table-on-an-iterative-manner/m-p/55017#M15294</link>
      <description>This task can be accomplished with  DATA step programming in SAS.  You have available to you (and it's free!) a vast amount of supplemental sample code, SAS-hosted DOC, and technical / conference topic material available to you at the SAS support &lt;A href="http://support.sas.com/" target="_blank"&gt;http://support.sas.com/&lt;/A&gt;  website, in addition to the SAS discussion forum archives.  Suggest you consider starting with the available SAS documentation, to build upon a SAS DATA step approach, adding IF &lt;EXPRESSION&gt; / THEN &lt;ASSIGNMENT&gt;;  logic, with INPUT statement to read up your file (if not already in SAS), and use OUTPUT statement logic as needed.&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.&lt;BR /&gt;
&lt;BR /&gt;
Suggested Google advanced search arguments, this topic / post:&lt;BR /&gt;
&lt;BR /&gt;
data step programming introduction site:sas.com&lt;BR /&gt;
&lt;BR /&gt;
step by step programming site:sas.com&lt;BR /&gt;
&lt;BR /&gt;
sas programming examples site:sas.com&lt;/ASSIGNMENT&gt;&lt;/EXPRESSION&gt;</description>
      <pubDate>Fri, 23 Jul 2010 16:37:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/how-to-copy-rows-of-a-SAS-data-table-on-an-iterative-manner/m-p/55017#M15294</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2010-07-23T16:37:33Z</dc:date>
    </item>
    <item>
      <title>Re: how to copy rows of a SAS data table on an iterative manner?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/how-to-copy-rows-of-a-SAS-data-table-on-an-iterative-manner/m-p/55018#M15295</link>
      <description>Hi,&lt;BR /&gt;
&lt;BR /&gt;
As far as I understood  you question, the below code may be helpful..&lt;BR /&gt;
&lt;BR /&gt;
data outputtablename;&lt;BR /&gt;
set inputtablename;&lt;BR /&gt;
if (v1=0 or v2=0 or v3=0) then v4=0;&lt;BR /&gt;
if (v1=1 or v2=1 or v3=1) then v4=1;&lt;BR /&gt;
run;</description>
      <pubDate>Sun, 25 Jul 2010 15:50:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/how-to-copy-rows-of-a-SAS-data-table-on-an-iterative-manner/m-p/55018#M15295</guid>
      <dc:creator>syam_india_kochi</dc:creator>
      <dc:date>2010-07-25T15:50:18Z</dc:date>
    </item>
  </channel>
</rss>

