Learning SAS? Welcome to the exclusive online community for all SAS learners.

Syntax error when I try to get a file

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 13
Accepted Solution

Syntax error when I try to get a file

Hello, 

 

I am a SAS Studio on Demand user and am trying to get a file that used to be in a temp directory. There was an outage yesterday and I am no longer able to access it that way.  It is now in my _sasuser.v94 folder under Files (Home).  I get the following error message when I try to get it.  I have copied my code and the error message.  Can you help, please?

Code:

PROC SQL;

CREATE TABLE WORK.query AS
SELECT *
FROM _sasuser.v94.gss2013
WHERE prd_10 le 6;
RUN;

 

Error Message;

 
1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
70
71 PROC SQL;
72
73 CREATE TABLE WORK.query AS
74 SELECT *
75 FROM _sasuser.v94.gss2013
_
22
200
ERROR 22-322: Syntax error, expecting one of the following: a name, ;, (, ',', ANSIMISS, AS, CROSS, EXCEPT, FULL, GROUP, HAVING,
INNER, INTERSECT, JOIN, LEFT, NATURAL, NOMISS, ORDER, OUTER, RIGHT, UNION, WHERE.
 
ERROR 200-322: The symbol is not recognized and will be ignored.
 
76 WHERE prd_10 le 6;
NOTE: PROC SQL set option NOEXEC and will continue to check the syntax of statements.
77 RUN;
NOTE: PROC SQL statements are executed immediately; The RUN statement has no effect.
78
79 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
91

Accepted Solutions
Solution
‎02-01-2018 07:08 PM
Super User
Posts: 23,937

Re: Syntax error when I try to get a file

Posted in reply to ltossutti0

That file doesn't look like it's in the SAS USER folder, it's somewhere else. 

Right click the file, get the path and remove the portion wiht the file name to create the library. 

Then try and access the file. 

View solution in original post


All Replies
Super User
Posts: 23,937

Re: Syntax error when I try to get a file

[ Edited ]
Posted in reply to ltossutti0

There's no _ before the library name. 

 

Try something like the following

 

PROC SQL;
CREATE TABLE WORK.query AS
SELECT *
FROM sasuser.v94.gss2013
WHERE prd_10 le 6;
RUN;

 


ltossutti0 wrote:

Hello, 

 

I am a SAS Studio on Demand user and am trying to get a file that used to be in a temp directory. There was an outage yesterday and I am no longer able to access it that way.  It is now in my _sasuser.v94 folder under Files (Home).  I get the following error message when I try to get it.  I have copied my code and the error message.  Can you help, please?

Code:

PROC SQL;

CREATE TABLE WORK.query AS
SELECT *
FROM _sasuser.v94.gss2013
WHERE prd_10 le 6;
RUN;

 

Error Message;

 
1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
70
71 PROC SQL;
72
73 CREATE TABLE WORK.query AS
74 SELECT *
75 FROM _sasuser.v94.gss2013
_
22
200
ERROR 22-322: Syntax error, expecting one of the following: a name, ;, (, ',', ANSIMISS, AS, CROSS, EXCEPT, FULL, GROUP, HAVING,
INNER, INTERSECT, JOIN, LEFT, NATURAL, NOMISS, ORDER, OUTER, RIGHT, UNION, WHERE.
 
ERROR 200-322: The symbol is not recognized and will be ignored.
 
76 WHERE prd_10 le 6;
NOTE: PROC SQL set option NOEXEC and will continue to check the syntax of statements.
77 RUN;
NOTE: PROC SQL statements are executed immediately; The RUN statement has no effect.
78
79 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
91

 

 

Occasional Contributor
Posts: 13

Re: Syntax error when I try to get a file

Thank you very much for your suggestion.  I have tried removing the underscore and I still get an error message.  I have also tried removing the underscore and using the directory name suggested by the other poster.  

PROC Star
Posts: 548

Re: Syntax error when I try to get a file

Posted in reply to ltossutti0

_sasuser.v94.gss2013

 

thera are 2 many dots. is it _sasuserv94.gss2013

Occasional Contributor
Posts: 13

Re: Syntax error when I try to get a file

Thank you very much for your suggestion, but I still get an error message.

PROC Star
Posts: 548

Re: Syntax error when I try to get a file

Posted in reply to ltossutti0

@Reeza answer is what u want. you have to define the library

Super User
Posts: 23,937

Re: Syntax error when I try to get a file

Posted in reply to ltossutti0

Sorry, please disregard my previous message. You need to first assign a library to that location and then you can use that library to access the file. 

 

libname out '/home/reeza/sasuser.v94';

proc sql;
create table myTable as
select *
from out.gss2013;
quit;
Occasional Contributor
Posts: 13

Re: Syntax error when I try to get a file

Hello and thank you for the suggestion.  I received an error message that file out.gss2013.data does not exist, but I can see that it is in the folder.

Occasional Contributor
Posts: 13

Re: Syntax error when I try to get a file

Posted in reply to ltossutti0

This is the code I used:

 

libname out '/home/ltossutti0/sasuser.v94';
proc sql;
create table myTable as
select *
from out.gss2013;
quit;

Super User
Posts: 23,937

Re: Syntax error when I try to get a file

Posted in reply to ltossutti0

ltossutti0 wrote:

This is the code I used:

 

libname out '/home/ltossutti0/sasuser.v94';
proc sql;
create table myTable as
select *
from out.gss2013;
quit;


This didn't work? 

If not, post your new log please. 

Occasional Contributor
Posts: 13

Re: Syntax error when I try to get a file

libname out '/home/ltossutti0/sasuser.v94';
proc sql;
create table myTable as
select *
from out.gss2013;
quit;

Occasional Contributor
Posts: 13

Re: Syntax error when I try to get a file

This is the log I receive after identifying the libname:

 

OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
70
71 libname out'/home/ltossutti0/sasuser.v94';
NOTE: Libref OUT refers to the same physical library as SASUSER.
NOTE: Libref OUT was successfully assigned as follows:
Engine: V9
Physical Name: /home/ltossutti0/sasuser.v94
72 proc sql;
73 create table myTable as
74 select *
75 from out.gss2013;
ERROR: File OUT.GSS2013.DATA does not exist.
NOTE: PROC SQL set option NOEXEC and will continue to check the syntax of statements.
76 quit;
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE SQL used (Total process time):
real time 0.00 seconds
user cpu time 0.00 seconds
system cpu time 0.00 seconds
memory 48.53k
OS Memory 26532.00k
Timestamp 01/25/2018 05:02:39 PM
Step Count 54 Switch Count 0
Page Faults 0
Page Reclaims 23
Page Swaps 0
Voluntary Context Switches 0
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 0
 
Super User
Posts: 23,937

Re: Syntax error when I try to get a file

Posted in reply to ltossutti0

This is a different error now. 

Run a proc datasets on the library and post the output here please:

 

libname out 'your path here';
proc datasets lib=out; run;
Occasional Contributor
Posts: 13

Re: Syntax error when I try to get a file

I have attached the log output here.  I can see the gss2013 file in the Files(Home) Directory, sasuser.v94 folder.

Occasional Contributor
Posts: 13

Re: Syntax error when I try to get a file

Posted in reply to ltossutti0

Hello Reeza,  

 

Thank you for all your help.  Would it help if I forwarded a screen shot of the files listed under the sasuser.v94 folder in Home (Files) and the files in Libraries? 

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 20 replies
  • 254 views
  • 2 likes
  • 3 in conversation