DATA Step, Macro, Functions and more

Executing external files in a row

Occasional Contributor
Posts: 7

Executing external files in a row


hope that i can finally find an explanation for the weird processing in my macro.

I'm executing some SAS codes externally, which do some highly complex calculations and reporting, etc.. If this external file finishes without any errors, then everything is fine and working. But as soon as an Error occures, the main code executing this external files starts acting really weird, e.g existing and populated datasets return zero rows..

Below is a sample describing the processing:

macro main

  %do loop  (here i execute several sasfiles in a row)





%macro executesas(filename=,dir=)

    %include sasfile....


%macro somemacro;

   proc sql;

       select count(1) into :var1 from dataset;     --> Here i receive the notification, that no rows were selected?? This happens only if the included sasfile is finished with errors...




Appriciate your help!

Posts: 8,169

Executing external files in a row

Posted in reply to Onur_Goekcen

I think that you would have to provide more of your code for anyone to "see" what you are doing wrong.  Without that, one can only guess.  My first guess, given the sketchy pseudo code that you provided, is that you are defaulting the assignments of filename and dir in your main macro, and the defaulted files aren't applicable when an error occurs during the process.

Ask a Question
Discussion stats
  • 1 reply
  • 2 in conversation