I am trying to run this code to pull data from a sql server for 08/31/2017 month particularly. That's why I specify the WHERE statement. I looked at the Source data, the field PORTFOLIO (to specify the month) is text file in format of 083117. The &adate has the same format as 083117 but I don't why it still did not pull the data for me. I tried this
%nrbquote(')&adate%nrbquote(')and still did not work. Can someone help me please?
%macro loopthrough(from_date=, to_date=);
%do filedate=&from_date %to &to_date;
%if %substr(&filedate,5,2) ge 01 AND %substr(&filedate,5,2) le 12 %then %do;
First, have non macro version of your code working. Then by using MPRINT you get the same syntax with macro logic. Then I see no reason to use explicit SQL pass through here, it just complicates the code..
Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.
If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website.