BookmarkSubscribeRSS Feed
hellind
Quartz | Level 8

My company is using SAS Enterprise Guide 4.2 connected to SAS 9.1.3. SAS Access Interface to PC Files is not installed.

I want to import Ms Access MDB table and prefer not to import data via ODBC. Using EG, I go to File > Import Data > Local Data > MS Access MDB

Then I click on the Import Data icon and click Add Code As Template, I get this code show below.

When I exit EG and re-open and run it again, it gives me the error: ERROR: No logical assign for filename #LN00062.

Question: I want to automate this as a code, don't want to run as a task in process flow. How can I tweak the code to run even after I re-enter EG? What is the code behind that create the file #LN00062?

.

/* -------------------------------------------------------------------

   Code generated by SAS Task

   Generated on: Tuesday, July 12, 2011 at 3:43:16 PM

   By task: Import Data

   Input Data: #LN00062

   Server:  SASMain

   ------------------------------------------------------------------- */

%_eg_conditional_dropds(WORK.CA_MASTER);

%MACRO _EG_ImportData;

%LET IsMVS=FALSE;

%IF %TRIM(&SYSSCP) = OS %THEN %DO;

%IF %sysfunc(getoption(filesystem))=MVS %THEN %DO;

          %LET IsMVS=TRUE;

%END;

%END;

DATA WORK.CA_MASTER;

/* Enterprise Guide creates this temporary asterisk delimited text file from the original data source */

          INFILE #LN00062

                    DELIMITER='*'

                    MISSOVER

                    DSD

          %IF &IsMVS=FALSE %THEN %DO;

                    LRECL=32767

          %END;

                    FIRSTOBS=2

          ;

          LENGTH

                    PRODUCT_GROUP $ 30

                    PRODUCT_NAME $ 50

                    CA_NUMBER $ 31

                    APPLICATION_MONTH $ 19

          ;

          INPUT

                    PRODUCT_GROUP $

                    PRODUCT_NAME $

                    CA_NUMBER $

                    APPLICATION_MONTH $

          ;

          LABEL

                    PRODUCT_GROUP = "PRODUCT_GROUP"

                    PRODUCT_NAME = "PRODUCT_NAME"

                    CA_NUMBER = "CA_NUMBER"

                    APPLICATION_MONTH = "APPLICATION_MONTH"

          ;

RUN;

%MEND;

%_EG_ImportData

/* -------------------------------------------------------------------

   End of task code.

   ------------------------------------------------------------------- */

RUN; QUIT;


2011-07-14_115419.png
1 REPLY 1
Doc_Duke
Rhodochrosite | Level 12

EGuide has some capabilities that are not part of your SAS install.  When you use the EGuide task to do the import, the EGuide client task connects to the Access database and pulls the data into a delimited text file that it hands off to your SAS 9.1.3 server.  If you run just the code, you miss the export.  If you want to do the import with code alone, you must use just the 9.1.3 tools.

Doc Muhlbaier

Duke

sas-innovate-white.png

Missed SAS Innovate in Orlando?

Catch the best of SAS Innovate 2025 — anytime, anywhere. Stream powerful keynotes, real-world demos, and game-changing insights from the world’s leading data and AI minds.

 

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
  • 1 reply
  • 2719 views
  • 0 likes
  • 2 in conversation