Danzo
Danzo

Reputation: 553

Incrementing and evaluating dates in SAS

I have the following variables:

%let curr_score_date = '31DEC2013'D; 
%let target_date = %sysfunc(intnx(month,&curr_score_date,12,e));
%let prod_start_date = %sysfunc(intnx(month,&curr_score_date,-11,b));
%let prod_end_date = %sysfunc(intnx(month,&curr_score_date,0,e));

If evaluating based on this documentation, I evaluate each statement on its own to:

target_date = '31Dec2014'
prod_start_date = '01Jan2013'
prod_end_date = '31Dec2013'

However, I am wondering if each step just returns a value, or actually updates &curr_score_date. If it was updated at each calculation, this would certainly affect the results.

Upvotes: 0

Views: 31

Answers (1)

Joe
Joe

Reputation: 63424

In SAS, functions return values (and cannot change their arguments), while call routines can change their arguments.

As such, in the above, &curr_score_date cannot be changed by use of %sysfunc.

Upvotes: 2

Related Questions