I’m working on a macro which should stop a SAS process under certain conditions.
Everything works fine for batch jobs – but what command would I have to submit if this code runs out of an EG session and I just want to stop the process without disconnecting from the server (behavior like ‘stop’ in the EG 4.2 ‘Task Status Window’?
Feels like an old problem – but I just can’t recall how it’s done.
put 'Before Abort';
abort return 0 nolist;
put 'After Abort';
…but this ends the session and I lose all the work tables.
What I actually wanted to do is to test SAS scripts developed in EG which are using a macro at the beginning of the script which stops processing under certain conditions (ETL process: Don't load data already loaded into a target table but stop processing).
Seems I can develop the code with EG but have to test it in batch in order to not get disconnected from the workspace server.
You still might consider using macro logic to conditionally execute the pieces you might need, rather than use ABORT. ABORT works fine in batch, but if you ever want to run the process in a stored process or in EG, ABORT or ENDSAS might have undesired consequences.