<?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: regarding proc sql in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/regarding-proc-sql/m-p/466946#M285308</link>
    <description>&lt;P&gt;You need to provide some more information on what data you have.&lt;/P&gt;
&lt;P&gt;If you have a table with diagnosis and another table with there codes then a simple left join works.&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data D_id;
infile datalines dlm=',' missover;
input id diagnosis $25.;
datalines;
101,mood disorders
102,sleep disorders
;
run;

data have;
infile datalines dlm=',' missover;
input patient diagnosis $25.;
datalines ;
1,mood disorders
2,mood disorders
3,sleep disorders
4,sleep disorders
;
run;


proc sql;
create table want as 
select a.*,b.id
from have a
left join d_id b on a.diagnosis=b.diagnosis
;
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 01 Jun 2018 17:36:34 GMT</pubDate>
    <dc:creator>SuryaKiran</dc:creator>
    <dc:date>2018-06-01T17:36:34Z</dc:date>
    <item>
      <title>regarding proc sql</title>
      <link>https://communities.sas.com/t5/SAS-Programming/regarding-proc-sql/m-p/466934#M285306</link>
      <description>&lt;P&gt;I have database with diagnosis description.(example like mood disorders,sleep disorders..)I want to find the diagnosis id with that description.How to create a program for that?&lt;/P&gt;</description>
      <pubDate>Fri, 01 Jun 2018 17:03:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/regarding-proc-sql/m-p/466934#M285306</guid>
      <dc:creator>lg2</dc:creator>
      <dc:date>2018-06-01T17:03:12Z</dc:date>
    </item>
    <item>
      <title>Re: regarding proc sql [how to improve your question]</title>
      <link>https://communities.sas.com/t5/SAS-Programming/regarding-proc-sql/m-p/466939#M285307</link>
      <description>&lt;P&gt;Hello &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/211896"&gt;@lg2&lt;/a&gt;,&lt;/P&gt;&lt;BR /&gt; &lt;P&gt;Your question requires more details before experts can help.&amp;nbsp;Can you revise your question to include more information?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Review this checklist:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Specify a meaningful subject line for your topic.&amp;nbsp; Avoid generic subjects like "need help," "SAS query," or "urgent."&lt;/LI&gt;
&lt;LI&gt;When appropriate, provide sample data in text or DATA step format.&amp;nbsp; See &lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-data-AKA-generate/ta-p/258712" target="_blank"&gt;this article for one method&lt;/A&gt;&amp;nbsp;you can use.&lt;/LI&gt;
&lt;LI&gt;If you're encountering an error in SAS, include the SAS log or a screenshot of the error condition.&amp;nbsp;Use the&amp;nbsp;&lt;STRONG&gt;Photos&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;button to include the image in your message.&lt;BR /&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" style="width: 279px;"&gt;&lt;IMG src="https://kntur85557.i.lithium.com/t5/image/serverpage/image-id/16608i91A52F817EAC9A69/image-dimensions/279x150?v=1.0" width="279" height="150" alt="use_buttons.png" title="use_buttons.png" /&gt;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;It also helps to include an example (table or picture) of the result that you're trying to achieve.&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;To edit your original message, select the "blue gear" icon at the top of the message and select&amp;nbsp;&lt;STRONG&gt;Edit Message&lt;/STRONG&gt;.&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&lt;/STRONG&gt;From there you can adjust the title and add more details to the body of the message.&amp;nbsp; Or, simply reply to this message with any additional information you can supply.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" style="width: 229px;"&gt;&lt;IMG src="https://kntur85557.i.lithium.com/t5/image/serverpage/image-id/16605iAC020BC79315B045/image-size/large?v=1.0&amp;amp;px=600" alt="edit_post.png" title="edit_post.png" /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;SAS experts are eager to help -- help&amp;nbsp;&lt;EM&gt;them&lt;/EM&gt; by providing as much detail as you can.&lt;/P&gt; &lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-style:italic;font-size:smaller;"&gt;This prewritten response was triggered for you by fellow SAS Support Communities member &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt;&lt;/SPAN&gt;&lt;/P&gt;.</description>
      <pubDate>Fri, 01 Jun 2018 17:14:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/regarding-proc-sql/m-p/466939#M285307</guid>
      <dc:creator>Community_Guide</dc:creator>
      <dc:date>2018-06-01T17:14:04Z</dc:date>
    </item>
    <item>
      <title>Re: regarding proc sql</title>
      <link>https://communities.sas.com/t5/SAS-Programming/regarding-proc-sql/m-p/466946#M285308</link>
      <description>&lt;P&gt;You need to provide some more information on what data you have.&lt;/P&gt;
&lt;P&gt;If you have a table with diagnosis and another table with there codes then a simple left join works.&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data D_id;
infile datalines dlm=',' missover;
input id diagnosis $25.;
datalines;
101,mood disorders
102,sleep disorders
;
run;

data have;
infile datalines dlm=',' missover;
input patient diagnosis $25.;
datalines ;
1,mood disorders
2,mood disorders
3,sleep disorders
4,sleep disorders
;
run;


proc sql;
create table want as 
select a.*,b.id
from have a
left join d_id b on a.diagnosis=b.diagnosis
;
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 01 Jun 2018 17:36:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/regarding-proc-sql/m-p/466946#M285308</guid>
      <dc:creator>SuryaKiran</dc:creator>
      <dc:date>2018-06-01T17:36:34Z</dc:date>
    </item>
    <item>
      <title>Re: regarding proc sql</title>
      <link>https://communities.sas.com/t5/SAS-Programming/regarding-proc-sql/m-p/467005#M285309</link>
      <description>&lt;P&gt;Hi:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; And, another approach is to use a FORMAT for a table lookup. In the example below, the PROC FORMAT was hardcoded, but you can build the format from a SAS dataset, too.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="alternate_lookup_format.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/20962i4C1C732901E85D24/image-size/large?v=v2&amp;amp;px=999" role="button" title="alternate_lookup_format.png" alt="alternate_lookup_format.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In this example, the value of the DIAGCODE variable will come from the $dgcode user defined format. This is another way to do a table lookup without doing a merge or a join.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cynthia&lt;/P&gt;</description>
      <pubDate>Fri, 01 Jun 2018 19:45:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/regarding-proc-sql/m-p/467005#M285309</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2018-06-01T19:45:49Z</dc:date>
    </item>
  </channel>
</rss>

