Hi all, Hopefully this is an easy one for someone, but I am beating my head. It's probably something simple. I have a simple macro to apply formatting to a date var based on the day of the month, if I hard code a date into the DATE function, the macro works fine. But, if I use the date variable that I need to use, it errors out. Additionally, I am unable to use IN in the %IF statement... I can only use = with a series of ORs. Does anyone see what the problem is? The date field, offer_expiration is in DATE9. format. The error message is below the code. Thanks!!! %macro form(); data catawba; set final_wb; %if %sysfunc(day(offer_expiration)) = 1 or %sysfunc(day(offer_expiration)) = 21 or %sysfunc(day('21JUN2014'D)) = 31 %then %do; format exp_dateN MMDDYY10. exp_dateA2 myfmtst14.; exp_dateN=offer_expiration; exp_dateA2=offer_expiration; exp_dateA=strip(trim(put(exp_dateA2,myfmtst14.))); keep card_code Dealer_Name New_Offer Contact_Person Address_1 Address_2 City state zipcode exp_dateN exp_dateA; %end; %else %if %sysfunc(day(offer_expiration)) = 2 or %sysfunc(day(offer_expiration)) = 22 %then %do; format exp_dateN MMDDYY10. exp_dateA2 myfmtnd14.; exp_dateN=offer_expiration; exp_dateA2=offer_expiration; exp_dateA=strip(trim(put(exp_dateA2,myfmtnd14.))); keep card_code Dealer_Name New_Offer Contact_Person Address_1 Address_2 City state zipcode exp_dateN exp_dateA; %end; %else %if %sysfunc(day(offer_expiration)) = 3 or %sysfunc(day(offer_expiration)) = 23 %then %do; format exp_dateN MMDDYY10. exp_dateA2 myfmtrd14.; exp_dateN=offer_expiration; exp_dateA2=offer_expiration; exp_dateA=strip(trim(put(exp_dateA2,myfmtrd14.))); keep card_code Dealer_Name New_Offer Contact_Person Address_1 Address_2 City state zipcode exp_dateN exp_dateA; %end; %else %do; format exp_dateN MMDDYY10. exp_dateA2 myfmtth14.; exp_dateN=offer_expiration; exp_dateA2=offer_expiration; exp_dateA=strip(trim(put(exp_dateA2,myfmtth14.))); keep card_code Dealer_Name New_Offer Contact_Person Address_1 Address_2 City state zipcode exp_dateN exp_dateA; %end; run; %mend; %form(); ERROR: Argument 1 to function DAY 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. ERROR: Argument 1 to function DAY 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. ERROR: Argument 1 to function DAY 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. ERROR: Argument 1 to function DAY 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. ERROR: Argument 1 to function DAY 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. ERROR: Argument 1 to function DAY 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.
... View more