SAS Macro – ERROR: Required operator not found in expression:

  Kiến thức lập trình

I’m developing a process that will cycle through a file of about 1+ million rows to find the earliest record for my key value. My Plan is to use global macro variables to share across 4 macros. One macro will be the master that calls the other 3. So depending on which macro was called, the global macro variables will be updated.

I’m in the process of testing a macro variable to do an update.

Here is the logic.

    %IF %EVAL(&ACCT_CT. = 1) 
    %THEN %DO;

        DATA _NULL_;

            SET BURNED_HLD;

            CALL SYMPUTX('G_EARN_PRD', 201708);
            CALL SYMPUTX('G_ACCT_ID', AC_I);
            CALL SYMPUTX('G_BURN_PRD', REDEEM_PERIOD);
            CALL SYMPUTX('G_BURN_PTS', REDEEMED_PTS);
        RUN;

        %PUT &G_ACCT_ID.;

        %FIRST_ACCT;

    %END;
    %ELSE %IF %EVAL(&G_REM_BURN_PTS. < 0)
    %THEN %DO;

        %REMAIN_BURN;
    %END;

This did not produce an error on the first pass but when it hits the 2nd, I get this error.

SYMBOLGEN: Macro variable ACCT_CT resolves to 2
MLOGIC(BURN_PTS): %IF condition %EVAL(&ACCT_CT. = 1) is FALSE
SYMBOLGEN: Macro variable G_REM_BURN_PTS resolves to 0)
ERROR: Required operator not found in expression: %EVAL(&G_REM_BURN_PTS. < 0)
ERROR: The macro BURN_PTS will stop executing.
MLOGIC(BURN_PTS): Ending execution.

Any help will be very much appreciated.

Since I have a %PUT &CT in the code and it does confirm it it as 2, my expectation is for the %IF to fail and the code drops to the %ELSE.

New contributor

user26336812 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

Theme wordpress giá rẻ Theme wordpress giá rẻ Thiết kế website

LEAVE A COMMENT