BookmarkSubscribeRSS Feed
Mirisage
Obsidian | Level 7

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

6 REPLIES 6
SASKiwi
PROC Star

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?

Manu_Jain
Calcite | Level 5

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

Cynthia_sas
SAS Super FREQ

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:

36155 - Microsoft Excel cannot open a file that is created from a SAS® data set that exceeds Excel f...

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

Manu_Jain
Calcite | Level 5

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  Smiley Happy

Thanks in advance

Cynthia_sas
SAS Super FREQ

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

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

What is Bayesian Analysis?

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 6 replies
  • 1153 views
  • 1 like
  • 4 in conversation