- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
options nocenter compress=yes nomlogic symbolgen;
2 options nofullstimer mprint;
3
4 libname ayb "hasasaa/reporting/projects/adhoc_pm_sadiq/sasdata";
NOTE: Library AYB does not exist.
5 libname ayb_lu "hasasaa/reporting/projects/p_6018_AYB/sasdata";
NOTE: Library AYB_LU does not exist.
6
7
8 Proc sql;
9 Create table match_ayb as
10 Select a.*
11 ,b.*
12 From ayb_lu.lu_ayb as a
13 left join ayb.AYB-WELLNESS CNPS_Q1 2017 as b
_
22
76
ERROR 22-322: Syntax error, expecting one of the following: a name, (, AS, ON.
Hello I keep getting this error, also it is saying my libaraires do not exist. If someone could help, that would be helpful!
Thank you
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
hasasaa/reporting/projects/p_6018_AYB/sasdata
is a UNIX relative path name (does not start with a forward slash, and therefore not at the root directory), so SAS will start searching from the directory where the SAS process was started (usually a location in the SAS configuration tree), so you won't find the directory for the library.
Use the absolute path, starting at the root directory of the server; if the path is found in your home directory ("Files" in Enterprise Guide), use $HOME as the start.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Seems to me that you have a space in
ayb.AYB-WELLNESS CNPS_Q1 2017 as b
which causes this problem
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
I did take out the space but the same error keeps coming up
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hello
I keep getting this error while trying to join, and also my libaries are saying do not exist? I just wanted to see where the on, as was missing. I cant seem to figure it out thanks
NOTE: Library SASDATA does not exist.
5 libname sasdatap "hasasaa/reporting/projects/p_6018_AYB/sasdata";
NOTE: Library SASDATAP does not exist.
6
7
8 Proc sql;
9 Create table match_ayb as
10 Select a.*
11 ,b.*
12 From sasdatap.lu_ayb a
13 Left join sasdata.AYB-WELLNESSCNPS_Q12017 b
_
22
76
ERROR 22-322: Syntax error, expecting one of the following: a name, (, AS, ON.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
AYB-WELLNESSCNPS_Q12017
is not a valid SAS name (only characters, digits and underlines). Replace the dash with an underline (as it should already have been, as you wouldn't be able to create such a dataset anyway).
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
hasasaa/reporting/projects/p_6018_AYB/sasdata
is a UNIX relative path name (does not start with a forward slash, and therefore not at the root directory), so SAS will start searching from the directory where the SAS process was started (usually a location in the SAS configuration tree), so you won't find the directory for the library.
Use the absolute path, starting at the root directory of the server; if the path is found in your home directory ("Files" in Enterprise Guide), use $HOME as the start.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
It also helps to post error messages with code from the log into a code box opened with the forum {i} icon as the main message windows reformat your text somewhat and the position of the _ in the error message helps diagnose the code.
Example with code box:
55 proc sql; 56 select * 57 from sashelp.c-lass; - 22 76 ERROR 22-322: Syntax error, expecting one of the following: GROUP, HAVING, ORDER, WHERE.
the _ is under the dash showing where the exact error is.
But in the main window:
55 proc sql;
56 select *
57 from sashelp.c-lass;
-
22
76
ERROR 22-322: Syntax error, expecting one of the following: GROUP, HAVING, ORDER, WHERE.
The _ indicator is now in a much less helpful position.