<?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: PROC SQL ON statement is rejecting a full dataset name period column name but accepts a single q in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/PROC-SQL-ON-statement-is-rejecting-a-full-dataset-name-period/m-p/921348#M362846</link>
    <description>&lt;P&gt;From now on, when you have an error in a PROC, show us the log for that PROC. We need to see the code as it appears in the log, and any messages such as errors, warnins and noes. DO NOT show us just the error messages in the log, detached from the code in the log.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;where Work.Patient_HD.Patient_ID = Work.Patient_AGE.Patient_ID
;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;where patient_hd.patient_id =patient_age.patient_id;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 21 Mar 2024 17:08:05 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2024-03-21T17:08:05Z</dc:date>
    <item>
      <title>PROC SQL ON statement is rejecting a full dataset name period column name but accepts a single qual</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-SQL-ON-statement-is-rejecting-a-full-dataset-name-period/m-p/921340#M362842</link>
      <description>&lt;P&gt;I am taking an Udemy advanced SAS course. An exercise for the PROC SQL has me doing two PROC IMPORTS and then a PROC SQL using the ON clause.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In the first part of the attached code I have the process working. The import and SQL are only using partial dataset names (that is: phd0 or pag0) where I like to use full names even for work datasets so I have 'Work.Patient_HD' and 'Work.Patient_Age.' In the ON statement when I have the dataset names of 'Work.Patient_HD.Patient_id' the proc fails with:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV id="sasLogError3_1711037476966" class="sasError lia-indent-padding-left-30px"&gt;&lt;EM&gt;ERROR 22-322: Syntax error, expecting one of the following: ;, !, !!, &amp;amp;, *, **, +, ',', -, /, &amp;lt;, &amp;lt;=, &amp;lt;&amp;gt;, =, &amp;gt;, &amp;gt;=, ?, AND,&lt;/EM&gt;&lt;/DIV&gt;
&lt;DIV class="sasError lia-indent-padding-left-30px"&gt;&lt;EM&gt;ANSIMISS, BETWEEN, CONTAINS, CROSS, EQ, EQT, EXCEPT, FULL, GE, GET, GROUP, GT, GTT, HAVING, IN, INNER, INTERSECT, IS,&lt;/EM&gt;&lt;/DIV&gt;
&lt;DIV class="sasError lia-indent-padding-left-30px"&gt;&lt;EM&gt;JOIN, LE, LEFT, LET, LIKE, LT, LTT, NATURAL, NE, NET, NOMISS, NOT, NOTIN, OR, ORDER, OUTER, RIGHT, UNION, WHERE, ^,&lt;/EM&gt;&lt;/DIV&gt;
&lt;DIV class="sasError lia-indent-padding-left-30px"&gt;&lt;EM&gt;^=, |, ||, ~, ~=.&lt;/EM&gt;&lt;/DIV&gt;
&lt;DIV class="sasSource lia-indent-padding-left-30px"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV id="sasLogError4_1711037476966" class="sasError lia-indent-padding-left-30px"&gt;&lt;EM&gt;ERROR 76-322: Syntax error, statement will be ignored.&lt;/EM&gt;&lt;/DIV&gt;
&lt;DIV class="sasError"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="sasError"&gt;The PROC IMPORTs are fine.&lt;/DIV&gt;
&lt;DIV class="sasError"&gt;In the PROC SQL the same code where I use only the partial names ( phd0.Patient_id&amp;nbsp; &amp;nbsp;and pag0.Patient_id) works fine. That is the class solution provided.&lt;/DIV&gt;
&lt;DIV class="sasError"&gt;I'm trying to understand why putting in the full&amp;nbsp; name of&amp;nbsp; &amp;nbsp;'Work.Patient_ID.Patient_id' fails where the 'phd0.Patient_ID' works.&lt;/DIV&gt;
&lt;DIV class="sasError"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="sasError"&gt;I'm having some trouble with getting stuff from SAS On Demand for Academics downloaded to someplace that I can the attach the code to this site.&lt;/DIV&gt;
&lt;DIV class="sasError"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="sasError"&gt;The code (working and not) is:&lt;/DIV&gt;
&lt;DIV class="sasError"&gt;
&lt;P&gt;/* Coding exercise 27 for SQL */&lt;BR /&gt;/* The below works */&lt;BR /&gt;proc import datafile = '/home/lcwrite/data/Patient_HD.xlsx'&lt;BR /&gt;dbms=xlsx&lt;BR /&gt;out = phd0;&lt;BR /&gt;run;&lt;BR /&gt;proc import datafile = '/home/lcwrite/data/Patient_age_gender.xlsx'&lt;BR /&gt;dbms=xlsx&lt;BR /&gt;out = pag0;&lt;BR /&gt;run;&lt;BR /&gt;proc sql feedback;&lt;BR /&gt;select *&lt;BR /&gt;from phd0, pag0&lt;BR /&gt;where phd0.Patient_ID = pag0.Patient_ID&lt;BR /&gt;;&lt;BR /&gt;quit;&lt;BR /&gt;proc sql feedback;&lt;BR /&gt;select *&lt;BR /&gt;from phd0 INNER JOIN &lt;BR /&gt;pag0&lt;BR /&gt;on phd0.Patient_id = pag0.Patient_id&lt;BR /&gt;order by Patient_ID;&lt;BR /&gt;quit;&lt;/P&gt;
&lt;P&gt;/* ------------------------------------------------------------------------------------------------------------------- */&lt;BR /&gt;/* The below does not work */&lt;BR /&gt;proc import datafile = '/home/lcwrite/data/Patient_HD.xlsx'&lt;BR /&gt;dbms=xlsx&lt;BR /&gt;out = Work.Patient_HD;&lt;BR /&gt;run;&lt;BR /&gt;proc import datafile = '/home/lcwrite/data/Patient_age_gender.xlsx'&lt;BR /&gt;dbms=xlsx&lt;BR /&gt;out = Work.Patient_AGE;&lt;BR /&gt;run;&lt;BR /&gt;proc sql feedback;&lt;BR /&gt;select *&lt;BR /&gt;from Work.Patient_HD, Work.Patient_AGE&lt;BR /&gt;where Work.Patient_HD.Patient_ID = Work.Patient_AGE.Patient_ID&lt;BR /&gt;;&lt;BR /&gt;quit;&lt;/P&gt;
&lt;P&gt;/* The error 22 points to the decimal in 'Work.Patient_HD.Patient_id' */&lt;/P&gt;
&lt;/DIV&gt;</description>
      <pubDate>Thu, 21 Mar 2024 16:36:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-SQL-ON-statement-is-rejecting-a-full-dataset-name-period/m-p/921340#M362842</guid>
      <dc:creator>lchristensen</dc:creator>
      <dc:date>2024-03-21T16:36:04Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SQL ON statement is rejecting a full dataset name period column name but accepts a single q</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-SQL-ON-statement-is-rejecting-a-full-dataset-name-period/m-p/921344#M362844</link>
      <description>&lt;P&gt;An SQL table reference alias cannot contain a period.&amp;nbsp; If you use a two level dataset name&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;from libref.memname&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;then only the member part is used to set the default alias.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Either use the alias that SAS will understand,&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;from libref.mem1
where mem1.var1 is not null&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;or assign your own.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;from libref.mem1 alias
where alias.var1 is not null&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 21 Mar 2024 17:01:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-SQL-ON-statement-is-rejecting-a-full-dataset-name-period/m-p/921344#M362844</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2024-03-21T17:01:17Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SQL ON statement is rejecting a full dataset name period column name but accepts a single q</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-SQL-ON-statement-is-rejecting-a-full-dataset-name-period/m-p/921348#M362846</link>
      <description>&lt;P&gt;From now on, when you have an error in a PROC, show us the log for that PROC. We need to see the code as it appears in the log, and any messages such as errors, warnins and noes. DO NOT show us just the error messages in the log, detached from the code in the log.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;where Work.Patient_HD.Patient_ID = Work.Patient_AGE.Patient_ID
;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;where patient_hd.patient_id =patient_age.patient_id;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 21 Mar 2024 17:08:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-SQL-ON-statement-is-rejecting-a-full-dataset-name-period/m-p/921348#M362846</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2024-03-21T17:08:05Z</dc:date>
    </item>
  </channel>
</rss>

