Save the code, restart the session and run the code in a clean session.
The errors about statements not shown, i.e. Filename, is problematic since it would be very session dependent.
Code not completing may be an issue of how you submit it, if submitting "highlighted lines" or similar, or maybe having code in a comment that is not properly ended. Use of macro characters & or % somewhere may also be problematic.
BTW, while learning SAS it is generally not a good idea to use the same data set as source (set statement) and output (data statement) as data steps completely replace a data set when using that structure. So a minor logic error may mean having to go back (some times many) step to recover data that has been removed or modified.
So instead of
data work.cars1;
set work.cars1;
<other code>
It is better to use
data work.cars2;
set work.cars1;
<other code>
Your example isn't too complicated but it can be a real bear to find out "where did that value come from" sometimes when you have replaced the source set.
... View more