BookmarkSubscribeRSS Feed
deleted_user
Not applicable
I am importing a series of Access tables using the Import procedure in a macro. Here is a sanitised version of the code.

PROC IMPORT OUT = CBADEF.DEF_&Year.
DATATABLE = "def"
DBMS =ACCESS97 REPLACE;
DATABASE = "\\my\data\base\&Year..mdb";
SCANMEMO = YES;
USEDATE = NO;
SCANTIME = YES;
RUN;

Firstly, while the procedure is running, the Task manager says "Running proc Sql...", although the log reports as follows:

NOTE: PROCEDURE IMPORT used (Total process time):
real time 28.18 seconds
cpu time 6.53 seconds

I have already had grief at the hands of importing Excel using the wizards because the PCFF product isn't being used and my long comment lines, or multi line cells are being corrupted. That issue is documented in an SN, but I can't seem to find any way to force the EG import wizard to use PCFF if it is licensed. Now I wonder which is misleading, the task manager or the log!

When you import using the same code within a standalone session, a column called "SEC/C" on Access is being renamed to "SEC_C". However, EG 4.1 (and the same behaviour doesn't seem to happen on EG 3.0) honours the original name and in order to make other code work I have had to issue a rename statement within the macro that contains the import procedure.

Kind regards

David
2 REPLIES 2
ChrisHemedinger
Community Manager
PROC IMPORT does make use of other SAS language facilities to do its work. So while you issued PROC IMPORT, it's possible that the procedure is using PROC SQL behind the scenes to do some of the work. For example, PROC IMPORT issues DATA step calls to import text files.

The difference in column name behavior (SEC/C vs SEC_C) is due to the OPTIONS VALIDVARNAME=ANY that EG submits. If you want your PROC IMPORT step to remap the column name to an acceptable traditional SAS name, put an OPTIONS VALIDVARNAME=V7; statement at the top of your program.

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!
deleted_user
Not applicable
Thank you Chris

Kind regards

David

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

Register now

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
  • 2 replies
  • 1015 views
  • 0 likes
  • 2 in conversation