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;
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
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.