BookmarkSubscribeRSS Feed
Prateek1
Obsidian | Level 7

hi,

 

proc sql;
create table NZ AS
Select Olympicscs1.Probability,Olympicscs1.Account_Name as Client,Olympicscs1.Champ,Olympicscs1.Last_Modified_Date as Modified,
format MMDDYY8.,Olympicscs1.Deal_Comments,Olympicscs1.Tot_Budget format dollar20., Olympicscs2.Digi_Budget format dollar20.
FROM Olympicscs1,Olympicscs2
Where Olympicscs1.Probability=Olympicscs2.Prob_Digi and
Olympicscs1.Account_Name=Olympicscs2.Account_Name and Olympicscs1.Probability NE 0
ORDER BY Olympicscs1.Probability;
quit;

 error:

Syntax error, expecting one of the following: a quoted string, !, !!, &, (, *, **, +, ',', -, '.', /, <,
<=, <>, =, >, >=, ?, AND, AS, BETWEEN, CONTAINS, EQ, EQT, FORMAT, FROM, GE, GET, GT, GTT, IN, INFORMAT,
INTO, IS, LABEL, LE, LEN, LENGTH, LET, LIKE, LT, LTT, NE, NET, NOT, NOTIN, OR, ^, ^=, |, ||, ~, ~=.

ERROR 200-322: The symbol is not recognized and will be ignored.

 

what should be the code ?

 

3 REPLIES 3
error_prone
Barite | Level 11

Maybe the comma after "Olympicscs1.Last_Modified_Date as Modified" is the culprit.

toconero
Fluorite | Level 6

Hi Prateek1

 

You should drop , after  Olympicscs1.Last_Modified_Date as Modified in this way format MMDDYY8. runs for this variable, on other hand  you should write a variable for the format.

 

proc sql;
create table NZ AS
Select Olympicscs1.Probability,Olympicscs1.Account_Name as Client,Olympicscs1.Champ,Olympicscs1.Last_Modified_Date as Modified format MMDDYY8.,Olympicscs1.Deal_Comments,Olympicscs1.Tot_Budget format dollar20., Olympicscs2.Digi_Budget format dollar20.
FROM Olympicscs1,Olympicscs2
Where Olympicscs1.Probability=Olympicscs2.Prob_Digi and
Olympicscs1.Account_Name=Olympicscs2.Account_Name and Olympicscs1.Probability NE 0
ORDER BY Olympicscs1.Probability;
quit;

Kurt_Bremser
Super User

Simple code formatting lets the error stand out like a beacon:

proc sql;
create table NZ as select
  Olympicscs1.Probability,
  Olympicscs1.Account_Name as Client,
  Olympicscs1.Champ,
  Olympicscs1.Last_Modified_Date as Modified,
  format MMDDYY8.,
  Olympicscs1.Deal_Comments,
  Olympicscs1.Tot_Budget format dollar20.,
  Olympicscs2.Digi_Budget format dollar20.
from
Olympicscs1,
Olympicscs2 where Olympicscs1.Probability=Olympicscs2.Prob_Digi and Olympicscs1.Account_Name=Olympicscs2.Account_Name and Olympicscs1.Probability NE 0 order by Olympicscs1.Probability ; quit;

Writing spaghetti code is the main culprit here.

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 1210 views
  • 3 likes
  • 4 in conversation