SAS creating global macro and printing it

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

I am new to SAS environment. I just want to create a global this month variable and print it & use it
in the where condition of data step. My test codes are below:

    %macro vars();
        %global PTF;
        %global YBT;
        %global this_month = MONTH(today());
    %mend vars;
    %put this_month=&this_month; 

    The log in put statement is:  
    WARNING: Apparent symbolic reference THIS_MONTH not resolved.  
    this_month=&this_month

I expect the log as this_month=7, but no such result appears.How can i do this? Thanks in advance.

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

LEAVE A COMMENT