Re: How to execute a piece of SAS code within a fix time period

Reply
Super User
Super User
Posts: 7,942

Re: How to execute a piece of SAS code within a fix time period

I would think you need to do a pre-check of the web address through your command shell to check its present, I don't use Unix so this is a bit guess work (taken from Linux and Unix ping command help and examples):

data results;

     length buffer $2000.;

     infile 'ping "google.com" -c 1';

     input buffer $;

     if index(buffer,'1 received') then call symput('RUN',"YES");

run;

%macro Do_Your_Code ();

     %if "&RUN."="YES" %then %do;

          ...

     %end;

%mend;

...

New Contributor
Posts: 4

Re: How to execute a piece of SAS code within a fix time period

in your code if google.com is in hung state then it will not go to the next line of code, it will wait for some reply from the url, but my requirement is if google.com is not responding then also it should go to the next line of code after a specied number of seconds

New Contributor
Posts: 4

Re: How to execute a piece of SAS code within a fix time period

how to store output of an unix command in sas dataset?

Super User
Super User
Posts: 7,942

Re: How to execute a piece of SAS code within a fix time period

Ask a Question
Discussion stats
  • 3 replies
  • 166 views
  • 0 likes
  • 2 in conversation