BookmarkSubscribeRSS Feed
CarlosFrancisco
Calcite | Level 5

Hi all,

 

I'm trying to kill my SAS Session in an alert message created by my Stored Process Output.

 

Currently i have this macro:

 

%macro output(output_tp);

%if &output_tp = 1 %then %do;
DATA _NULL_;
file _webout ;
val = '<script type="text/JavaScript"> if (confirm("Adhoc Loading, do you wish to abort the process?"))
{
alert("Process Terminated");
}
</script>';
put val;
run;
%end;

%mend output;

%output(1);

 

After the alert "Process Terminated" i would like to execute something like  x "kill -9 &SYSJOBID" but i don't know how to do it inside HTML.

 

Using 9.3 in Solaris

  

Best regards and thanks a lot for your help,
 
Carlos Francisco

 

 

2 REPLIES 2
error_prone
Barite | Level 11

The good news: You can't do this inside html. The corresponding sas-process has not been started just for the job you are terminating. The process will be re-used to run other stored processes and eventually be killed after some time of inactivity - depends on configuration. Using endsas command inside stored process code is not recommended.

ChrisBrooks
Ammonite | Level 13

As @error_prone said this wouldn't be a good idea even if it were possible. One of the big advantages of running a SAS Stored Process Server is that you effectively have a pool of available sessions which will be used to quickly execute Stored Processes without the start-up costs associated with creating new sessions. My advice would be the same as @error_prone - just leave well alone, they won't be using much resource until you need them.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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
  • 2 replies
  • 1124 views
  • 0 likes
  • 3 in conversation