<?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 PROC SQL: help with code syntax problem in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/PROC-SQL-help-with-code-syntax-problem/m-p/18333#M3568</link>
    <description>Hello community,&lt;BR /&gt;
&lt;BR /&gt;
I am not sure what the problem here is.&lt;BR /&gt;
I am trying to perform an update on a dataset based off of another data set.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
ERROR 1 pre change.&lt;BR /&gt;
19         Proc SQL;&lt;BR /&gt;
20         Update RO.CH_HIST_MASTER as t1&lt;BR /&gt;
21         set ACAD_ORG = (Select NewOrg from RO.CAH_CONV as t2&lt;BR /&gt;
22         				where t2.Subject = t1.Subject&lt;BR /&gt;
23         				and t2.Catalog = CATALOG_NBR&lt;BR /&gt;
24         				and t2.Group = t1.ACAD_GROUP)&lt;BR /&gt;
25         where t1.Subject = t2.Subject&lt;BR /&gt;
26         and t1.CATALOG_NBR = t2.Catalog&lt;BR /&gt;
27         and t1.ACAD_GROUP = t2.Group&lt;BR /&gt;
28         and t1.STRM = "1390";&lt;BR /&gt;
ERROR: Unresolved reference to table/correlation name t2.&lt;BR /&gt;
ERROR: Unresolved reference to table/correlation name t2.&lt;BR /&gt;
ERROR: Unresolved reference to table/correlation name t2.&lt;BR /&gt;
&lt;BR /&gt;
 When i change the t2 reference in the second WHERE clause it returns another error. Both errors shown below, any assistance pointing me in the right direction would be help full.&lt;BR /&gt;
&lt;BR /&gt;
ERROR 2 Post change&lt;BR /&gt;
19         Proc SQL;&lt;BR /&gt;
20         Update RO.CH_HIST_MASTER as t1&lt;BR /&gt;
21         set ACAD_ORG = (Select NewOrg from RO.CAH_CONV as t2&lt;BR /&gt;
22         				where t2.Subject = t1.Subject&lt;BR /&gt;
23         				and t2.Catalog = CATALOG_NBR&lt;BR /&gt;
24         				and t2.Group = t1.ACAD_GROUP)&lt;BR /&gt;
25         where t1.Subject = CAH_CONV.Subject&lt;BR /&gt;
26         and t1.CATALOG_NBR = CAH_CONV.Catalog&lt;BR /&gt;
27         and t1.ACAD_GROUP = CAH_CONV.Group&lt;BR /&gt;
28         and t1.STRM = "1390";&lt;BR /&gt;
ERROR: Unresolved reference to table/correlation name CAH_CONV.&lt;BR /&gt;
ERROR: Unresolved reference to table/correlation name CAH_CONV.&lt;BR /&gt;
ERROR: Unresolved reference to table/correlation name CAH_CONV.

Message was edited by: smilbuta</description>
    <pubDate>Mon, 28 Feb 2011 15:29:34 GMT</pubDate>
    <dc:creator>smilbuta</dc:creator>
    <dc:date>2011-02-28T15:29:34Z</dc:date>
    <item>
      <title>PROC SQL: help with code syntax problem</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PROC-SQL-help-with-code-syntax-problem/m-p/18333#M3568</link>
      <description>Hello community,&lt;BR /&gt;
&lt;BR /&gt;
I am not sure what the problem here is.&lt;BR /&gt;
I am trying to perform an update on a dataset based off of another data set.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
ERROR 1 pre change.&lt;BR /&gt;
19         Proc SQL;&lt;BR /&gt;
20         Update RO.CH_HIST_MASTER as t1&lt;BR /&gt;
21         set ACAD_ORG = (Select NewOrg from RO.CAH_CONV as t2&lt;BR /&gt;
22         				where t2.Subject = t1.Subject&lt;BR /&gt;
23         				and t2.Catalog = CATALOG_NBR&lt;BR /&gt;
24         				and t2.Group = t1.ACAD_GROUP)&lt;BR /&gt;
25         where t1.Subject = t2.Subject&lt;BR /&gt;
26         and t1.CATALOG_NBR = t2.Catalog&lt;BR /&gt;
27         and t1.ACAD_GROUP = t2.Group&lt;BR /&gt;
28         and t1.STRM = "1390";&lt;BR /&gt;
ERROR: Unresolved reference to table/correlation name t2.&lt;BR /&gt;
ERROR: Unresolved reference to table/correlation name t2.&lt;BR /&gt;
ERROR: Unresolved reference to table/correlation name t2.&lt;BR /&gt;
&lt;BR /&gt;
 When i change the t2 reference in the second WHERE clause it returns another error. Both errors shown below, any assistance pointing me in the right direction would be help full.&lt;BR /&gt;
&lt;BR /&gt;
ERROR 2 Post change&lt;BR /&gt;
19         Proc SQL;&lt;BR /&gt;
20         Update RO.CH_HIST_MASTER as t1&lt;BR /&gt;
21         set ACAD_ORG = (Select NewOrg from RO.CAH_CONV as t2&lt;BR /&gt;
22         				where t2.Subject = t1.Subject&lt;BR /&gt;
23         				and t2.Catalog = CATALOG_NBR&lt;BR /&gt;
24         				and t2.Group = t1.ACAD_GROUP)&lt;BR /&gt;
25         where t1.Subject = CAH_CONV.Subject&lt;BR /&gt;
26         and t1.CATALOG_NBR = CAH_CONV.Catalog&lt;BR /&gt;
27         and t1.ACAD_GROUP = CAH_CONV.Group&lt;BR /&gt;
28         and t1.STRM = "1390";&lt;BR /&gt;
ERROR: Unresolved reference to table/correlation name CAH_CONV.&lt;BR /&gt;
ERROR: Unresolved reference to table/correlation name CAH_CONV.&lt;BR /&gt;
ERROR: Unresolved reference to table/correlation name CAH_CONV.

Message was edited by: smilbuta</description>
      <pubDate>Mon, 28 Feb 2011 15:29:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PROC-SQL-help-with-code-syntax-problem/m-p/18333#M3568</guid>
      <dc:creator>smilbuta</dc:creator>
      <dc:date>2011-02-28T15:29:34Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SQL: help with code syntax problem</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PROC-SQL-help-with-code-syntax-problem/m-p/18334#M3569</link>
      <description>How about this?&lt;BR /&gt;
&lt;BR /&gt;
Proc SQL:&lt;BR /&gt;
update RO.CH_HIST_MASTER as t1&lt;BR /&gt;
set ACAD_ORG = (Select NewOrg from RO_CAH_CONV where subject=t1.subject and catalog=t1.catalog_nbr&lt;BR /&gt;
and t2.group=t1.acad_group)&lt;BR /&gt;
where exists (select * from ro_cah_conv subject=t1.subject and catalog=t1.catalog_nbr&lt;BR /&gt;
and t2.group=t1.acad_group and strm='1390');&lt;BR /&gt;
quit;</description>
      <pubDate>Mon, 28 Feb 2011 16:39:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PROC-SQL-help-with-code-syntax-problem/m-p/18334#M3569</guid>
      <dc:creator>DBailey</dc:creator>
      <dc:date>2011-02-28T16:39:49Z</dc:date>
    </item>
  </channel>
</rss>

