<?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: adding  new values to the variables in SAS Dataset in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/adding-new-values-to-the-variables-in-SAS-Dataset/m-p/74657#M21679</link>
    <description>Hello,&lt;BR /&gt;
&lt;BR /&gt;
I first exported the SAS dataset to Excel using the code:-&lt;BR /&gt;
&lt;BR /&gt;
Libname sc “C:\SAS”;&lt;BR /&gt;
PROC EXPORT DATA= sc.newdata&lt;BR /&gt;
	OUTFILE= "c:\CWA\newdata.xls"&lt;BR /&gt;
DBMS=EXCEL2000 REPLACE;&lt;BR /&gt;
RUN;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
There are 6 variables (A,B,C,D,E,F) and the length of is six. Although I could manually add new rows to this Excel sheet "newdata.xls", but is there a code that I could use in SAS that will add rows to this Excel sheet.&lt;BR /&gt;
&lt;BR /&gt;
Kindest regards,&lt;BR /&gt;
Kriti</description>
    <pubDate>Sat, 25 Sep 2010 06:21:09 GMT</pubDate>
    <dc:creator>deleted_user</dc:creator>
    <dc:date>2010-09-25T06:21:09Z</dc:date>
    <item>
      <title>adding  new values to the variables in SAS Dataset</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/adding-new-values-to-the-variables-in-SAS-Dataset/m-p/74655#M21677</link>
      <description>Hello All,&lt;BR /&gt;
&lt;BR /&gt;
I want to add new values to the variables in SAS Dataset. I used the code:-&lt;BR /&gt;
&lt;BR /&gt;
Assume that the SAS dataset in the location "C:SAS" so that when I open it it gets opened in the Tmp file. The SAS dataset is "star" and I used the code:-&lt;BR /&gt;
&lt;BR /&gt;
proc contents data=Tmp1.star;&lt;BR /&gt;
run; &lt;BR /&gt;
&lt;BR /&gt;
There are 6 variables in this dataste each of length 8, say , A,B,C,D,E,F. If I want to add 3 values to all 6 variables then what code will add the values to the SAS Dataset?&lt;BR /&gt;
&lt;BR /&gt;
Kindly guide.&lt;BR /&gt;
Kriti</description>
      <pubDate>Fri, 24 Sep 2010 19:56:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/adding-new-values-to-the-variables-in-SAS-Dataset/m-p/74655#M21677</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2010-09-24T19:56:14Z</dc:date>
    </item>
    <item>
      <title>Re: adding  new values to the variables in SAS Dataset</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/adding-new-values-to-the-variables-in-SAS-Dataset/m-p/74656#M21678</link>
      <description>"Adding new values" is a bit fuzzy. You can either "replace values of a variable" like:&lt;BR /&gt;
[pre]&lt;BR /&gt;
   /* append " Jr." at the end of name */&lt;BR /&gt;
   data juniors;&lt;BR /&gt;
     length name $30.;&lt;BR /&gt;
     set sashelp.class;&lt;BR /&gt;
     name = catx(" ", name, "Jr.");&lt;BR /&gt;
   run;&lt;BR /&gt;
   /* check */&lt;BR /&gt;
   proc print data=juniors;&lt;BR /&gt;
     var name;&lt;BR /&gt;
   run;&lt;BR /&gt;
   /* on lst&lt;BR /&gt;
  Obs       name&lt;BR /&gt;
    1    Alfred Jr. &lt;BR /&gt;
    2    Alice Jr.  &lt;BR /&gt;
    3    Barbara Jr.&lt;BR /&gt;
    4    Carol Jr.  &lt;BR /&gt;
    5    Henry Jr.  &lt;BR /&gt;
    6    James Jr.  &lt;BR /&gt;
    7    Jane Jr.   &lt;BR /&gt;
    8    Janet Jr.  &lt;BR /&gt;
    9    Jeffrey Jr.&lt;BR /&gt;
   10    John Jr.   &lt;BR /&gt;
   11    Joyce Jr.  &lt;BR /&gt;
   12    Judy Jr.   &lt;BR /&gt;
   13    Louise Jr. &lt;BR /&gt;
   14    Mary Jr.   &lt;BR /&gt;
   15    Philip Jr. &lt;BR /&gt;
   16    Robert Jr. &lt;BR /&gt;
   17    Ronald Jr. &lt;BR /&gt;
   18    Thomas Jr. &lt;BR /&gt;
   19    William Jr.&lt;BR /&gt;
   */&lt;BR /&gt;
[/pre]&lt;BR /&gt;
&lt;BR /&gt;
Or you can "append new observations" to a data set, like:&lt;BR /&gt;
[pre]&lt;BR /&gt;
   /* data set with two observations */&lt;BR /&gt;
   data names;&lt;BR /&gt;
     length name $8;&lt;BR /&gt;
     name = "Albert"; output;&lt;BR /&gt;
     name = "Becky"; output;&lt;BR /&gt;
   run;&lt;BR /&gt;
   /* append one more observation */&lt;BR /&gt;
   data anotherName;&lt;BR /&gt;
     length name $8;&lt;BR /&gt;
     name = "Cathy"; output;&lt;BR /&gt;
   run;&lt;BR /&gt;
   proc append base=names data=anotherName;&lt;BR /&gt;
   run;&lt;BR /&gt;
&lt;BR /&gt;
   /* check */&lt;BR /&gt;
   proc print data=names;&lt;BR /&gt;
   run;&lt;BR /&gt;
   /* on lst&lt;BR /&gt;
   Obs     name&lt;BR /&gt;
    1     Albert&lt;BR /&gt;
    2     Becky &lt;BR /&gt;
    3     Cathy &lt;BR /&gt;
   */&lt;BR /&gt;
[/pre]</description>
      <pubDate>Fri, 24 Sep 2010 20:25:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/adding-new-values-to-the-variables-in-SAS-Dataset/m-p/74656#M21678</guid>
      <dc:creator>chang_y_chung_hotmail_com</dc:creator>
      <dc:date>2010-09-24T20:25:14Z</dc:date>
    </item>
    <item>
      <title>Re: adding  new values to the variables in SAS Dataset</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/adding-new-values-to-the-variables-in-SAS-Dataset/m-p/74657#M21679</link>
      <description>Hello,&lt;BR /&gt;
&lt;BR /&gt;
I first exported the SAS dataset to Excel using the code:-&lt;BR /&gt;
&lt;BR /&gt;
Libname sc “C:\SAS”;&lt;BR /&gt;
PROC EXPORT DATA= sc.newdata&lt;BR /&gt;
	OUTFILE= "c:\CWA\newdata.xls"&lt;BR /&gt;
DBMS=EXCEL2000 REPLACE;&lt;BR /&gt;
RUN;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
There are 6 variables (A,B,C,D,E,F) and the length of is six. Although I could manually add new rows to this Excel sheet "newdata.xls", but is there a code that I could use in SAS that will add rows to this Excel sheet.&lt;BR /&gt;
&lt;BR /&gt;
Kindest regards,&lt;BR /&gt;
Kriti</description>
      <pubDate>Sat, 25 Sep 2010 06:21:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/adding-new-values-to-the-variables-in-SAS-Dataset/m-p/74657#M21679</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2010-09-25T06:21:09Z</dc:date>
    </item>
    <item>
      <title>Re: adding  new values to the variables in SAS Dataset</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/adding-new-values-to-the-variables-in-SAS-Dataset/m-p/74658#M21680</link>
      <description>yes. You can do it.&lt;BR /&gt;
Using DDE skill of SAS or 'filename' +'put' statement.&lt;BR /&gt;
In the previous post,  '@data _null_;' and 'Peter.C' success to copy contents from one excel file to another excel file.</description>
      <pubDate>Sun, 26 Sep 2010 08:52:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/adding-new-values-to-the-variables-in-SAS-Dataset/m-p/74658#M21680</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2010-09-26T08:52:52Z</dc:date>
    </item>
  </channel>
</rss>

