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
Yes, sorry to say but it is staring you in the face. You have an extra comma at the end of the preceding line.
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
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"
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
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.
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.
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.