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.
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
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.
Ready to level-up your skills? Choose your own adventure.