Hello,
I am trying to use an INTNX function in my loop code but it doesn't accept reference to a field in my table. What can I replace the injury date with if i want to reference this specific date that is different on each row?
e.g.
%monthly_query1 ((INTNX('month',t1.Injury_Dte,0,'e')))
%monthly_query2 ((INTNX('month',t1.Injury_Dte,1,'e')))
%monthly_query2 ((INTNX('month',t1.Injury_Dte,2,'e')))
%monthly_query2 ((INTNX('month',t1.Injury_Dte,3,'e')))
%monthly_query2 ((INTNX('month',t1.Injury_Dte,4,'e')))
%monthly_query2 ((INTNX('month',t1.Injury_Dte,5,'e')))
Commas are the delimiters of parameters in macros. So the code you show the first comma is ending the parameter. I suspect that you may get errors related to more parameters than defined.
You likely need to quote the value that you want inside %str(<entirevalue goes here>) .
With t1. garbage I assume you are using this to write some SQL code.
You might consider using a data step where you can use a DO loop and an array to hold the values.
Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.
Register today!Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.