BookmarkSubscribeRSS Feed
Cruiser13
Fluorite | Level 6
Yesterday when I ran my code, everything worked fine. Today things haven’t been working normally. When I ran the code to establish my libraries, variables, etc. everything ran fine. Now, when I try to run any of the data steps, it says that it’s “Running DATA step”, but it’s not moving on from that or producing results (and the Log is blank).

Does anyone know how to fix this???

TIA!
5 REPLIES 5
ballardw
Super User

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.

Cruiser13
Fluorite | Level 6
I have run; statements at the end of each step.

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;
ballardw
Super User

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 '

mkeintz
PROC Star

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

--------------------------
Astounding
PROC Star

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.

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 5 replies
  • 1657 views
  • 1 like
  • 4 in conversation