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-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

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