The SAS Output Delivery System and reporting techniques

file zipping thru macro

Reply
Contributor
Posts: 74

file zipping thru macro

Hi all,

I have a requirement,where i need to zip 100 plus files into one file,here is the sample code i am working on;


options mprint mlogic;
%let outaz=P:\test\AA_201004.zip;
%let libd7=E:\test\data\AZ\,aa_test_2007.sas7bdat;
%let libd8=E:\test\data\AZ\,aa_test_2008.sas7bdat;
%let libd9=E:\test\data\AZ\,aa_test_2009.sas7bdat;
%let libd10=E:\test\data\AZ\,aa_test_2010.sas7bdat;
%let libh7=E:\test\data\AZ\,aa_test1_2007.sas7bdat;
%let libh8=E:\test\data\AZ\,aa_test1_2008.sas7bdat;
%let libh9=E:\test\data\AZ\,aa_test1_2009.sas7bdat;
%let libh10=E:\\test\data\AZ\,aa_test1_2010.sas7bdat;



%macro qc (outaz,lib);


x %bquote("d:\program files (x86)\winzip\WINZIP32.EXE")

-a

%bquote("&out.")

"&lib.";



%mend;



%qc (&outaz.,&libd7.);
%qc (&outaz.,&libd8.);
%qc (&outaz.,&libd9.);
%qc (&outaz.,&libd10.);
%qc (&outaz.,&libd7.);
%qc (&outaz.,&libh8.);
%qc (&outaz.,&libh9.);
%qc (&outaz.,&libh10.);

I am getting an error " More positional parameters found than defined"

Please Help
Super Contributor
Super Contributor
Posts: 3,174

Re: file zipping thru macro

Suggest you activate the OPTIONS below in order to see the macro compilation and macro variable resolution to debug the problem:

OPTIONS SOURCE SOURCE2 MGEN SGEN MLOGIC NOMPRINT;

As the diagnostic stated, you are passing data-strings to your macro execution command which are being interpreted as positional parameters (more than 2).

Scott Barry
SBBWorks, Inc.
Contributor
Posts: 74

Re: file zipping thru macro

Thanks SBB,I corrected it.
Ask a Question
Discussion stats
  • 2 replies
  • 142 views
  • 0 likes
  • 2 in conversation