<?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: New to SAS for school and am having difficulty with a provided code. in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/New-to-SAS-for-school-and-am-having-difficulty-with-a-provided/m-p/899327#M40045</link>
    <description>&lt;P&gt;It does not look like the names in your code match the names at the start of your posting.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For example&amp;nbsp;&lt;FONT face="courier new,courier"&gt;provider_intersect&lt;/FONT&gt; is not in the list&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;ep_provider_paid_ehr&lt;/LI&gt;
&lt;LI&gt;National_downloadable_file&lt;/LI&gt;
&lt;LI&gt;zip_to_cbsa&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;you provided.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also if you imported the CSV files into WORK datasets and then ended that SAS session and started a new one the WORK datasets will be gone.&amp;nbsp; WORK files are removed when the SAS session ends.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You will need to re-import them again before you can use them in SQL code.&lt;/P&gt;</description>
    <pubDate>Fri, 20 Oct 2023 01:32:22 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2023-10-20T01:32:22Z</dc:date>
    <item>
      <title>New to SAS for school and am having difficulty with a provided code.</title>
      <link>https://communities.sas.com/t5/New-SAS-User/New-to-SAS-for-school-and-am-having-difficulty-with-a-provided/m-p/899326#M40044</link>
      <description>&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;I am new to SAS for my doctorate program and using proc sql, I am needing to merge the following data sets:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;ep_provider_paid_ehr&lt;/LI&gt;&lt;LI&gt;National_downloadable_file&lt;/LI&gt;&lt;LI&gt;zip_to_cbsa&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;All three are csv files that have been imported into SAS and the file names changed to the respective names above in my libraries -&amp;gt; work from import.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is the code that has been given, but it keeps erroring out and I cannot figure out why after multiple attempts, google, youtube, etc:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc sql;&lt;BR /&gt;SELECT DISTINCT&lt;/P&gt;&lt;P&gt;national_downloadable_file.group_practice_PAC_id,&lt;/P&gt;&lt;P&gt;national_downloadable_file.number_of_group_practice_members,&lt;/P&gt;&lt;P&gt;ep_provider_paid_ehr.provider_npi,&lt;/P&gt;&lt;P&gt;zip_to_cbsa.cbsa&lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt;national_downloadable_file&lt;/P&gt;&lt;P&gt;JOIN&lt;/P&gt;&lt;P&gt;provider_intersect ON&lt;/P&gt;&lt;P&gt;national_downloadable_file.national_downloadable_file_id =&lt;/P&gt;&lt;P&gt;provider_intersect.national_downloadable_file_id&lt;/P&gt;&lt;P&gt;LEFT JOIN&lt;/P&gt;&lt;P&gt;ep_provider_paid_ehr ON&lt;/P&gt;&lt;P&gt;provider_intersect.ep_provider_paid_ehr_id =&lt;/P&gt;&lt;P&gt;ep_provider_paid_ehr.ep_provider_paid_ehr_id&lt;/P&gt;&lt;P&gt;JOIN&lt;/P&gt;&lt;P&gt;zipcode_table ON&lt;/P&gt;&lt;P&gt;national_downloadable_file.zipcode =&lt;/P&gt;&lt;P&gt;zipcode_table.zipcode&lt;/P&gt;&lt;P&gt;LEFT JOIN&lt;/P&gt;&lt;P&gt;zip_to_cbsa ON&lt;/P&gt;&lt;P&gt;zipcode_table.zipcode = zip_to_cbsa.zipcode&lt;/P&gt;&lt;P&gt;WHERE national_downloadable_file.group_practice_PAC_id&amp;lt;&amp;gt;'NA';&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the error that keeps occurring:&lt;/P&gt;&lt;DIV class=""&gt;ERROR: File WORK.PROVIDER_INTERSECT.DATA does not exist.&lt;/DIV&gt;&lt;DIV class=""&gt;ERROR: File WORK.ZIPCODE_TABLE.DATA does not exist.&lt;/DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;Any help would be greatly appreciated.&lt;/DIV&gt;&lt;DIV class=""&gt;Thanks!&lt;/DIV&gt;</description>
      <pubDate>Fri, 20 Oct 2023 00:47:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/New-to-SAS-for-school-and-am-having-difficulty-with-a-provided/m-p/899326#M40044</guid>
      <dc:creator>ericv51389</dc:creator>
      <dc:date>2023-10-20T00:47:17Z</dc:date>
    </item>
    <item>
      <title>Re: New to SAS for school and am having difficulty with a provided code.</title>
      <link>https://communities.sas.com/t5/New-SAS-User/New-to-SAS-for-school-and-am-having-difficulty-with-a-provided/m-p/899327#M40045</link>
      <description>&lt;P&gt;It does not look like the names in your code match the names at the start of your posting.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For example&amp;nbsp;&lt;FONT face="courier new,courier"&gt;provider_intersect&lt;/FONT&gt; is not in the list&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;ep_provider_paid_ehr&lt;/LI&gt;
&lt;LI&gt;National_downloadable_file&lt;/LI&gt;
&lt;LI&gt;zip_to_cbsa&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;you provided.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also if you imported the CSV files into WORK datasets and then ended that SAS session and started a new one the WORK datasets will be gone.&amp;nbsp; WORK files are removed when the SAS session ends.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You will need to re-import them again before you can use them in SQL code.&lt;/P&gt;</description>
      <pubDate>Fri, 20 Oct 2023 01:32:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/New-to-SAS-for-school-and-am-having-difficulty-with-a-provided/m-p/899327#M40045</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2023-10-20T01:32:22Z</dc:date>
    </item>
    <item>
      <title>Re: New to SAS for school and am having difficulty with a provided code.</title>
      <link>https://communities.sas.com/t5/New-SAS-User/New-to-SAS-for-school-and-am-having-difficulty-with-a-provided/m-p/899411#M40048</link>
      <description>&lt;P&gt;That is what I was thinking and we were not provided with another data base and there are no columns in the ones mentioned that are provider-intersect.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Will try playing around with the code some more and see if I can figure out what is going on with all information I was provided.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Have also reached out to the professor, but have not heard anything back yet.&lt;/P&gt;</description>
      <pubDate>Fri, 20 Oct 2023 16:01:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/New-to-SAS-for-school-and-am-having-difficulty-with-a-provided/m-p/899411#M40048</guid>
      <dc:creator>ericv51389</dc:creator>
      <dc:date>2023-10-20T16:01:59Z</dc:date>
    </item>
    <item>
      <title>Re: New to SAS for school and am having difficulty with a provided code.</title>
      <link>https://communities.sas.com/t5/New-SAS-User/New-to-SAS-for-school-and-am-having-difficulty-with-a-provided/m-p/899416#M40049</link>
      <description>&lt;P&gt;A couple of suggestions: first peculiar to this forum software, you should paste code, Log or text data examples, into a text box opened on the forum using the &amp;lt;/&amp;gt; icon that appears above the message window. The forum main message windows &lt;STRONG&gt;reformat&lt;/STRONG&gt; pasted text and may result in removing, replacing or inserting characters such that when pasted into a code editor will not run correctly. See the box below.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Second is an SQL "trick" to reduce typing AND make code a little more flexible: table alias. You can provide a much shorter name to reference your tables as shown below with the &amp;lt;dataset name&amp;gt; as &amp;lt;alias&amp;gt;. Then you don't have to type long data set names constantly. Also you can test/run code with a different data set and only have to change the name in one place where the Alias is set. I highlighted one example for the first data set From. The "as" is actually optional in many SQL implementations but I like to see it so it is clear what T1 (a semi-traditional alias for "Table One"). I could replace the "national_downloadable_file" with "testset1" for example and no other code would need to change. This is very useful for testing a small set of values (possibly of particular interest for some reason) or just to verify that syntax works on a small set before turning it loose on larger data.&lt;/P&gt;
&lt;PRE&gt;proc sql;
   SELECT DISTINCT
      T1.group_practice_PAC_id,
      T1.number_of_group_practice_members,
      T3.provider_npi,
      T5.cbsa
   FROM
      national_downloadable_file&lt;FONT color="#FF00FF"&gt;&lt;STRONG&gt; as T1&lt;/STRONG&gt;&lt;/FONT&gt;
   JOIN
      provider_intersect as T2 ON
      T1.national_downloadable_file_id =
      T2.national_downloadable_file_id
   LEFT JOIN
      ep_provider_paid_ehr as T3 ON
      T2.ep_provider_paid_ehr_id =
      T3.ep_provider_paid_ehr_id
   JOIN
      zipcode_table as T4 ON
      T1.zipcode =
      T4.zipcode
   LEFT JOIN
      zip_to_cbsa as T5 ON
      T4.zipcode = T5.zipcode
   WHERE T1.group_practice_PAC_id&amp;lt;&amp;gt;'NA'
   ;
quit;&lt;/PRE&gt;
&lt;P&gt;As a side-effect of setting aliases in your code it become obvious that your code uses &lt;STRONG&gt;5&lt;/STRONG&gt; separate tables and you apparently only have 3. So anything using those extra tables would have to "go away" OR provide the data sets.&lt;/P&gt;</description>
      <pubDate>Fri, 20 Oct 2023 16:27:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/New-to-SAS-for-school-and-am-having-difficulty-with-a-provided/m-p/899416#M40049</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2023-10-20T16:27:55Z</dc:date>
    </item>
  </channel>
</rss>

