<?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: Error 22-322 &amp;amp; 76-322 in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Error-22-322-amp-76-322/m-p/760372#M240439</link>
    <description>&lt;P&gt;Please in the future when posting LOG text, open a text box on the forum with the &amp;lt;/&amp;gt; that appears above the window and paste the text there. The message windows reformat text moving the position of the diagnostic characters posted. The underscore and 22 should appear under the character where SAS determines the error to be.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In this case I think this was originally&lt;/P&gt;
&lt;PRE&gt;select * from &amp;amp;depo_last, &amp;amp;ah_last.cust_no as CIF, &amp;amp;ah_last.name1, &amp;amp;ah_last.name2,&amp;amp;ah_l&lt;BR /&gt;                        _         &lt;/PRE&gt;
&lt;P&gt;&amp;amp;depo_last is apparently a data set and you cannot have a list of variables, which the &amp;amp;ah_last.cust_no and such appear to be.&lt;/P&gt;
&lt;P&gt;You would have to have all the variables on the select. As soon as you have From that ends the select. So SAS expects another a join instruction or end of the select.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So you need to go back to the drawing board, or at least the code that worked without any macro variables and see what change you actually need to make to that Proc SQL call.&lt;/P&gt;</description>
    <pubDate>Mon, 09 Aug 2021 14:19:16 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2021-08-09T14:19:16Z</dc:date>
    <item>
      <title>Error 22-322 &amp; 76-322</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Error-22-322-amp-76-322/m-p/760310#M240414</link>
      <description>&lt;P&gt;Hi all, seeking your support to look at below error in &lt;FONT color="#FF0000"&gt;red, &lt;FONT color="#000000"&gt;i have spent hours but cannot figure out&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1 The SAS System 15:25 Monday, August 9, 2021&lt;/P&gt;&lt;P&gt;1 ;*';*";*/;quit;run;&lt;BR /&gt;2 OPTIONS PAGENO=MIN;&lt;BR /&gt;3 %LET _CLIENTTASKLABEL='Dailly_report_Error_Apply_From_Mar2020_testing 1.sas';&lt;BR /&gt;4 %LET _CLIENTPROCESSFLOWNAME='Standalone Not In Project';&lt;BR /&gt;5 %LET _CLIENTPROJECTPATH='';&lt;BR /&gt;6 %LET _CLIENTPROJECTPATHHOST='';&lt;BR /&gt;7 %LET _CLIENTPROJECTNAME='';&lt;BR /&gt;8 %LET _SASPROGRAMFILE='/proj/sas/sasdata/basesas/nonrisk/VOCD/Trung/Source&lt;BR /&gt;8 ! code/Dailly_report_Error_Apply_From_Mar2020_testing 1.sas';&lt;BR /&gt;9 %LET _SASPROGRAMFILEHOST='pecda15l.unix.anz';&lt;BR /&gt;10&lt;BR /&gt;11 ODS _ALL_ CLOSE;&lt;BR /&gt;12 OPTIONS DEV=SVG;&lt;BR /&gt;13 GOPTIONS XPIXELS=0 YPIXELS=0;&lt;BR /&gt;14 %macro HTML5AccessibleGraphSupported;&lt;BR /&gt;15 %if %_SAS_VERCOMP_FV(9,4,4, 0,0,0) &amp;gt;= 0 %then ACCESSIBLE_GRAPH;&lt;BR /&gt;16 %mend;&lt;BR /&gt;17 FILENAME EGHTML TEMP;&lt;BR /&gt;18 ODS HTML5(ID=EGHTML) FILE=EGHTML&lt;BR /&gt;19 OPTIONS(BITMAP_MODE='INLINE')&lt;BR /&gt;20 %HTML5AccessibleGraphSupported&lt;BR /&gt;21 ENCODING='utf-8'&lt;BR /&gt;22 STYLE=HTMLBlue&lt;BR /&gt;23 NOGTITLE&lt;BR /&gt;24 NOGFOOTNOTE&lt;BR /&gt;25 GPATH=&amp;amp;sasworklocation&lt;BR /&gt;26 ;&lt;BR /&gt;NOTE: Writing HTML5(EGHTML) Body file: EGHTML&lt;BR /&gt;27&lt;BR /&gt;28 /*-------------------------------------------MACRO HERE-------------------------------------------*/&lt;BR /&gt;29 %macro io(fn, datafile, data, type);&lt;BR /&gt;30 %if &amp;amp;fn=import %then %do;&lt;BR /&gt;31 proc import datafile="&amp;amp;datafile"&lt;BR /&gt;32 out=&amp;amp;data&lt;BR /&gt;33 dbms=&amp;amp;type replace;&lt;BR /&gt;34 run;&lt;BR /&gt;35 %end;&lt;BR /&gt;36 %else %if &amp;amp;fn=export %then %do;&lt;BR /&gt;37 proc export data=&amp;amp;data&lt;BR /&gt;38 outfile="&amp;amp;datafile"&lt;BR /&gt;39 dbms=&amp;amp;type&lt;BR /&gt;40 replace;&lt;BR /&gt;41 run;&lt;BR /&gt;42 %end;&lt;BR /&gt;43 %mend;&lt;BR /&gt;44 /*----------------------------------------END OF MACRO HERE----------------------------------------*/&lt;BR /&gt;45 %LET Date_Last_Working = 3007;&lt;BR /&gt;46&lt;BR /&gt;47 %let depo_last = DEPO3007;&lt;BR /&gt;48 %let ah_last = CBO3007;&lt;BR /&gt;49&lt;BR /&gt;50 %let depo_last2 = DEPO2907;&lt;BR /&gt;51 %let ah_last2 = CBO2907;&lt;BR /&gt;52&lt;BR /&gt;53 %let N = 10;&lt;BR /&gt;54&lt;BR /&gt;55 %let path = /proj/sas/sasdata/basesas/nonrisk/VOCD/Trung;&lt;BR /&gt;56&lt;BR /&gt;2 The SAS System 15:25 Monday, August 9, 2021&lt;/P&gt;&lt;P&gt;57 %io(import,&amp;amp;path/RAW DATA/Holiday, Holiday, xlsx);&lt;/P&gt;&lt;P&gt;NOTE: One or more variables were converted because the data type is not supported by the V9 engine. For more details, run with&lt;BR /&gt;options MSGLEVEL=I.&lt;BR /&gt;NOTE: The import data set has 18 observations and 4 variables.&lt;BR /&gt;NOTE: WORK.HOLIDAY data set was successfully created.&lt;BR /&gt;NOTE: PROCEDURE IMPORT used (Total process time):&lt;BR /&gt;real time 0.02 seconds&lt;BR /&gt;cpu time 0.01 seconds&lt;/P&gt;&lt;P&gt;58&lt;BR /&gt;59 data mon_fri;&lt;BR /&gt;60 do date = intnx('year',today(),-1,'B') to intnx('year',today(),0,'E');&lt;BR /&gt;61 if weekday(date) in (2:6) then output;&lt;BR /&gt;62 end;&lt;BR /&gt;63 format date date9.;&lt;BR /&gt;64 run;&lt;/P&gt;&lt;P&gt;NOTE: The data set WORK.MON_FRI has 523 observations and 1 variables.&lt;BR /&gt;NOTE: DATA statement used (Total process time):&lt;BR /&gt;real time 0.01 seconds&lt;BR /&gt;cpu time 0.00 seconds&lt;/P&gt;&lt;P&gt;65&lt;BR /&gt;66 data Holiday (keep = Date);&lt;BR /&gt;67 set Holiday;&lt;BR /&gt;68 run;&lt;/P&gt;&lt;P&gt;NOTE: There were 18 observations read from the data set WORK.HOLIDAY.&lt;BR /&gt;NOTE: The data set WORK.HOLIDAY has 18 observations and 1 variables.&lt;BR /&gt;NOTE: DATA statement used (Total process time):&lt;BR /&gt;real time 0.03 seconds&lt;BR /&gt;cpu time 0.01 seconds&lt;/P&gt;&lt;P&gt;69&lt;BR /&gt;70 data myworksday(RENAME=(date=Begin));&lt;BR /&gt;71 merge mon_fri (in=weekday)&lt;BR /&gt;72 Holiday (in=holiday);&lt;BR /&gt;73 by date;&lt;BR /&gt;74 if weekday and not holiday then output;&lt;BR /&gt;75 run;&lt;/P&gt;&lt;P&gt;NOTE: There were 523 observations read from the data set WORK.MON_FRI.&lt;BR /&gt;NOTE: There were 18 observations read from the data set WORK.HOLIDAY.&lt;BR /&gt;NOTE: The data set WORK.MYWORKSDAY has 510 observations and 1 variables.&lt;BR /&gt;NOTE: DATA statement used (Total process time):&lt;BR /&gt;real time 0.02 seconds&lt;BR /&gt;cpu time 0.01 seconds&lt;/P&gt;&lt;P&gt;76&lt;BR /&gt;77 PROC SQL;&lt;BR /&gt;78 CREATE TABLE Date_Last_Working AS&lt;BR /&gt;79 SELECT Max(Begin) AS Date_Last_Working&lt;BR /&gt;80 FROM myworksday&lt;BR /&gt;3 The SAS System 15:25 Monday, August 9, 2021&lt;/P&gt;&lt;P&gt;81 WHERE Begin &amp;lt; today() - &amp;amp;N;&lt;BR /&gt;NOTE: Table WORK.DATE_LAST_WORKING created, with 1 rows and 1 columns.&lt;/P&gt;&lt;P&gt;82 QUIT;&lt;BR /&gt;NOTE: PROCEDURE SQL used (Total process time):&lt;BR /&gt;real time 0.02 seconds&lt;BR /&gt;cpu time 0.00 seconds&lt;/P&gt;&lt;P&gt;83&lt;BR /&gt;84 DATA PATH;&lt;BR /&gt;85 SET Date_Last_Working;&lt;BR /&gt;86 iMONTH= PUT(today() - &amp;amp;N, monname3.);&lt;BR /&gt;87 iYEAR= YEAR(today() - &amp;amp;N);&lt;BR /&gt;88 iPATH = CAT(iMONTH,"", iYEAR);&lt;BR /&gt;89 RUN;&lt;/P&gt;&lt;P&gt;NOTE: There were 1 observations read from the data set WORK.DATE_LAST_WORKING.&lt;BR /&gt;NOTE: The data set WORK.PATH has 1 observations and 4 variables.&lt;BR /&gt;NOTE: DATA statement used (Total process time):&lt;BR /&gt;real time 0.02 seconds&lt;BR /&gt;cpu time 0.02 seconds&lt;/P&gt;&lt;P&gt;90&lt;BR /&gt;91 PROC SQL NOPRINT;&lt;BR /&gt;92 SELECT iPATH INTO:iPATH&lt;BR /&gt;93 FROM PATH;&lt;BR /&gt;94 %PUT &amp;amp;iPATH;&lt;BR /&gt;Jul 2021&lt;BR /&gt;95 RUN;&lt;BR /&gt;NOTE: PROC SQL statements are executed immediately; The RUN statement has no effect.&lt;BR /&gt;96&lt;BR /&gt;97&lt;BR /&gt;NOTE: PROCEDURE SQL used (Total process time):&lt;BR /&gt;real time 0.00 seconds&lt;BR /&gt;cpu time 0.00 seconds&lt;/P&gt;&lt;P&gt;98 PROC SQL;&lt;BR /&gt;99 CREATE TABLE Date_Last_Working2 AS&lt;BR /&gt;100 SELECT Max(Begin) AS Date_Last_Working2&lt;BR /&gt;101 FROM myworksday&lt;BR /&gt;102 WHERE Begin &amp;lt; (SELECT Max(Date_Last_Working) FROM Date_Last_Working);&lt;BR /&gt;NOTE: Table WORK.DATE_LAST_WORKING2 created, with 1 rows and 1 columns.&lt;/P&gt;&lt;P&gt;103 QUIT;&lt;BR /&gt;NOTE: PROCEDURE SQL used (Total process time):&lt;BR /&gt;real time 0.05 seconds&lt;BR /&gt;cpu time 0.00 seconds&lt;/P&gt;&lt;P&gt;104&lt;BR /&gt;105 DATA Date_Last_Working(KEEP=Date_LW1);&lt;BR /&gt;106 SET Date_Last_Working;&lt;BR /&gt;107 if DAY(Date_Last_Working) &amp;lt; 10 then day_1=cat("0",DAY(Date_Last_Working));&lt;BR /&gt;108 else day_1= cat("",DAY(Date_Last_Working));&lt;BR /&gt;109 if MONTH(Date_Last_Working) &amp;lt; 10 then month_1=cat("0",MONTH(Date_Last_Working));&lt;BR /&gt;4 The SAS System 15:25 Monday, August 9, 2021&lt;/P&gt;&lt;P&gt;110 else month_1= cat("",MONTH(Date_Last_Working));&lt;BR /&gt;111 Date_LW1=CATT(DAY_1, MONTH_1);&lt;BR /&gt;112 RUN;&lt;/P&gt;&lt;P&gt;NOTE: There were 1 observations read from the data set WORK.DATE_LAST_WORKING.&lt;BR /&gt;NOTE: The data set WORK.DATE_LAST_WORKING has 1 observations and 1 variables.&lt;BR /&gt;NOTE: DATA statement used (Total process time):&lt;BR /&gt;real time 0.03 seconds&lt;BR /&gt;cpu time 0.02 seconds&lt;/P&gt;&lt;P&gt;113&lt;BR /&gt;114&lt;BR /&gt;115&lt;BR /&gt;116 DATA Date_Last_Working;&lt;BR /&gt;117 SET Date_Last_Working;&lt;BR /&gt;118 DEPO1=COMPRESS(CATT("DEPO",Date_LW1));&lt;BR /&gt;119 AH1=COMPRESS(CATT("CBO",Date_LW1));&lt;BR /&gt;120 RUN;&lt;/P&gt;&lt;P&gt;NOTE: There were 1 observations read from the data set WORK.DATE_LAST_WORKING.&lt;BR /&gt;NOTE: The data set WORK.DATE_LAST_WORKING has 1 observations and 3 variables.&lt;BR /&gt;NOTE: DATA statement used (Total process time):&lt;BR /&gt;real time 0.05 seconds&lt;BR /&gt;cpu time 0.00 seconds&lt;/P&gt;&lt;P&gt;121&lt;BR /&gt;122&lt;BR /&gt;123 DATA Date_Last_Working2(KEEP=Date_LW2);&lt;BR /&gt;124 SET Date_Last_Working2;&lt;BR /&gt;125 if DAY(Date_Last_Working2) &amp;lt; 10 then day_2=cat("0",DAY(Date_Last_Working2));&lt;BR /&gt;126 else day_2= cat("",DAY(Date_Last_Working2));&lt;BR /&gt;127 if MONTH(Date_Last_Working2) &amp;lt; 10 then month_2=cat("0",MONTH(Date_Last_Working2));&lt;BR /&gt;128 else month_2= cat("",MONTH(Date_Last_Working2));&lt;BR /&gt;129 Date_LW2=CATT(DAY_2, MONTH_2);&lt;BR /&gt;130 RUN;&lt;/P&gt;&lt;P&gt;NOTE: There were 1 observations read from the data set WORK.DATE_LAST_WORKING2.&lt;BR /&gt;NOTE: The data set WORK.DATE_LAST_WORKING2 has 1 observations and 1 variables.&lt;BR /&gt;NOTE: DATA statement used (Total process time):&lt;BR /&gt;real time 0.05 seconds&lt;BR /&gt;cpu time 0.00 seconds&lt;/P&gt;&lt;P&gt;131&lt;BR /&gt;132 DATA Date_Last_Working2;&lt;BR /&gt;133 SET Date_Last_Working2;&lt;BR /&gt;134 DEPO2=COMPRESS(CATT("DEPO",Date_LW2));&lt;BR /&gt;135 AH2=COMPRESS(CATT("CBO",Date_LW2));&lt;BR /&gt;136 RUN;&lt;/P&gt;&lt;P&gt;NOTE: There were 1 observations read from the data set WORK.DATE_LAST_WORKING2.&lt;BR /&gt;NOTE: The data set WORK.DATE_LAST_WORKING2 has 1 observations and 3 variables.&lt;BR /&gt;NOTE: DATA statement used (Total process time):&lt;BR /&gt;real time 0.05 seconds&lt;BR /&gt;cpu time 0.01 seconds&lt;BR /&gt;&lt;BR /&gt;5 The SAS System 15:25 Monday, August 9, 2021&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;137&lt;BR /&gt;138 PROC SQL NOPRINT;&lt;BR /&gt;139 SELECT DEPO1 INTO:depo_last&lt;BR /&gt;140 FROM Date_Last_Working;&lt;BR /&gt;141 %PUT &amp;amp;depo_last;&lt;BR /&gt;DEPO2907&lt;BR /&gt;142 RUN;&lt;BR /&gt;NOTE: PROC SQL statements are executed immediately; The RUN statement has no effect.&lt;BR /&gt;143&lt;BR /&gt;144&lt;BR /&gt;NOTE: PROCEDURE SQL used (Total process time):&lt;BR /&gt;real time 0.01 seconds&lt;BR /&gt;cpu time 0.00 seconds&lt;/P&gt;&lt;P&gt;145 PROC SQL NOPRINT;&lt;BR /&gt;146 SELECT AH1 INTO: ah_last&lt;BR /&gt;147 FROM Date_Last_Working;&lt;BR /&gt;148 %PUT &amp;amp;ah_last;&lt;BR /&gt;CBO2907&lt;BR /&gt;149 RUN;&lt;BR /&gt;NOTE: PROC SQL statements are executed immediately; The RUN statement has no effect.&lt;BR /&gt;150&lt;BR /&gt;NOTE: PROCEDURE SQL used (Total process time):&lt;BR /&gt;real time 0.00 seconds&lt;BR /&gt;cpu time 0.00 seconds&lt;/P&gt;&lt;P&gt;151 PROC SQL NOPRINT;&lt;BR /&gt;152 SELECT DEPO2 INTO:depo_last2&lt;BR /&gt;153 FROM Date_Last_Working2;&lt;BR /&gt;154 %PUT &amp;amp;depo_last2;&lt;BR /&gt;DEPO2807&lt;BR /&gt;155 RUN;&lt;BR /&gt;NOTE: PROC SQL statements are executed immediately; The RUN statement has no effect.&lt;BR /&gt;156&lt;BR /&gt;NOTE: PROCEDURE SQL used (Total process time):&lt;BR /&gt;real time 0.01 seconds&lt;BR /&gt;cpu time 0.00 seconds&lt;/P&gt;&lt;P&gt;157 PROC SQL NOPRINT;&lt;BR /&gt;158 SELECT AH2 INTO: ah_last2&lt;BR /&gt;159 FROM Date_Last_Working2;&lt;BR /&gt;160 %PUT &amp;amp;ah_last2;&lt;BR /&gt;CBO2807&lt;BR /&gt;161 RUN;&lt;BR /&gt;NOTE: PROC SQL statements are executed immediately; The RUN statement has no effect.&lt;BR /&gt;162&lt;BR /&gt;163 /* ---------------- PROCESS ----------------*/&lt;BR /&gt;164&lt;BR /&gt;165 %io(import,&amp;amp;path/RAW DATA/DEPO3007.DBF, &amp;amp;depo_last, DBF);&lt;BR /&gt;NOTE: PROCEDURE SQL used (Total process time):&lt;BR /&gt;real time 0.00 seconds&lt;BR /&gt;cpu time 0.00 seconds&lt;/P&gt;&lt;P&gt;6 The SAS System 15:25 Monday, August 9, 2021&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;NOTE: Imported 22 columns and 3349 rows of data from the dBase table file.&lt;BR /&gt;NOTE: WORK.DEPO2907 data set was successfully created.&lt;BR /&gt;NOTE: PROCEDURE IMPORT used (Total process time):&lt;BR /&gt;real time 0.03 seconds&lt;BR /&gt;cpu time 0.02 seconds&lt;/P&gt;&lt;P&gt;166 %io(import,&amp;amp;path/RAW DATA/DEPO2907.DBF, &amp;amp;depo_last2, DBF);&lt;/P&gt;&lt;P&gt;NOTE: Imported 22 columns and 3350 rows of data from the dBase table file.&lt;BR /&gt;NOTE: WORK.DEPO2807 data set was successfully created.&lt;BR /&gt;NOTE: PROCEDURE IMPORT used (Total process time):&lt;BR /&gt;real time 0.03 seconds&lt;BR /&gt;cpu time 0.02 seconds&lt;/P&gt;&lt;P&gt;167 %io(import,&amp;amp;path/RAW DATA/CBO3007.DBF, &amp;amp;ah_last, DBF);&lt;/P&gt;&lt;P&gt;NOTE: Imported 62 columns and 41571 rows of data from the dBase table file.&lt;BR /&gt;NOTE: WORK.CBO2907 data set was successfully created.&lt;BR /&gt;NOTE: PROCEDURE IMPORT used (Total process time):&lt;BR /&gt;real time 0.21 seconds&lt;BR /&gt;cpu time 0.17 seconds&lt;/P&gt;&lt;P&gt;168 %io(import,&amp;amp;path/RAW DATA/CBO2907.DBF, &amp;amp;ah_last2, DBF);&lt;/P&gt;&lt;P&gt;NOTE: Imported 62 columns and 41599 rows of data from the dBase table file.&lt;BR /&gt;NOTE: WORK.CBO2807 data set was successfully created.&lt;BR /&gt;NOTE: PROCEDURE IMPORT used (Total process time):&lt;BR /&gt;real time 0.22 seconds&lt;BR /&gt;cpu time 0.18 seconds&lt;/P&gt;&lt;P&gt;169&lt;BR /&gt;170 data &amp;amp;depo_last;&lt;BR /&gt;171 set &amp;amp;depo_last;&lt;BR /&gt;172 AccountNo = compress(tranwrd(AccountNo, "-",""));&lt;BR /&gt;173 run;&lt;/P&gt;&lt;P&gt;NOTE: There were 3349 observations read from the data set WORK.DEPO2907.&lt;BR /&gt;NOTE: The data set WORK.DEPO2907 has 3349 observations and 22 variables.&lt;BR /&gt;NOTE: DATA statement used (Total process time):&lt;BR /&gt;real time 0.03 seconds&lt;BR /&gt;cpu time 0.01 seconds&lt;/P&gt;&lt;P&gt;174&lt;BR /&gt;175 data &amp;amp;depo_last2;&lt;BR /&gt;176 set &amp;amp;depo_last2;&lt;BR /&gt;177 AccountNo = compress(tranwrd(AccountNo, "-",""));&lt;BR /&gt;178 run;&lt;/P&gt;&lt;P&gt;NOTE: There were 3350 observations read from the data set WORK.DEPO2807.&lt;BR /&gt;NOTE: The data set WORK.DEPO2807 has 3350 observations and 22 variables.&lt;BR /&gt;NOTE: DATA statement used (Total process time):&lt;BR /&gt;real time 0.03 seconds&lt;BR /&gt;7 The SAS System 15:25 Monday, August 9, 2021&lt;/P&gt;&lt;P&gt;cpu time 0.00 seconds&lt;/P&gt;&lt;P&gt;179&lt;BR /&gt;180 data &amp;amp;ah_last (drop=old);&lt;BR /&gt;181 set &amp;amp;ah_last (rename=(ACCT_NO=oldACCT CUST_NO=oldCUST SEGMENT_ID=oldSEGMENT_ID ACCT_TYPE=oldACCT_TYPE));&lt;BR /&gt;182 ACCT_NO=input(oldACCT,16.0);&lt;BR /&gt;183 CUST_NO=input(oldCUST,16.0);&lt;BR /&gt;184 SEGMENT_ID=input(oldSEGMENT_ID,16.0);&lt;BR /&gt;185 ACCT_TYPE=input(oldACCT_TYPE,16.0);&lt;BR /&gt;186 run;&lt;/P&gt;&lt;P&gt;WARNING: The variable old in the DROP, KEEP, or RENAME list has never been referenced.&lt;BR /&gt;NOTE: There were 41571 observations read from the data set WORK.CBO2907.&lt;BR /&gt;NOTE: The data set WORK.CBO2907 has 41571 observations and 66 variables.&lt;BR /&gt;NOTE: DATA statement used (Total process time):&lt;BR /&gt;real time 0.14 seconds&lt;BR /&gt;cpu time 0.07 seconds&lt;/P&gt;&lt;P&gt;187&lt;BR /&gt;188 data &amp;amp;ah_last2 (drop=old);&lt;BR /&gt;189 set &amp;amp;ah_last2 (rename=(ACCT_NO=oldACCT CUST_NO=oldCUST SEGMENT_ID=oldSegmentID ACCT_TYPE=oldACCT_TYPE));&lt;BR /&gt;190 ACCT_NO=input(oldACCT,16.0);&lt;BR /&gt;191 CUST_NO=input(oldCUST,16.0);&lt;BR /&gt;192 SEGMENT_ID=input(oldSegmentID,16.0);&lt;BR /&gt;193 ACCT_TYPE=input(oldACCT_TYPE,16.0);&lt;BR /&gt;194 run;&lt;/P&gt;&lt;P&gt;WARNING: The variable old in the DROP, KEEP, or RENAME list has never been referenced.&lt;BR /&gt;NOTE: There were 41599 observations read from the data set WORK.CBO2807.&lt;BR /&gt;NOTE: The data set WORK.CBO2807 has 41599 observations and 66 variables.&lt;BR /&gt;NOTE: DATA statement used (Total process time):&lt;BR /&gt;real time 0.11 seconds&lt;BR /&gt;cpu time 0.07 seconds&lt;/P&gt;&lt;P&gt;195&lt;BR /&gt;196 data &amp;amp;depo_last (drop=old);&lt;BR /&gt;197 set &amp;amp;depo_last (rename=(AccountNo=oldACCT SegmentCo=oldSegmentCo Balance=oldBalance));&lt;BR /&gt;198 AccountNo=input(oldACCT,16.0);&lt;BR /&gt;199 Balance=input(oldBalance,16.0);&lt;BR /&gt;200 SegmentCo=input(oldSegmentCo,16.0);&lt;BR /&gt;201 run;&lt;/P&gt;&lt;P&gt;NOTE: Numeric values have been converted to character values at the places given by: (Line):(Column).&lt;BR /&gt;199:19&lt;BR /&gt;WARNING: The variable old in the DROP, KEEP, or RENAME list has never been referenced.&lt;BR /&gt;NOTE: There were 3349 observations read from the data set WORK.DEPO2907.&lt;BR /&gt;NOTE: The data set WORK.DEPO2907 has 3349 observations and 25 variables.&lt;BR /&gt;NOTE: DATA statement used (Total process time):&lt;BR /&gt;real time 0.02 seconds&lt;BR /&gt;cpu time 0.01 seconds&lt;/P&gt;&lt;P&gt;202&lt;BR /&gt;203&lt;BR /&gt;204 data &amp;amp;depo_last2 (drop=old);&lt;BR /&gt;8 The SAS System 15:25 Monday, August 9, 2021&lt;/P&gt;&lt;P&gt;205 set &amp;amp;depo_last2 (rename=(AccountNo=oldACCT SegmentCo=oldSegmentCo Balance=oldBalance));&lt;BR /&gt;206 AccountNo=input(oldACCT,16.0);&lt;BR /&gt;207 Balance=input(oldBalance,16.0);&lt;BR /&gt;208 SegmentCo=input(oldSegmentCo,16.0);&lt;BR /&gt;209 run;&lt;/P&gt;&lt;P&gt;NOTE: Numeric values have been converted to character values at the places given by: (Line):(Column).&lt;BR /&gt;207:19&lt;BR /&gt;WARNING: The variable old in the DROP, KEEP, or RENAME list has never been referenced.&lt;BR /&gt;NOTE: There were 3350 observations read from the data set WORK.DEPO2807.&lt;BR /&gt;NOTE: The data set WORK.DEPO2807 has 3350 observations and 25 variables.&lt;BR /&gt;NOTE: DATA statement used (Total process time):&lt;BR /&gt;real time 0.02 seconds&lt;BR /&gt;cpu time 0.01 seconds&lt;/P&gt;&lt;P&gt;210&lt;BR /&gt;211 proc sql;&lt;BR /&gt;212 create table lastworking2 as&lt;BR /&gt;213 select * from &amp;amp;depo_last, &amp;amp;ah_last.cust_no as CIF, &amp;amp;ah_last.name1, &amp;amp;ah_last.name2,&amp;amp;ah_last.add1, &amp;amp;ah_last.add2,&lt;BR /&gt;__&lt;BR /&gt;22&lt;BR /&gt;76&lt;BR /&gt;213 ! &amp;amp;ah_last.add3, &amp;amp;ah_last.add4, &amp;amp;ah_last.telex_no, &amp;amp;ah_last.acct_type, &amp;amp;ah_last.int_rate, &amp;amp;ah_last.DEAL_COM_D,&lt;BR /&gt;213 ! &amp;amp;ah_last.DEAL_MAT_D from &amp;amp;depo_last2&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;ERROR 22-322: Syntax error, expecting one of the following: ;, ',', ANSIMISS, CROSS, EXCEPT, FULL, GROUP, HAVING, INNER, INTERSECT, &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;JOIN, LEFT, NATURAL, NOMISS, ORDER, OUTER, RIGHT, UNION, WHERE.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;ERROR 76-322: Syntax error, statement will be ignored.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;Thanks&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Aug 2021 05:37:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Error-22-322-amp-76-322/m-p/760310#M240414</guid>
      <dc:creator>Trunghuynh</dc:creator>
      <dc:date>2021-08-09T05:37:50Z</dc:date>
    </item>
    <item>
      <title>Re: Error 22-322 &amp; 76-322</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Error-22-322-amp-76-322/m-p/760372#M240439</link>
      <description>&lt;P&gt;Please in the future when posting LOG text, open a text box on the forum with the &amp;lt;/&amp;gt; that appears above the window and paste the text there. The message windows reformat text moving the position of the diagnostic characters posted. The underscore and 22 should appear under the character where SAS determines the error to be.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In this case I think this was originally&lt;/P&gt;
&lt;PRE&gt;select * from &amp;amp;depo_last, &amp;amp;ah_last.cust_no as CIF, &amp;amp;ah_last.name1, &amp;amp;ah_last.name2,&amp;amp;ah_l&lt;BR /&gt;                        _         &lt;/PRE&gt;
&lt;P&gt;&amp;amp;depo_last is apparently a data set and you cannot have a list of variables, which the &amp;amp;ah_last.cust_no and such appear to be.&lt;/P&gt;
&lt;P&gt;You would have to have all the variables on the select. As soon as you have From that ends the select. So SAS expects another a join instruction or end of the select.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So you need to go back to the drawing board, or at least the code that worked without any macro variables and see what change you actually need to make to that Proc SQL call.&lt;/P&gt;</description>
      <pubDate>Mon, 09 Aug 2021 14:19:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Error-22-322-amp-76-322/m-p/760372#M240439</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-08-09T14:19:16Z</dc:date>
    </item>
    <item>
      <title>Re: Error 22-322 &amp; 76-322</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Error-22-322-amp-76-322/m-p/760393#M240447</link>
      <description>&lt;P&gt;Hi Ballardw, thanks for your response. Actually the code was running fine on SAS 9.3. I am currently running this code on SAS 9.4 and facing this kind of problem. I will give it a go with your advice and see how it goes. Thanks buddy!&lt;/P&gt;</description>
      <pubDate>Mon, 09 Aug 2021 15:19:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Error-22-322-amp-76-322/m-p/760393#M240447</guid>
      <dc:creator>Trunghuynh</dc:creator>
      <dc:date>2021-08-09T15:19:46Z</dc:date>
    </item>
  </channel>
</rss>

