mercredi 9 septembre 2015

SAS E Guide 5.1 Macro Wrapper not working

I'm looking to conditionally exit a SAS program. Every corner of the internet is suggesting that I encapsulate my code in a macro wrapper, but when I do this, the code appears to no longer be 'recognized' by SAS (keywords are no longer blue). I haven't seen it written anywhere thus far, but I feel that maybe this feature isn't compatible with Enterprise Guide 5.1.

%macro wrapper;
PROC SQL;
    All this is just grey text, to include the PROC SQL and QUIT that should be blue
;QUIT;
%mend wrapper;

Ultimately, I want to have something like this in my code

IF date1 ^= date2 THEN ABORT(the entire program if possible)

I tried using %IF %THEN %GOTO, but it doesn't work unless the entire program is within a macro wrapper, which brings me here.

(I've tried the IF condtion to abort within a DATA step, but it just aborts that block of code, and not the program.)

I hope I've articulated this clearly. Can any SAS wizards out there help? Are there any alternative methods I haven't thought of that could apply to my main goal here?

Thanks everyone!

Aucun commentaire:

Enregistrer un commentaire