Help using Base SAS procedures

Proc export happens correctly but a weird dialogue box pop ups?

Reply
Super Contributor
Posts: 338

Proc export happens correctly but a weird dialogue box pop ups?

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

Super User
Posts: 3,250

Re: Proc export happens correctly but a weird dialogue box pop ups?

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?

Occasional Contributor
Posts: 6

Re: Proc export happens correctly but a weird dialogue box pop ups?

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

SAS Super FREQ
Posts: 8,864

Re: Proc export happens correctly but a weird dialogue box pop ups?

Posted in reply to Manu_Jain

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

Occasional Contributor
Posts: 6

Re: Proc export happens correctly but a weird dialogue box pop ups?

Posted in reply to Cynthia_sas

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

SAS Super FREQ
Posts: 8,864

Re: Proc export happens correctly but a weird dialogue box pop ups?

Posted in reply to Manu_Jain

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

Occasional Contributor
Posts: 6

Re: Proc export happens correctly but a weird dialogue box pop ups?

Posted in reply to Cynthia_sas

Thanks..

Ask a Question
Discussion stats
  • 6 replies
  • 483 views
  • 1 like
  • 4 in conversation