BookmarkSubscribeRSS Feed
RAmarapuram
Obsidian | Level 7

Hi Team

We have recently migrated from SAS EG 4.1 to SAS EG 7.1.

Have an issue with PROC IMPORT, the below code is able to import data onto xls sheet.

We are using 32-bit MSOFFICE 2010.

PROC IMPORT OUT= WORK.PathParameter

            DATAFILE= "C:\TEST\XXX03.xls"

            DBMS=xls REPLACE;

     GETNAMES=YES;

     MIXED=YES;

     USEDATE=YES;

     SCANTIME=YES;

     SHEET="Path Parameter";

RUN;

However, the code generates below error :

26              GETNAMES=YES;

27              MIXED=YES;

28              USEDATE=YES;

                _______

                180

29              SCANTIME=YES;

                ________

                180

ERROR 180-322: Statement is not valid or it is used out of proper order.

30              SHEET="Path Parameter";

31         RUN;

I tried browsing for different for a resolution on blogs/communities.But could not get a resolution for this.

Could you please help me on this ?

Thanks

Rajesh

5 REPLIES 5
ChrisHemedinger
Community Manager

I'm not sure that SCANTIME is supported with DBMS=XLS.  It might be strictly for DMBS=EXCEL or EXCELCS.  If using 64-bit SAS with 32-bit Office, try DBMS=EXCELCS -- this will use the SAS PC Files Server component, which should autostart on your Windows 64-bit SAS.  If your SAS is not on Windows (for example, on Linux now), then more setup is required.

If you can get your data into XLSX format, then DBMS=XLSX might also work without additional setup.

Chris

SAS For Dummies 3rd Edition! Check out the new edition, covering SAS 9.4, SAS Viya, and all of the modern ways to use SAS!
bharath86
Obsidian | Level 7

Hello Chris,

 

I am running through an error while trying to run the below code. I am using SAS EG 8.2, 64-bit.

 

My question is do we need SAS Access to import files from a PC using proc import procedure. 

 

If I use an import data procedure in EG the way it reads excel is different from proc import, because our excels have data starting at different rows and it varies from excel to excel. 

 

PROC IMPORT OUT= WORK.temp
DATAFILE= "id.xlsx"
DBMS=XLSX REPLACE;
/* SHEET='PD';*/
GETNAMES=YES;
DATAROW=7;
RUN;

 

ERROR: DBMS type XLSX not valid for import.

jebjur
SAS Employee

Yes, you need to have SAS/Access to PC Files licensed and installed on the SAS server in order to use PROC IMPORT code to import Excel files. 

bharath86
Obsidian | Level 7
Thank you @jebjur for answering this.

Now can you please advise how do we get this SAS/ACCESS. Is it a seperate licence or how do we get this installed.
Do we need to raise a request through our company representative and how much does this cost us.

It would be great if you can share these details.

Thank you
Bharath
jebjur
SAS Employee

If you would like to have SAS/Access for PC Files licensed for your site, then your SAS site representative is the best person to have contact the Customer Information Center for any questions you may have about purchasing the product, including pricing information. The number is (800)727-0025. Once you have that product licensed, feel free to open a track with Technical Support if you need assistance with the installation.

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

Creating Custom Steps in SAS Studio

Check out this tutorial series to learn how to build your own steps in SAS Studio.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 5 replies
  • 9499 views
  • 1 like
  • 4 in conversation