Hi,
Having a little problem with a Macro.
Every time i run the macro, my SAS session will hang at the very end..
the above code will run, so it will create datasets for each franchise, and then export the CSV for each dataset.. then when it gets to the very end, SAS will hang...
Can anyone see any problems with the above code?
Thanks in advance
Robbie
Having a little problem with a Macro.
Every time i run the macro, my SAS session will hang at the very end..
Code:
%Macro Region(FTitle=,Franchise=);
Data &FTitle.;
set rwork.Restoration_data;
Where Franchise = "&Franchise.";
Keep Franchise Account_No Workorder Problem_Code Problem_Desc Finding_Code Finding_Desc
Solution_Code Solution_Desc New_Date_Time New_Close_Date_Time Sched_Date AppFlag;
run;
PROC EXPORT DATA=&FTitle.
OUTFILE= "T:\TRAC\Robbie\Ofcom\Html\End_User\&FTitle..csv"
DBMS=CSV REPLACE;
RUN;
%Mend;
filename Runcode "C:\Ofcom_End_User.SAS";
Data _NULL_;
set rwork.Merge_Fault_Rate;
File Runcode;
Length SubStr $ 500;
If Franchise NE "All" Then
SubStr = '%Region(FTitle='||TranWrd(trim(Left(Franchise)), " ","_")||',Franchise='||Trim(Left(Franchise))||');';
PUT SubStr;
run;
%Inc Runcode;
the above code will run, so it will create datasets for each franchise, and then export the CSV for each dataset.. then when it gets to the very end, SAS will hang...
Can anyone see any problems with the above code?
Thanks in advance
Robbie