BookmarkSubscribeRSS Feed
Sandeep77
Lapis Lazuli | Level 10

Hello Experts,

The error says expecting a ','. But I am not sure what is that. Can you please check and clarify it?


30 proc sql;
31 select a.*,
32 b.accountstatuskey_current,
33 b.accountstatuskey_previous,
34 b.Datekey as Movement_Date date9.
_____
78
76
ERROR 78-322: Expecting a ','.

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

35 from work.add_repcode as a
36 inner join DWHDW.fact_tx_AccountStatus as b on a.Accountkey = b.Accountkey;
NOTE: PROC SQL set option NOEXEC and will continue to check the syntax of statements.
37 quit;
NOTE: The SAS System stopped processing this step because of errors.

3 REPLIES 3
PaigeMiller
Diamond | Level 26
b.Datekey as Movement_Date format=date9.
--
Paige Miller
Kurt_Bremser
Super User

Please use this button to post logs (or other text where no layout change is desired):

Bildschirmfoto 2020-04-07 um 08.32.59.jpg

The "little running man" right next to is for posting SAS code (provides coloring similar to the SAS Enhanced Editor).

 

You need to tell the SQL procedure that DATE9 is a format, otherwise it thinks it's another name.

tarheel13
Rhodochrosite | Level 12

the columns you select in proc SQL have to be separated by commas. you don't specify a format in proc sql by just writing date9. you have to put format= before. you can find examples in the SAS documentation. https://documentation.sas.com/doc/en/pgmsascdc/v_024/sqlproc/n1ncn0pznd8wrln1tnp3xdxjz9xz.htm 

sas-innovate-wordmark-2025-midnight.png

Register Today!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.


Register now!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 3 replies
  • 1338 views
  • 1 like
  • 4 in conversation