title: Trying to update table values from another table in SAS w/ Proc Sql
body: <p>I have a table (EM_UPLOAD) that I've created that I want to update values on in another table (QUESTVAR_CASEITEM).  The values in the QUESTVAR table are null and I'm making them not null.  I'm attempting to do this with the following code:</p>
  <pre><code>    PROC SQL;
      UPDATE CD1PROD.QUESTVAR_CASEITEM a
      SET a.DEBIT_ENTRYMODE=(SELECT EM
        FROM EM_UPLOAD b
        WHERE A.SEQCASEITEM = B.CASEITEM)
        WHERE SEQCASEITEM IN (SELECT CASEITEM FROM EM_UPLOAD);
      QUIT;
  </code></pre>
  <p>It keeps erroring out on the SET line saying it's expecting an = when an = is already there...</p>
  <p>The log dump is as follows:</p>
  <pre><code>1          ;*';*&quot;;*/;quit;run;
  2          OPTIONS PAGENO=MIN;
  3          %LET _CLIENTTASKLABEL='EM_UPDATE_TESTING';
  4          %LET _CLIENTPROCESSFLOWNAME='Process Flow';
  5          %LET _CLIENTPROJECTPATH='';
  6          %LET _CLIENTPROJECTPATHHOST='';
  7          %LET _CLIENTPROJECTNAME='';
  8          %LET _SASPROGRAMFILE='[REDACTED]';
  9          %LET _SASPROGRAMFILEHOST='W7LT110183466';
  10         
  11         ODS _ALL_ CLOSE;
  12         OPTIONS DEV=PNG;
  13         GOPTIONS XPIXELS=0 YPIXELS=0;
  14         FILENAME EGSR TEMP;
  15         ODS tagsets.sasreport13(ID=EGSR) FILE=EGSR
  16             STYLE=HTMLBlue
  17             STYLESHEET=(URL=&quot;file:///C:/Program%20Files%20(x86)/SAS94/x86/SASEnterpriseGuide/7.1/Styles/HTMLBlue.css&quot;)
  18             NOGTITLE
  19             NOGFOOTNOTE
  20             GPATH=&amp;sasworklocation
  21             ENCODING=UTF8
  22             options(rolap=&quot;on&quot;)
  23         ;
  NOTE: Writing TAGSETS.SASREPORT13(EGSR) Body file: EGSR
  24         
  25         GOPTIONS ACCESSIBLE;
  26         LIBNAME CD1PROD SQLSVR USER='XXXXXXXXXXXXXX' PASSWORD=XXXXXXXXXX DSN=STGRAMIHQSQLF18adjhub SCHEMA=DBO QUALIFIER=AdjHub;
  NOTE: Libref CD1PROD was successfully assigned as follows: 
        Engine:        SQLSVR 
        Physical Name: STGRAMIHQSQLF18adjhub
  27         /*Update EM field in LEAN*/
  
  
  28         PROC SQL;
  29         UPDATE CD1PROD.QUESTVAR_CASEITEM as a
  30         SET A.DEBIT_ENTRYMODE = (SELECT EM
                  _
                  73
                  76
  ERROR 73-322: Expecting an =.
  
  ERROR 76-322: Syntax error, statement will be ignored.
  
  31          FROM EM_UPLOAD  as b
  32          WHERE a.SEQCASEITEM = b.caseitem)
  33         WHERE SEQCASEITEM IN (SELECT caseitem FROM EM_UPLOAD);
  NOTE: PROC SQL set option NOEXEC and will continue to check the syntax of statements.
  34         QUIT;
  NOTE: The SAS System stopped processing this step because of errors.
  NOTE: PROCEDURE SQL used (Total process time):
        real time           0.00 seconds
        cpu time            0.00 seconds
        
  35         
  36         GOPTIONS NOACCESSIBLE;
  37         %LET _CLIENTTASKLABEL=;
  38         %LET _CLIENTPROCESSFLOWNAME=;
  39         %LET _CLIENTPROJECTPATH=;
  2                                                          The SAS System                             15:33 Monday, January 25, 2021
  
  40         %LET _CLIENTPROJECTPATHHOST=;
  41         %LET _CLIENTPROJECTNAME=;
  42         %LET _SASPROGRAMFILE=;
  43         %LET _SASPROGRAMFILEHOST=;
  44         
  45         ;*';*&quot;;*/;quit;run;
  46         ODS _ALL_ CLOSE;
  47         
  48         
  49         QUIT; RUN;
  50         
  </code></pre>