BookmarkSubscribeRSS Feed
Onur_Goekcen
Fluorite | Level 6

Hi,

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)

     %executesas(filename=xx,dir=xx)

  %end

  %somemacro

mend

%macro executesas(filename=,dir=)

    %include sasfile....

%mend

%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...

   quit;

%mend

 

Appriciate your help!

1 REPLY 1
art297
Opal | Level 21

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.

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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
  • 1 reply
  • 613 views
  • 0 likes
  • 2 in conversation