Hi:
The information on the unwanted sheet looks suspiciously like the PROC DATASETS output shown in this documentation topic:
http://support.sas.com/documentation/cdl/en/basess/58133/HTML/default/a001397000.htm
I would suspect that either your %INCLUDE has a PROC DATASETS step that does not end with QUIT; or you have previously run an unclosed PROC DATASETS in your session. PROC DATASETS does not end with RUN; -- it ends with QUIT; so it is possible that in some instances (such as local submission, you do NOT have PROC DATASETS running before you do your submit.) But in other instances, like the %INCLUDE, you might have a PROC DATASETS somewhere in the code that precedes the included code???
Are you sure that the %INCLUDE code is -EXACTLY- the same as the code when you submit locally???? Can you post a sample of your file WORK.REPORTDATA?? Or, can you duplicate the results using SASHELP datasets????
You say that "this is not happening for all files output this way" -- but your program is always going against WORK.REPORTDATA, which has the variables X, Y and Z. What "other" files??? How are "all the files" files run through PROC REPORT??? Or, by "all the files" do you mean the LISTING.XLS output from ODS TAGSETS.EXCELXP.
Do you see any difference in the LOG messages when you submit the code locally versus submitting it with %INCLUDE???? If there are differences, can you post the LOGs here??? Please check the log carefully after every execution and look for "file in use" messages such as this one:
[pre]
2963 ods tagsets.excelxp file='c:\temp\listing.xls' style=sasweb;
NOTE: Writing TAGSETS.EXCELXP Body file: c:\temp\listing.xls
ERROR: File is in use, c:\temp\listing.xls.
WARNING: No body file. TAGSETS.EXCELXP output will not be created.
2964 proc print data=sashelp.class;
2965 run;
WARNING: No output destinations active.
[/pre]
I don't have any other more concrete suggestions. If you can't figure it out, you might want to open a track with Tech Support -- they can look at ALL your code -- including the code that might precede the %INCLUDE code to see if they can figure out what's happening.
cynthia