Hi SAS Forum,
I have exported 10 SAS data sets to 10 different tabs of a same Excel file named “model_test.xls”.
The code piece shown below, which is a part of a relatively long code, does the exporting job correctly.
%macro name1(sheet_name,which_bank);
PROC EXPORT DATA=k.Source_Data_Bank_&which_bank
OUTFILE="\\Ad.noki.com\Cccp\Home\Fredrick\model_test.xls"
DBMS=XLS REPLACE;
sheet = "&sheet_name";
PUTNAMES=YES;
run;
%mend name1;
%name1(sheet_name=Source_Data_Bank_10,which_bank=10);
%name1(sheet_name=Source_Data_Bank_20,which_bank=20);
%name1(sheet_name=Source_Data_Bank_30,which_bank=30);
%name1(sheet_name=Source_Data_Bank_40,which_bank=40);
%name1(sheet_name=Source_Data_Bank_50,which_bank=50);
%name1(sheet_name=Source_Data_Bank_70,which_bank=70);
%name1(sheet_name=Source_Data_Bank_80,which_bank=80);
%name1(sheet_name=Source_Data_Bank_90,which_bank=90);
%name1(sheet_name=Source_Data_Bank_100,which_bank=100);
Question:
When I try to open the excel file named “model_test.xls”, a dialogue box appears like this.
File error: Data may have been lost
ok
But when I click the ok button in the above dialogue box, then the excel file comes with 10 tabs with correctly exported data.
Have anyone of you come across this situation, and how to get rid of this dialogue box?
Thank you
Mirisage
What version of Excel are you using and how many rows are you putting in each sheet?
Any Excel version prior to 2008 has a limitation of 64K rows. Are you trying to put more than 64K rows in one sheet?
I too have encountered the same problem. I am working on office'10.
My Prob: I made a sas code which will make a dashboard(excel file with all graphs and all). When I run the code, the dashboard is created. When I open that, it says File error: Data may have been lost
I counter checked the dashboard with the raw files and I found there is no discrepancy in that. Please help m eout
Hi:
If you go to support.sas.com and look for the search box on the right side of the page, you can enter a search string into the box. I entered the text from your error message: "Data may have been lost" and received quite a few hits, including this one:
which may or may not be relevant to your particular situation.
For the definitive answer on this question, your best bet is to work with SAS Tech Support.
cynthia
Hi Cynthia
No the solution in the link is not the solution for my problem.
The link says "To avoid this problem, be sure that your SAS data set does not contain more than 65536 rows." This happens when we are working on EXCEL 07 or previous version. I am working in Excel'10 which can handle many more rows that that. Anyways in my case I using less than 100 rows.
Can you tell me how to work with SAS Tech Support. I am new to this community so plz help
Thanks in advance
Hi:
In the gray area at the very bottom of this page (and every forum page) approximately on the same "line" as the SAS logo, is a statement that says (in dark gray letters): "Community postings can contain untested user-supplied content. This content is provided as-is without warranty by SAS. For official SAS support, submit a problem report. Copyright ..."
And the words "submit a problem report" are a BLUE hyperlink. Click on that phrase "submit a problem report" to open a track with Tech Support.
cynthia
Thanks..
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 the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.