DATA Step, Macro, Functions and more

Importing Excel 2010 Sas Version Problem

Reply
Contributor
Posts: 58

Importing Excel 2010 Sas Version Problem

[ Edited ]

I am trying to transfer a program that I wrote to another individual's machine as I am leaving the company. 

 

One of the first steps in the program is to import an Excel file, Period.XLSX.  I use this code (and it has worked and still works for almost a year) 

However my co-worker can't get this code to work on his machine (we have worked for 1/2 day together to try to import this Excel file)

 

Here is my working CODE:

/* Import Periods Lookup Table */

proc import

datafile = "/sas/sasperm3_prod/RiskInfrastructure/Crill/QRM/Files/Import/Period.xlsx"

out= Days dbms= xlsx replace;

getnames= yes;

range= 'Days';

run;

 

After much testing we have determined that this code fails on two other machines that have the latest SAS version which appears to be the only difference between me and them.

 

My Version is 7.1 HFI(7.100.0.2002)

Their Version 7.2

 

Their error message says that the period.xlsx is corrupt, but it is not.

 

What is causing this? HELP

 

PS  He is able to import the file using the wizard.

 

MORE INFORMATION ADDED:  The 7.2 User can import the Period.xlsx file successfully with my code if the Excel file sits in my personal directory without corruption but if we move the Excel file to his personal directory, it fails (corrupts).  I think this will give a key to the problem and answer

 

PROC Star
Posts: 7,363

Re: Importing Excel 2010 Sas Version Problem

[ Edited ]

Is it possible that their machines or EG versions are 64-bit and your's is 32-bit, or visa-versa?

 

Art, CEO, AnalystFinder.com

 

Contributor
Posts: 58

Re: Importing Excel 2010 Sas Version Problem

My machine is 64 bit and so is his machine.

 

PROC Star
Posts: 7,363

Re: Importing Excel 2010 Sas Version Problem

Are your EG versions both 64-bit?

Contributor
Posts: 58

Re: Importing Excel 2010 Sas Version Problem

[ Edited ]

I don't know about his but my SAS version says 32 bit and our admins say that it is OK to run 32 Bit SAS on a 64 bit machine.  I have had no problems.  I don't trust everything that they say.

 

PROC Star
Posts: 7,363

Re: Importing Excel 2010 Sas Version Problem

Their being on 64-bit EG could be the problem. Another possibility: is there a chance that someone has the Excel file open when they try to import it?

 

Art, CEO, AnalystFinder.com

 

Super User
Posts: 6,936

Re: Importing Excel 2010 Sas Version Problem

How do you move the file to his directory? Using UNIX cp?

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Contributor
Posts: 58

Re: Importing Excel 2010 Sas Version Problem

Great question because we had suspicions here.

 

We use and FTP program called WIN SCP

 

Super User
Posts: 6,936

Re: Importing Excel 2010 Sas Version Problem

Then make sure that you use "binary" as transfer method. Otherwise it might use text and scramble the file.

IMO there should be no bitness problems when using dbms=xlsx, as SAS uses a built-in decoder/encoder for that (and not anything supplied by MS). And xlsx is zip-compressed xml, so basically compressed text.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Frequent Contributor
Posts: 103

Re: Importing Excel 2010 Sas Version Problem

[ Edited ]

Hi,

 

the SAS version shouldn't be a problem here, but the SAS modules installed could be.

 

Run proc setinit;run; on both machines and check if you have SAS/ACCESS installed.

 

If the other machine does not have any SAS/ACCESS products licensed, then the only types of data source files available to you are .CSV, .TXT, and delimited files.

 

Cheers,

 

 

________________________

- That still only counts as one -

Ask a Question
Discussion stats
  • 9 replies
  • 127 views
  • 0 likes
  • 4 in conversation