<?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: Need help with SAS! in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Need-help-with-SAS/m-p/328408#M73327</link>
    <description>&lt;P&gt;Hi thanks looks complicated on the last bits... i will try it out when back in office...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What if my dataset is like below instead? Any simpler proc sql i can utilize?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Set A:&lt;/P&gt;&lt;P&gt;ID&lt;/P&gt;&lt;P&gt;Ab1234&lt;/P&gt;&lt;P&gt;Bc1234&lt;/P&gt;&lt;P&gt;Fd2244&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Set B:&lt;/P&gt;&lt;P&gt;Column A (named as "INFO")&lt;/P&gt;&lt;PRE&gt;distance, 220km ab1234 tune&lt;BR /&gt;distance= Bc1234 322km tunez&lt;BR /&gt;358kmFd2244 distance tone&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;Column B (named as "VALUE")&lt;/P&gt;&lt;PRE&gt;2000&lt;BR /&gt;3000&lt;BR /&gt;3500&lt;/PRE&gt;&lt;P&gt;I juz want to put the value from Set B onto Set A but have to look for the unique Set A ID from the swamped or jumbled Set B.&lt;/P&gt;&lt;P&gt;Is proc sql possible or easier? Got 10 of thousands of variables under both sets.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Normally i had the same unique set a and unique set b &amp;nbsp;ID data to map with but this new Set b is different. For the same unique data i juz use proc sql as follows:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(For same unique id)&lt;/P&gt;&lt;P&gt;Proc sql;&lt;/P&gt;&lt;P&gt;create table set_c as select ID, VALUE&lt;/P&gt;&lt;P&gt;From set_a left join set_b&amp;nbsp;&lt;/P&gt;&lt;P&gt;On a.id=b.info;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Since this new Set B is jumbled, is it possible to just&lt;/P&gt;&lt;P&gt;use "on a.id like b.%info%" ?? Or "in" function?&lt;/P&gt;&lt;P&gt;Wonder if that will work for proc sql?&lt;/P&gt;</description>
    <pubDate>Mon, 30 Jan 2017 13:54:37 GMT</pubDate>
    <dc:creator>CayCe</dc:creator>
    <dc:date>2017-01-30T13:54:37Z</dc:date>
    <item>
      <title>Need help with SAS!</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-help-with-SAS/m-p/328360#M73318</link>
      <description>&lt;P&gt;Hi Good day~&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have the following sas&amp;nbsp;dataset A and excel B that i need to map the value onto set A in sas.&lt;/P&gt;&lt;P&gt;Set A: example&lt;/P&gt;&lt;P&gt;ab1234&lt;/P&gt;&lt;P&gt;Bc1234&lt;/P&gt;&lt;P&gt;Fd2244&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Set B: example&lt;/P&gt;&lt;P&gt;"distance,&amp;nbsp;220km ab1234 tune 2000"&lt;/P&gt;&lt;P&gt;"distance=&amp;nbsp;Bc1234 322km tunez 3000"&lt;/P&gt;&lt;P&gt;"358kmFd2244 distance tone 3500"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to have the values 2000, 3000 and 3500 which i had split to another excel column and imported to sas, and will need put the values corresponding to set A&lt;/P&gt;&lt;P&gt;i.e.&lt;/P&gt;&lt;P&gt;Ab1234 &amp;nbsp;2000&lt;/P&gt;&lt;P&gt;Bc1234 &amp;nbsp;3000&lt;/P&gt;&lt;P&gt;Fd2244 &amp;nbsp;3500&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any1 can advise how i can code this with proc sql or data step in sas? Thanks.&lt;/P&gt;</description>
      <pubDate>Mon, 30 Jan 2017 11:15:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-help-with-SAS/m-p/328360#M73318</guid>
      <dc:creator>CayCe</dc:creator>
      <dc:date>2017-01-30T11:15:12Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with SAS!</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-help-with-SAS/m-p/328368#M73320</link>
      <description>&lt;P&gt;If the data is like then:&lt;/P&gt;
&lt;PRE&gt;data a;&lt;BR /&gt; input avalue $;&lt;BR /&gt;datalines;&lt;BR /&gt;ab1234&lt;BR /&gt;Bc1234&lt;BR /&gt;Fd2244&lt;BR /&gt;;&lt;BR /&gt;run;&lt;BR /&gt;data b;&lt;BR /&gt; length bvalue $200;&lt;BR /&gt; infile datalines dlm="¬";&lt;BR /&gt; input bvalue $;&lt;BR /&gt;datalines;&lt;BR /&gt;distance, 220km ab1234 tune 2000&lt;BR /&gt;distance= Bc1234 322km tunez 3000&lt;BR /&gt;358kmFd2244 distance tone 3500&lt;BR /&gt;;&lt;BR /&gt;run;&lt;BR /&gt;data _null_;&lt;BR /&gt; set a end=last;&lt;BR /&gt; if _n_=1 then call execute('data want; set b;');&lt;BR /&gt; call execute('if index(bvalue,"'||strip(avalue)||'") &amp;gt; 0 then do; &lt;BR /&gt; aval="'||strip(avalue)||'"; dist=substr(bvalue,lengthn(bvalue)-4); output; end;');&lt;BR /&gt; if last then call execute('run;');&lt;BR /&gt;run;&lt;/PRE&gt;
&lt;P&gt;This generates a datastep after it has finished, which has one row per obs in data a, as index() to find the string, and then set some values. &amp;nbsp;Note&amp;nbsp;how I have put test data in datasteps - please remember this for future posts.&lt;/P&gt;</description>
      <pubDate>Mon, 30 Jan 2017 12:13:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-help-with-SAS/m-p/328368#M73320</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2017-01-30T12:13:21Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with SAS!</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-help-with-SAS/m-p/328408#M73327</link>
      <description>&lt;P&gt;Hi thanks looks complicated on the last bits... i will try it out when back in office...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What if my dataset is like below instead? Any simpler proc sql i can utilize?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Set A:&lt;/P&gt;&lt;P&gt;ID&lt;/P&gt;&lt;P&gt;Ab1234&lt;/P&gt;&lt;P&gt;Bc1234&lt;/P&gt;&lt;P&gt;Fd2244&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Set B:&lt;/P&gt;&lt;P&gt;Column A (named as "INFO")&lt;/P&gt;&lt;PRE&gt;distance, 220km ab1234 tune&lt;BR /&gt;distance= Bc1234 322km tunez&lt;BR /&gt;358kmFd2244 distance tone&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;Column B (named as "VALUE")&lt;/P&gt;&lt;PRE&gt;2000&lt;BR /&gt;3000&lt;BR /&gt;3500&lt;/PRE&gt;&lt;P&gt;I juz want to put the value from Set B onto Set A but have to look for the unique Set A ID from the swamped or jumbled Set B.&lt;/P&gt;&lt;P&gt;Is proc sql possible or easier? Got 10 of thousands of variables under both sets.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Normally i had the same unique set a and unique set b &amp;nbsp;ID data to map with but this new Set b is different. For the same unique data i juz use proc sql as follows:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(For same unique id)&lt;/P&gt;&lt;P&gt;Proc sql;&lt;/P&gt;&lt;P&gt;create table set_c as select ID, VALUE&lt;/P&gt;&lt;P&gt;From set_a left join set_b&amp;nbsp;&lt;/P&gt;&lt;P&gt;On a.id=b.info;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Since this new Set B is jumbled, is it possible to just&lt;/P&gt;&lt;P&gt;use "on a.id like b.%info%" ?? Or "in" function?&lt;/P&gt;&lt;P&gt;Wonder if that will work for proc sql?&lt;/P&gt;</description>
      <pubDate>Mon, 30 Jan 2017 13:54:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-help-with-SAS/m-p/328408#M73327</guid>
      <dc:creator>CayCe</dc:creator>
      <dc:date>2017-01-30T13:54:37Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with SAS!</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-help-with-SAS/m-p/328414#M73328</link>
      <description>&lt;P&gt;Hmmm ignore for the time being...need look at the set b variables when back in office....ciz i think the set b might b the below..&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Coz Inside set b could be ab12 34, ab 12 34, bc1 234, fd223 4...with other numbers and characters also....sigh~&lt;/P&gt;</description>
      <pubDate>Mon, 30 Jan 2017 14:09:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-help-with-SAS/m-p/328414#M73328</guid>
      <dc:creator>CayCe</dc:creator>
      <dc:date>2017-01-30T14:09:03Z</dc:date>
    </item>
  </channel>
</rss>

