Unbalanced quotes means you started a string literal and never ended it. So now SAS is out of wack and thinks your quoted values are the statements and the statements are part of string literals.
2008 data test; 2009 x='String1'; 2010 y=' - 49 2010! String2 ; NOTE 49-169: The meaning of an identifier after a quoted string might change in a future SAS release. Inserting white space between a quoted string and the succeeding identifier is recommended. 2011 z='String3'; 2012 run;
You can sometimes fix it by submitting an extra quote.
2013 *'; stop; run; NOTE: Character values have been converted to numeric values at the places given by: (Line):(Column). 2010:5 2011:13 NOTE: The SAS System stopped processing this step because of errors. WARNING: The data set WORK.TEST may be incomplete. When this step was stopped there were 0 observations and 2 variables. WARNING: Data set WORK.TEST was not replaced because this step was stopped. NOTE: DATA statement used (Total process time): real time 53.36 seconds cpu time 0.76 seconds
But if all else fails it is best to just close your SAS session and start a new one.
Similar issues can happen with unclosed parentheses.
Also watch out for missing semi-colon.
2014 data test; 2015 x='String1' 2016 run; --- 22 ERROR 22-322: Syntax error, expecting one of the following: !, !!, &, *, **, +, -, /, <, <=, <>, =, >, ><, >=, AND, EQ, GE, GT, IN, LE, LT, MAX, MIN, NE, NG, NL, NOTIN, OR, ^=, |, ||, ~=. 2017 2018 run; NOTE: Character values have been converted to numeric values at the places given by: (Line):(Column). 2015:5 NOTE: The SAS System stopped processing this step because of errors. WARNING: The data set WORK.TEST may be incomplete. When this step was stopped there were 0 observations and 2 variables. WARNING: Data set WORK.TEST was not replaced because this step was stopped. NOTE: DATA statement used (Total process time): real time 0.01 seconds cpu time 0.00 seconds
And watch out for long lines. Your PDF seems to have some statements way off the right side of the page. Sometimes you can have characters out there you don;t see because that extend beyond the window your editor is showing and that will totally mess up your code. Or in rare cases when SAS is reading the code from a file it might only read the first XX characters on each line and miss those characters way out on the right. I find that limiting text lines to 70-75 characters is the best of readability by humans.
Show us the log.
Please copy the log as text and paste it into the window that appears when you click on the {i} icon in your reply. Do not skip this step.
Hi Paige,
The computer I have SAS on does not have internet. So, I have taken a photograph and attached it to my reply.
You seemed to have missed the start of the errors. Normally once you have one error any future errors are likely just artifacts of the first error.
If that first line shown is the first error then it is because you cannot stick an assignment statement in the middle of nowhere. They need to be part of a data step.
data want;
set have;
x=y;
...
run;
Hi Tom,
My apologies, this is what it looks like from the very top:
The RUN statement marked the end of the data step.
Remove it. or move it after the rest of the statements for the data step.
Thank you Tom! I managed to get the SAS environment reading the data file I would like to work with. However, when running the commands I tried to earlier, in my active editor window it is indicating "data step running" for a very long time. Have you had any experience with this when using SAS yourself? I'm not sure what is taking the program so long. It is a fairly large dataset (~ 60 000 participants) but even so, it didn't take that long to run frequency tables, etc. using the dataset.
Any advice you have on the matter would be greatly appreciated!
Sounds like you removed ALL run; statements.
Your data step has to have one and only one run; statement, at the very end, which must be executed along with the rest of the data step. Then it should not show "Running" for a very long time, unless there is some other mistake.
Sounds like you submitted code like:
data x;
set y;
newvar=oldvar/10;
SAS compiles and runs the code in steps. It knows when one steps ends when you either explicitly tell it so with RUN or QUIT statement (which to use depends of the type of step you are running) or you start a new step.
So in this case it is waiting for a RUN statement.
data x;
set y;
newvar=oldvar/10;
run;
Other possibilities are missing semi-colon to the end a statement. Or worse unbalanced quotes.
I've combed over the syntax several times and can't seem to find the issue. I'm not sure what unbalanced quotes mean. If you could elaborate, that would be helpful.
I've attached the syntax here in it's entirety (again, as an image because the computer with SAS has no internet). If either one of you could have a scan through and let me know if anything jumps out at you as an error, that I could modify to make this run. I would greatly appreciate it.
Did you submit with your code the final line which says
run;
?
If not, that would cause the problem that the program seems to run a very long time.
You don't have imbalanced quotes, this would be something where there is not quotes in pairs.
y='text; /* Imbalanced quotes, not a pair of quotes */
y='text'; /* balanced quotes, the quotes are in pairs */
I don't remember if you said how many observations are in valdata.val, but unless we're talking hundreds of millions, it shouldn't go on for hours.
The other thing that can cause this is if something prior to this data step has caused an error. Those are rare, but again it could be imbalanced quotes, or some other error that I can't imagine. Did you check the log for errors prior to this data step?
There are just over 60, 000 observations. No error's prior to this data step. It's the only thing i've run and in the log window, everything looks good. So, I'm stumped.
Unbalanced quotes means you started a string literal and never ended it. So now SAS is out of wack and thinks your quoted values are the statements and the statements are part of string literals.
2008 data test; 2009 x='String1'; 2010 y=' - 49 2010! String2 ; NOTE 49-169: The meaning of an identifier after a quoted string might change in a future SAS release. Inserting white space between a quoted string and the succeeding identifier is recommended. 2011 z='String3'; 2012 run;
You can sometimes fix it by submitting an extra quote.
2013 *'; stop; run; NOTE: Character values have been converted to numeric values at the places given by: (Line):(Column). 2010:5 2011:13 NOTE: The SAS System stopped processing this step because of errors. WARNING: The data set WORK.TEST may be incomplete. When this step was stopped there were 0 observations and 2 variables. WARNING: Data set WORK.TEST was not replaced because this step was stopped. NOTE: DATA statement used (Total process time): real time 53.36 seconds cpu time 0.76 seconds
But if all else fails it is best to just close your SAS session and start a new one.
Similar issues can happen with unclosed parentheses.
Also watch out for missing semi-colon.
2014 data test; 2015 x='String1' 2016 run; --- 22 ERROR 22-322: Syntax error, expecting one of the following: !, !!, &, *, **, +, -, /, <, <=, <>, =, >, ><, >=, AND, EQ, GE, GT, IN, LE, LT, MAX, MIN, NE, NG, NL, NOTIN, OR, ^=, |, ||, ~=. 2017 2018 run; NOTE: Character values have been converted to numeric values at the places given by: (Line):(Column). 2015:5 NOTE: The SAS System stopped processing this step because of errors. WARNING: The data set WORK.TEST may be incomplete. When this step was stopped there were 0 observations and 2 variables. WARNING: Data set WORK.TEST was not replaced because this step was stopped. NOTE: DATA statement used (Total process time): real time 0.01 seconds cpu time 0.00 seconds
And watch out for long lines. Your PDF seems to have some statements way off the right side of the page. Sometimes you can have characters out there you don;t see because that extend beyond the window your editor is showing and that will totally mess up your code. Or in rare cases when SAS is reading the code from a file it might only read the first XX characters on each line and miss those characters way out on the right. I find that limiting text lines to 70-75 characters is the best of readability by humans.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 16. Read more here about why you should contribute and what is in it for you!
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.
Select SAS Training centers are offering in-person courses. View upcoming courses for: