Hi,
I am trying to unzip a bundle of zip files in SAS DI/SAS 9.4. I use the name of files as input to the loop and below is my code for the job which should run in the loop. However it does not work. It Unzip the first file and the process do not stop and do not unzip the other files. So somehow the loop is not pushing forward from the first value of name.
Can you help?
Here is my code:
options noxsync noxwait;
data _null_;
%put &name.;
X """C:\Program Files\7-Zip\7z.exe"" e ""E:\SAS\Mydata\&name."" -oE:\SAS\MyData\Data\";
run;
Your code does not contain anything that would make it loop (DO, %DO, or reading a dataset/file).
Your code does not contain anything that would make it loop (DO, %DO, or reading a dataset/file).
The loop is in the outer job in sas di. The code above is from the inder job and has name parameters which should run it in a loop.
Then I guess that the macro variable &name never changes, and the same file is unzipped again and again.
H
You said you have an "outer loop" in DI. How does that work, and where does it set the macro variable?
I managed to get things working by including everything in one job. Thank you for your contribution.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.