BookmarkSubscribeRSS Feed
Kody_devl
Quartz | Level 8

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

 

9 REPLIES 9
art297
Opal | Level 21

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

 

Kody_devl
Quartz | Level 8

My machine is 64 bit and so is his machine.

 

art297
Opal | Level 21

Are your EG versions both 64-bit?

Kody_devl
Quartz | Level 8

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.

 

art297
Opal | Level 21

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

 

Kody_devl
Quartz | Level 8

Great question because we had suspicions here.

 

We use and FTP program called WIN SCP

 

Kurt_Bremser
Super User

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.

Oligolas
Barite | Level 11

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,

 

 

________________________

- Cheers -

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!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

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
  • 9 replies
  • 1032 views
  • 0 likes
  • 4 in conversation