Hello, I'm having an issue with the code below. No matter what I do I am always served with the Note from my title. SAS will not proceed until I click ok and clear the note. A PROC is currently executing. All subsequently submitted statements will not begin executing until its completion. Similar to this question: https://communities.sas.com/t5/Base-SAS-Programming/How-to-suppress-this-pop-up-note/td-p/303459 I have options xsync; because I plan on using this in a loop where I create a file, password protect it, destroy the XML dynamically. I don't want SAS to hit the delete XML x command before it's completed the conversion. (This may be my problem). /****************************/
/*DUMMY SAS DATA FOR EXAMPLE*/
/****************************/
data FINAL_DATA;
set sashelp.cars;
Keep Make Model Type;
IF Make = 'BMW';
run;
proc sort data=FINAL_DATA;
by Type;
run;
/*************/
/*CREATE FILE*/
/*************/
%macro CreateFile;
ods tagsets.excelxp file="C:\my_folder\XML_FILE.xml" style=listing;
proc print data=FINAL_DATA noobs;
by Type;
run;
ods tagsets.excelxp close;
%mend CreateFile;
/**************************************/
/*CONVERT TO XLSX AND PASSWORD PROTECT*/
/**************************************/
%macro ProtectFile;
%let FinalFile = C:\my_folder\OUTPUT.xlsx;
%let password=test;
%let XMLfile = C:\my_folder\XML_FILE.xml;
%let VBscript = C:\another_folder\convert.vbs;
data _null_;
file "&vbscript" lrecl=200;
put 'Dim xlApp, xlWkb, SourceFile, TargetFile';
put 'Set xlApp = CreateObject("excel.application")';
put 'SourceFile="' "&XMLfile" '"';
put 'Set xlWkb = xlApp.Workbooks.Open(SourceFile)';
put 'TargetFile="' "&FinalFile" '"';
put 'xlApp.DisplayAlerts=false';
put "xlWkb.SaveAs TargetFile, 51,""&password""";
put 'xlApp.DisplayAlerts=true';
put 'xlWkb.close';
run;
options noxwait xsync;
x "cscript ""&vbscript""";
x "del C:\my_folder\XML_FILE.xml";
%mend ProtectFile;
%CreateFile;
%ProtectFile;
... View more