- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Does anyone know how to fix this???
TIA!
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
It is possible that you submitted code without a RUN; statement and that did not include any procedure or other statement after the data step that tells SAS to imply that a run was implied.
Hint: if you write code end procedures with the appropriate Run; or Quit; statement when needed. It will save many headaches in the long run. The bit that SAS will usually figure out what to do from syntax fails when nothing follows.
Or show us the code of the data step and what follows.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Here’s an example of the first data step that won’t move on from running:
Data zip2;
Set code.zip1;
Where year in (2015 2016 2017 2018 2019);
If number = 1234 then city = ‘City Name’;
Run;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
One of the reasons to include code is because it very often shows the problem.
And we have a winner.
If number = 1234 then city = ‘City Name’;
You are not using quotes that SAS understands. The "curly" quotes are likely the cause.
SAS expects quotes to look like '
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
The most common precipitant of this behavior in my experience is when I submit code for a single data step and forget to append a "RUN;" statement. The fix is to follow up with a "RUN;".
But, if in the same SAS session, I follow this up with another "incomplete" DATA step, the first one will run.
The hash OUTPUT method will overwrite a SAS data set, but not append. That can be costly. Consider voting for Add a HASH object method which would append a hash object to an existing SAS data set
Would enabling PROC SORT to simultaneously output multiple datasets be useful? Then vote for
Allow PROC SORT to output multiple datasets
--------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Without seeing the code you are running, it's impossible to tell where the error lies. It could be a missing closed quote, for example:
data zip2;
set code.zip1;
where year in (2015 2016 2017 2018 2019);
if number = 1234 then city = ‘City Name;
run;
Now "run;" becomes part of the value being assigned to CITY.
As a general strategy, though, I would start with a fresh session. Where the non-running code begins, replace it with:
data _null_;
set code.zip1;
run;
If this step runs, you know the problem is in the DATA step. If this step doesn't run, you know the problem lies in the earlier code that establishes your libraries, etc.