DATA Step, Macro, Functions and more

How do I run the same program multiple times with macro value changed

Reply
N/A
Posts: 0

How do I run the same program multiple times with macro value changed

Hi

I have written a program converting flat files into data. These files are submitted weekly. My problem is that I have files from back to 2006 and to avoid manually runnning the program for each week I would like to do find an easier way.

As the first thing in my program I have a macro giving a week number and a year number:
%let week = XX;
%let year = XX;

Is it possible for the week to go from 01 til 52? (running the program 52 times with only week changed). I have tried putting it all in a do-loop but it doesn't seems to work with an entire program.

All help is appreciated.

Thanks.
Super Contributor
Super Contributor
Posts: 3,174

Re: How do I run the same program multiple times with macro value changed

Share what code you have for feedback. Yes, the WEEK of a year can go to 53, and there are considerations for what is termed "ISO year/date/week" to consider, influenced by the day-of-week when a year starts. The SAS support http://support.sas.com/ website has reference information on the topic - here is a Google advanced search argument against site SAS.COM only:

iso week site:sas.com



Scott Barry
SBBWorks, Inc.
Ask a Question
Discussion stats
  • 1 reply
  • 142 views
  • 0 likes
  • 2 in conversation