BookmarkSubscribeRSS Feed
mcgrant1
Calcite | Level 5

Hello guys, I am quite new to SAS programming, so I am writing this sql sub query in SAS 9.4, and came across error 22-322, below are the logs, thank you all for the help! 

 

 

 

146  proc sql;
147  create table work.ALM_BAD_NUMBERS  as
148  select
149  S.LOCCODE,
150  D._ACCOUNT,
151  D._NUMBER,
152  D._NUMBER2,
153  D._NUMBER1,
154  D._NUMBER3,
155  D._LISTNAME,
156  mdy(input(substr(S.STEBTDT,1,2),2.),input(substr(S.STEBTDT,4,2),2.),2000+input(substr(S.STEBT
156! DT,7,2),2.)) as STENTDT,
157  mdy(input(substr(S.LASTCNCTDTE,1,2),2.),input(substr(S.LASTCNCTDTE,4,2),2.),2000+input(substr
157! (S.LASTCNCTDTE,7,2),2.)) as LASTCNCTDTE,
158
159
160  from
161  Alm.cl_PP_ALL_dynamic as D
     ---
     22
ERROR 22-322: Syntax error, expecting one of the following: !, !!, &, (, *, **, +, ',', -, /, <,
              <=, <>, =, >, >=, ?, AND, BETWEEN, CONTAINS, EQ, EQT, FROM, GE, GET, GT, GTT, LE,
              LET, LIKE, LT, LTT, NE, NET, OR, ^=, |, ||, ~=.

162  LEFT JOIN
     ----
     22
     76
ERROR 22-322: Syntax error, expecting one of the following: a quoted string, ',', AS, FORMAT,
              FROM, INFORMAT, INTO, LABEL, LEN, LENGTH, TRANSCODE.

ERROR 76-322: Syntax error, statement will be ignored.

163  Alm.cl_PP_ALL_static as S
164  ON
165  D.contact_record_id = S.contact_record_id
166  ;
167  quit;

1 REPLY 1
PaigeMiller
Diamond | Level 26

Line 157 ... remove the comma at the end

--
Paige Miller