<?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: I would like read some data in excel, and add some values to one of the variables in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/I-would-like-read-some-data-in-excel-and-add-some-values-to-one/m-p/967272#M376318</link>
    <description>&lt;P&gt;"Va for individual 1 has 1 value of 27, and I would like to have 3 values of 27"&lt;/P&gt;
&lt;P&gt;So where is 24 coming from , I did not see it in your data ?&lt;/P&gt;
&lt;P&gt;Here could give you a start.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;libname x 'C:\Users\xiakeshan\Documents\Downloads';

proc transpose data=x.delete_data_sas(obs=2) out=temp;
var _all_;
run;
proc sql noprint;
select cat('length temp_',_name_,' $ 80;retain temp_',_name_,'; if _n_&amp;gt;2 then do;if not missing(',_name_,') then temp_',_name_,'=',_name_,';else ',_name_,'=temp_',_name_,';end;') 
into :impute separated by ' '
 from temp
  where lowcase(col2)='va';
quit;

data want;
 set x.delete_data_sas;
 &amp;amp;impute.
 drop temp_:;
run;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ksharp_0-1747965011859.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/107266iB2B19B4C501B3085/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ksharp_0-1747965011859.png" alt="Ksharp_0-1747965011859.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 23 May 2025 01:50:21 GMT</pubDate>
    <dc:creator>Ksharp</dc:creator>
    <dc:date>2025-05-23T01:50:21Z</dc:date>
    <item>
      <title>I would like read some data in excel, and add some values to one of the variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/I-would-like-read-some-data-in-excel-and-add-some-values-to-one/m-p/967248#M376312</link>
      <description>&lt;P&gt;Hello. I would like to add some values to one of the variables (Va).&amp;nbsp; I would like to add some code, but the first problem I encounter is how to read the data, given that all the variables (in row B in the attached file) have the same name for different individuals (in row A). Attached is a simplified version of my dataset, what I have in the first 11 rows, and what I would like to have. Could you please help me with this?&lt;/P&gt;</description>
      <pubDate>Thu, 22 May 2025 17:30:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/I-would-like-read-some-data-in-excel-and-add-some-values-to-one/m-p/967248#M376312</guid>
      <dc:creator>Thomas_mp</dc:creator>
      <dc:date>2025-05-22T17:30:21Z</dc:date>
    </item>
    <item>
      <title>Re: I would like read some data in excel, and add some values to one of the variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/I-would-like-read-some-data-in-excel-and-add-some-values-to-one/m-p/967252#M376313</link>
      <description>&lt;P&gt;Most of us will not download Excel (or other Microsoft Office) files because they can be security threats. Better to present the data using working SAS data step code (&lt;A href="https://blogs.sas.com/content/sastraining/2016/03/11/jedi-sas-tricks-data-to-data-step-macro/" target="_self"&gt;examples and instructions&lt;/A&gt;) or the less desirable action is to show us a screen capture of the Excel file using the "Insert Photos" icon (do not attach files)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In general, you can read Excel with PROC IMPORT, or LIBNAME with the Excel engine.&lt;/P&gt;</description>
      <pubDate>Thu, 22 May 2025 17:44:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/I-would-like-read-some-data-in-excel-and-add-some-values-to-one/m-p/967252#M376313</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2025-05-22T17:44:03Z</dc:date>
    </item>
    <item>
      <title>Re: I would like read some data in excel, and add some values to one of the variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/I-would-like-read-some-data-in-excel-and-add-some-values-to-one/m-p/967255#M376314</link>
      <description>&lt;P&gt;Thank you Paige.&lt;/P&gt;
&lt;P&gt;Attached is the data again.&amp;nbsp; Please note that the first row is the individual IDs, and the second row is the Vbles, tehy ahve the same name for all the individuals.&amp;nbsp; This is data, and what I would like to have&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Thomas_mp_0-1747938164018.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/107262i8DB2902D414EF85E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Thomas_mp_0-1747938164018.png" alt="Thomas_mp_0-1747938164018.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 22 May 2025 18:24:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/I-would-like-read-some-data-in-excel-and-add-some-values-to-one/m-p/967255#M376314</guid>
      <dc:creator>Thomas_mp</dc:creator>
      <dc:date>2025-05-22T18:24:07Z</dc:date>
    </item>
    <item>
      <title>Re: I would like read some data in excel, and add some values to one of the variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/I-would-like-read-some-data-in-excel-and-add-some-values-to-one/m-p/967256#M376315</link>
      <description>&lt;P&gt;The title of your post indicates you want to add some values. Please explain this in more detail.&lt;/P&gt;</description>
      <pubDate>Thu, 22 May 2025 18:45:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/I-would-like-read-some-data-in-excel-and-add-some-values-to-one/m-p/967256#M376315</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2025-05-22T18:45:51Z</dc:date>
    </item>
    <item>
      <title>Re: I would like read some data in excel, and add some values to one of the variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/I-would-like-read-some-data-in-excel-and-add-some-values-to-one/m-p/967257#M376316</link>
      <description>&lt;P&gt;Thank you Paige.&lt;/P&gt;
&lt;P&gt;Va for individual 0 has 1 value of 23, but I would like to have 5 values of 23 for Va (because there are 5 values for Vb.&amp;nbsp; Similarly, Va for individual 1 has 1 value of 27, and I would like to have 3 values of 27 (because there are 3 values for Vb); similarly Va for individual 2 has 1 value equal to 33, but I would like to have&amp;nbsp; 8 values of 33 because there are 8 values of Vb.&amp;nbsp; The idea is to fill the data in the different columns of Va .&amp;nbsp; I hope this helps !!!&lt;/P&gt;</description>
      <pubDate>Thu, 22 May 2025 19:20:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/I-would-like-read-some-data-in-excel-and-add-some-values-to-one/m-p/967257#M376316</guid>
      <dc:creator>Thomas_mp</dc:creator>
      <dc:date>2025-05-22T19:20:41Z</dc:date>
    </item>
    <item>
      <title>Re: I would like read some data in excel, and add some values to one of the variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/I-would-like-read-some-data-in-excel-and-add-some-values-to-one/m-p/967262#M376317</link>
      <description>&lt;P&gt;I think I get it, but this really is a job that is perfectly and easily done in Excel. It probably could be done in SAS, but it would take a lot more effort.&lt;/P&gt;</description>
      <pubDate>Thu, 22 May 2025 21:28:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/I-would-like-read-some-data-in-excel-and-add-some-values-to-one/m-p/967262#M376317</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2025-05-22T21:28:07Z</dc:date>
    </item>
    <item>
      <title>Re: I would like read some data in excel, and add some values to one of the variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/I-would-like-read-some-data-in-excel-and-add-some-values-to-one/m-p/967272#M376318</link>
      <description>&lt;P&gt;"Va for individual 1 has 1 value of 27, and I would like to have 3 values of 27"&lt;/P&gt;
&lt;P&gt;So where is 24 coming from , I did not see it in your data ?&lt;/P&gt;
&lt;P&gt;Here could give you a start.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;libname x 'C:\Users\xiakeshan\Documents\Downloads';

proc transpose data=x.delete_data_sas(obs=2) out=temp;
var _all_;
run;
proc sql noprint;
select cat('length temp_',_name_,' $ 80;retain temp_',_name_,'; if _n_&amp;gt;2 then do;if not missing(',_name_,') then temp_',_name_,'=',_name_,';else ',_name_,'=temp_',_name_,';end;') 
into :impute separated by ' '
 from temp
  where lowcase(col2)='va';
quit;

data want;
 set x.delete_data_sas;
 &amp;amp;impute.
 drop temp_:;
run;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ksharp_0-1747965011859.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/107266iB2B19B4C501B3085/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ksharp_0-1747965011859.png" alt="Ksharp_0-1747965011859.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 23 May 2025 01:50:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/I-would-like-read-some-data-in-excel-and-add-some-values-to-one/m-p/967272#M376318</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2025-05-23T01:50:21Z</dc:date>
    </item>
    <item>
      <title>Re: I would like read some data in excel, and add some values to one of the variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/I-would-like-read-some-data-in-excel-and-add-some-values-to-one/m-p/967514#M376375</link>
      <description>&lt;P&gt;Thank you very much for your help !!!&lt;/P&gt;</description>
      <pubDate>Mon, 26 May 2025 17:34:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/I-would-like-read-some-data-in-excel-and-add-some-values-to-one/m-p/967514#M376375</guid>
      <dc:creator>Thomas_mp</dc:creator>
      <dc:date>2025-05-26T17:34:54Z</dc:date>
    </item>
  </channel>
</rss>

