Hi, I am trying to convert a date in a macro to date9 so that I can use it in a function to add or subtract days from it. Here is the code: %Macro Calc_work_days (start_date_in , days_in ,direction_in ); %put &start_date_in; %put &days_in; %put &direction_in; /* This routine will add or subtract a specified number of days (ie: days_in) to a date (ie: start_date). */ /* It will skip all weekend days - Saturdays and Sundays */ %LET v_counter = 0; %let v_new_date = %sysfunc(inputn(%sysfunc(compress(&start_date_in, "'")), mmddyy10.), date9.); %put v_new_date outside = &v_new_date; %put days_in = &days_in; %LET v_new_bus_date = %sysfunc(intnx('day',&v_new_date,&direction_in)); %put v_new_bus_date inside = &v_new_bus_date; %LET v_day_number = %sysfunc(weekday(&v_new_date.)); %put v_day_number inside = &v_day_number; %mend Calc_work_days; %Calc_work_days ('11/29/2022',1,-1 ); And the log which shows the error: '11/29/2022' 1 -1 v_new_date outside = 29NOV2022 days_in = 1 ERROR: Argument 2 to function INTNX referenced by the %SYSFUNC or %QSYSFUNC macro function is not a number. ERROR: Invalid arguments detected in %SYSCALL, %SYSFUNC, or %QSYSFUNC argument list. Execution of %SYSCALL statement or %SYSFUNC or %QSYSFUNC function reference is terminated. v_new_bus_date inside = . ERROR: Argument 1 to function WEEKDAY referenced by the %SYSFUNC or %QSYSFUNC macro function is not a number. ERROR: Invalid arguments detected in %SYSCALL, %SYSFUNC, or %QSYSFUNC argument list. Execution of %SYSCALL statement or %SYSFUNC or %QSYSFUNC function reference is terminated. v_day_number inside = . NOTE: Remote submit to EMSVR complete. Any help would be appreciated!
... View more