2

In my macro function I need to pass a condition as a parameter , Can i know how to pass a condition like this in sas

ex : where flag="YES"

%macro counts(con= ,out=);
    proc sort data=ads(&con.) out=teaes_sev nodupkey;
        by usubjid surtypen;
    run;

    proc freq data=teaes_sev noprint;
        tables surtypen/out=teae1_sev;
    run;

    proc transpose data=teae1_sev out=&out.;
        id surtypen;
        var count;
    run;
%mend;

%counts(con=where=(flag ="YES".),out=row1 );
Richard
  • 25,390
  • 3
  • 25
  • 38

1 Answers1

2

Remove the extraneous period (.) and the code should work

Change

%counts(con=where=(flag ="YES".),out=row1 );

to

%counts(con=where=(flag ="YES"),out=row1 );
Richard
  • 25,390
  • 3
  • 25
  • 38
  • correct answer of course, but the Stack Overflow standard for typos is to vote-to-close:site specific:typo, and then mention the typo in comments; if it's just a typo we don't want to keep the question/answer around for posterity (unless, perhaps, it's a *very common* typo due to something beyond just accidental keypresses). – Joe Nov 13 '20 at 06:27