BookmarkSubscribeRSS Feed
HelMul
Calcite | Level 5

Hey,

Is anyone able to help me with the below, I'm sure the answer is glaring me in the face but I just can't seem to figure it out..

 

 


15 proc sql;
16 create table UBIF_Impacted_Flag as
17 select t1.Ledger as client_ID
18 ,t1.name
19 ,t1.Status_Update as Status,
20 ,t1.Final_Population Result as 'Impacted_Flag'
_ ______
22 202
ERROR 22-322: Syntax error, expecting one of the following: a name, a quoted string, a numeric constant, a datetime constant,
a missing value, *, BTRIM, INPUT, PUT, SUBSTRING, USER.

ERROR 202-322: The option or parameter is not recognized and will be ignored.

20 ! ,t1.Final_Population Result as 'Impacted_Flag'
______
22
ERROR 22-322: 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, TRANSCODE, ^, ^=, |, ||, ~, ~=.

21 ,t1.FF_Candidate
22 ,t1.Relationship_Manager
23 from egtask.UBIF_Impacted_Population_FINAL t1
24 ;
NOTE: PROC SQL set option NOEXEC and will continue to check the syntax of statements.
25 quit;
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE SQL used (Total process time):
real time 0.00 seconds
cpu time 0.00 seconds

26
27 GOPTIONS NOACCESSIBLE;
28 %LET _CLIENTTASKLABEL=;
29 %LET _CLIENTPROJECTPATH=;
30 %LET _CLIENTPROJECTNAME=;
2 The SAS System 10:16 Monday, July 2, 2018

31 %LET _SASPROGRAMFILE=;
32
33 ;*';*";*/;quit;run;
34 ODS _ALL_ CLOSE;
35
36
37 QUIT; RUN;
38

 

Thanks

5 REPLIES 5
Astounding
PROC Star

Yes, sorry to say but it is staring you in the face.  You have an extra comma at the end of the preceding line.

HelMul
Calcite | Level 5

I removed the comma but same error

 

 

 

15 proc sql;
16 create table UBIF_Impacted_Flag as
17 select t1.Ledger as client_ID
18 ,t1.name
19 ,t1.Status_Update as Status
20 ,t1.Final_Population Result as 'Impacted_Flag'
______
22
202
ERROR 22-322: 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, TRANSCODE, ^, ^=, |, ||, ~, ~=.

ERROR 202-322: The option or parameter is not recognized and will be ignored.

21 ,t1.FF_Candidate
22 ,t1.Relationship_Manager
23 from egtask.UBIF_Impacted_Population_FINAL t1

Astounding
PROC Star

Yes, finding the first error often reveals the next one.

 

What is the name of the field you are trying to bring in?

 

Do you really have a field with an embedded blank in the name:  Final_Population Result

 

I believe that the "as" keyword forces you to select a field name, so you wouldn't need quotes around "Impacted_Flag"

HelMul
Calcite | Level 5

Hey, thanks for pointing the name out it work once I put it in as t1.Final_Population_Result as Impacted_Flag, cheers for your help

PaigeMiller
Diamond | Level 26

From now on, could you please help us all out by posting SASLOGs in the window that appears after you click on the {i} icon? Thank you.

--
Paige Miller

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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
  • 5 replies
  • 2307 views
  • 0 likes
  • 3 in conversation