<?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 Unexpected select error in Update statement in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Unexpected-select-error-in-Update-statement/m-p/920369#M362485</link>
    <description>&lt;P&gt;&lt;SPAN&gt;Need help to tackle this update statement? It's not working now due to unexcepted Select statement error in the SET statement.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;UPDATE XF.POS_PROC_COD_TEST PCI
SET PCI.PROC_CD_DESC  = 
FROM (
	SELECT 
		PDC.id,
		max(
			CASE WHEN ( COALESCE(SERVICE_FROM_DT, TO_DATE('20990101', 'YYYYMMDD')) ) BETWEEN EFFECTIVE_DATE AND 
			 (CASE WHEN EXPIRATION_DATE IS NULL THEN '2099-01-01' ELSE EXPIRATION_DATE END)
			 THEN DESCRIPTION END) PROC_CD_DESC_NEW
	FROM XF.POS_PROC_COD_TEST PDC
	LEFT JOIN XF.POS_CLAIM_HEDR TPCC ON PDC.O_CLAIM_ID = TPCC.O_CLAIM_ID                   
	LEFT JOIN (
		SELECT DISTINCT ICD_PROC_CODE, EXPIRATION_DATE,EFFECTIVE_DATE, DESCRIPTION  FROM
		COM_DB.COM_DATA.MR_ICD_PROC) CDMRIP
		ON CDMRIP.ICD_PROC_CODE = PDC.PROC_CD
	GROUP BY PDC.id
) Q1
WHERE PCI.id = Q1.id and PCI.id = 0411;&lt;/PRE&gt;</description>
    <pubDate>Fri, 15 Mar 2024 05:57:10 GMT</pubDate>
    <dc:creator>Babloo</dc:creator>
    <dc:date>2024-03-15T05:57:10Z</dc:date>
    <item>
      <title>Unexpected select error in Update statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Unexpected-select-error-in-Update-statement/m-p/920369#M362485</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Need help to tackle this update statement? It's not working now due to unexcepted Select statement error in the SET statement.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;UPDATE XF.POS_PROC_COD_TEST PCI
SET PCI.PROC_CD_DESC  = 
FROM (
	SELECT 
		PDC.id,
		max(
			CASE WHEN ( COALESCE(SERVICE_FROM_DT, TO_DATE('20990101', 'YYYYMMDD')) ) BETWEEN EFFECTIVE_DATE AND 
			 (CASE WHEN EXPIRATION_DATE IS NULL THEN '2099-01-01' ELSE EXPIRATION_DATE END)
			 THEN DESCRIPTION END) PROC_CD_DESC_NEW
	FROM XF.POS_PROC_COD_TEST PDC
	LEFT JOIN XF.POS_CLAIM_HEDR TPCC ON PDC.O_CLAIM_ID = TPCC.O_CLAIM_ID                   
	LEFT JOIN (
		SELECT DISTINCT ICD_PROC_CODE, EXPIRATION_DATE,EFFECTIVE_DATE, DESCRIPTION  FROM
		COM_DB.COM_DATA.MR_ICD_PROC) CDMRIP
		ON CDMRIP.ICD_PROC_CODE = PDC.PROC_CD
	GROUP BY PDC.id
) Q1
WHERE PCI.id = Q1.id and PCI.id = 0411;&lt;/PRE&gt;</description>
      <pubDate>Fri, 15 Mar 2024 05:57:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Unexpected-select-error-in-Update-statement/m-p/920369#M362485</guid>
      <dc:creator>Babloo</dc:creator>
      <dc:date>2024-03-15T05:57:10Z</dc:date>
    </item>
    <item>
      <title>Re: Unexpected select error in Update statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Unexpected-select-error-in-Update-statement/m-p/920371#M362486</link>
      <description>&lt;P&gt;How about showing the LOG with the code and the actual text of the error message and diagnostic characters plus any other notes or warnings.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And if this is connecting to an external data base (i.e. not using SAS data sets) perhaps include the connection options.&lt;/P&gt;</description>
      <pubDate>Fri, 15 Mar 2024 06:26:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Unexpected-select-error-in-Update-statement/m-p/920371#M362486</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2024-03-15T06:26:54Z</dc:date>
    </item>
    <item>
      <title>Re: Unexpected select error in Update statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Unexpected-select-error-in-Update-statement/m-p/920373#M362488</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt;&amp;nbsp;Statement is not valid error. I want to know what is wrong with the SET statement.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt;&amp;nbsp; any help you can offer here?&lt;/P&gt;</description>
      <pubDate>Fri, 15 Mar 2024 06:35:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Unexpected-select-error-in-Update-statement/m-p/920373#M362488</guid>
      <dc:creator>Babloo</dc:creator>
      <dc:date>2024-03-15T06:35:02Z</dc:date>
    </item>
    <item>
      <title>Re: Unexpected select error in Update statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Unexpected-select-error-in-Update-statement/m-p/920375#M362490</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/8409"&gt;@Babloo&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt;&amp;nbsp;Statement is not valid error.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;What does "not valid error" mean?&amp;nbsp;&amp;nbsp; Just because you don't know why it is an error does not mean it is not an error.&lt;/P&gt;
&lt;P&gt;We don't have any of your so can't run the code.&lt;/P&gt;
&lt;P&gt;The use of the "dates" that you show pretty much implies you are working with something other basic SAS data sets, so the question may well be in that system and not SAS.&lt;/P&gt;</description>
      <pubDate>Fri, 15 Mar 2024 06:41:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Unexpected-select-error-in-Update-statement/m-p/920375#M362490</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2024-03-15T06:41:56Z</dc:date>
    </item>
    <item>
      <title>Re: Unexpected select error in Update statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Unexpected-select-error-in-Update-statement/m-p/920376#M362491</link>
      <description>&lt;P&gt;&lt;STRONG&gt;POST.&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;THE.&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;LOG.&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Mar 2024 07:01:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Unexpected-select-error-in-Update-statement/m-p/920376#M362491</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2024-03-15T07:01:03Z</dc:date>
    </item>
    <item>
      <title>Re: Unexpected select error in Update statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Unexpected-select-error-in-Update-statement/m-p/920378#M362492</link>
      <description>&lt;P&gt;Something like&lt;/P&gt;
&lt;PRE&gt;TO_DATE('20990101', 'YYYYMMDD')&lt;/PRE&gt;
&lt;P&gt;can only be valid in some other, non-SAS SQL dialect, so it would have to be part of explicit pass-through.&lt;/P&gt;
&lt;P&gt;Once again, post the&amp;nbsp;&lt;U&gt;complete&lt;/U&gt; log.&lt;/P&gt;</description>
      <pubDate>Fri, 15 Mar 2024 07:14:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Unexpected-select-error-in-Update-statement/m-p/920378#M362492</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2024-03-15T07:14:39Z</dc:date>
    </item>
    <item>
      <title>Re: Unexpected select error in Update statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Unexpected-select-error-in-Update-statement/m-p/920381#M362495</link>
      <description>I don't have log at the moment. Is it right the way to use case when with&lt;BR /&gt;select in the proc sql update statement?&lt;BR /&gt;</description>
      <pubDate>Fri, 15 Mar 2024 07:33:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Unexpected-select-error-in-Update-statement/m-p/920381#M362495</guid>
      <dc:creator>Babloo</dc:creator>
      <dc:date>2024-03-15T07:33:48Z</dc:date>
    </item>
    <item>
      <title>Re: Unexpected select error in Update statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Unexpected-select-error-in-Update-statement/m-p/920383#M362497</link>
      <description>&lt;P&gt;Either provide the log, or usable example data and the expected result.&lt;/P&gt;</description>
      <pubDate>Fri, 15 Mar 2024 07:41:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Unexpected-select-error-in-Update-statement/m-p/920383#M362497</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2024-03-15T07:41:35Z</dc:date>
    </item>
    <item>
      <title>Re: Unexpected select error in Update statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Unexpected-select-error-in-Update-statement/m-p/920388#M362499</link>
      <description>&lt;P&gt;I don't think your syntax is correct.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if you're using proc sql without passthru facility the syntax would look something like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;data test;
	set sashelp.class;
	age=.; **Set age to missing and update using sql query;
run;

proc sql;
	update test a
		set age = (select age from sashelp.class b where a.name = b.name);
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 15 Mar 2024 09:34:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Unexpected-select-error-in-Update-statement/m-p/920388#M362499</guid>
      <dc:creator>Mazi</dc:creator>
      <dc:date>2024-03-15T09:34:52Z</dc:date>
    </item>
  </channel>
</rss>

