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-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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