<?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 How to add a new column to existing dataset in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-add-a-new-column-to-existing-dataset/m-p/438686#M109392</link>
    <description>&lt;P&gt;Hi, I'd like to add new variable to the existing dataset. Below attempt didn't work. I'll appreciate your help. Thanks in advance.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data data;
input county code;
datalines;
1	83	
1	83	
1	83	
1	83	
1	83	
1	83	
1	83	
1	83	
1	83	
;

data data1; 
input risk;
datalines;
0 0.0025 0.005 0.025 0.05 0.1 0.25 0.5 0.75
set data; 
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 20 Feb 2018 15:58:19 GMT</pubDate>
    <dc:creator>Cruise</dc:creator>
    <dc:date>2018-02-20T15:58:19Z</dc:date>
    <item>
      <title>How to add a new column to existing dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-add-a-new-column-to-existing-dataset/m-p/438686#M109392</link>
      <description>&lt;P&gt;Hi, I'd like to add new variable to the existing dataset. Below attempt didn't work. I'll appreciate your help. Thanks in advance.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data data;
input county code;
datalines;
1	83	
1	83	
1	83	
1	83	
1	83	
1	83	
1	83	
1	83	
1	83	
;

data data1; 
input risk;
datalines;
0 0.0025 0.005 0.025 0.05 0.1 0.25 0.5 0.75
set data; 
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Feb 2018 15:58:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-add-a-new-column-to-existing-dataset/m-p/438686#M109392</guid>
      <dc:creator>Cruise</dc:creator>
      <dc:date>2018-02-20T15:58:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to add a new column to existing dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-add-a-new-column-to-existing-dataset/m-p/438690#M109396</link>
      <description>&lt;P&gt;Here's a modified version of your code that should work as you intended:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data data1;
	set data; 
	input risk;
datalines;
0
0.0025
0.005
0.025
0.05
0.1
0.25
0.5
0.75
;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Two of the primary problems with your code were the orientation of the datalines data (if you want each value to be attached to a different observation, it needs to go on a new line) and the missing semi-colon after the datalines data was complete. The DATALINES statement is also intended to be used as the very last part of a data step.&lt;/P&gt;</description>
      <pubDate>Tue, 20 Feb 2018 16:06:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-add-a-new-column-to-existing-dataset/m-p/438690#M109396</guid>
      <dc:creator>GinaRepole</dc:creator>
      <dc:date>2018-02-20T16:06:21Z</dc:date>
    </item>
  </channel>
</rss>

