0

I have a SAS script that I initiate from a batch script. When I ran the batch script earlier, the log said that the file I tried to import ran into an error, as below:

ERROR: XLSX file does not exist -> C:......\etc\excelfile.xlsx NOTE: The SAS System stopped processing this step because of errors.

When I ran the same script manually from the SAS UI, the script ran fine without any errors. When I looked at the log on that occasion, below were the notes for same file I had issues when importing from batch:

NOTE: The import data set has 1000 observations and 100 variables. NOTE: WORK.have data set was successfully created.

NOTE: PROCEDURE IMPORT used (Total process time): real time 3.06 seconds cpu time 2.23 seconds

It might be worth mentioning that this SAS script imports other files also, and they imported fine - even when initiated from batch. Has anyone else ran into this issue before?

Batch Script:

"C:\Program Files\SASHome\x86\SASFoundation\9.3\sas.exe" -SYSIN 
"C:\...\...\..\etc\sas_script_file.sas" -PRINT 
"C:\...\...\...\....\etc\sas_script_file.lst"

Import Procedure on SAS:

proc import OUT=work.have (keep = col1 col2 col3 col4)
datafile="C:\...\...\...\etc\excelfile.xlsx"
DBMS=XLSX REPLACE;
SHEET= "Sheet1";
run;
5
  • 1
    How long are the lines of text in your SAS program file? Is it possible that they are longing than the default logical record length used by SAS to read the program file in background/batch mode? Commented Jan 11, 2022 at 14:58
  • 1
    Are you really running a 9 year old version of SAS? SAS 9.4 was release in 2013. Commented Jan 11, 2022 at 15:00
  • 2
    @Tom You probably don't want to know how many companies are still running SAS 8... Commented Jan 11, 2022 at 15:59
  • Hi @Tom - yes this is a very large script - thousands of lines of code. When I reviewed the log, the script doesn't process all the way through, it stops mid way where it fails to import that one file I discussed above. Commented Jan 16, 2022 at 21:59
  • The question was about the length of the individual lines of code, not the number of lines of code. Commented Jan 17, 2022 at 4:19

1 Answer 1

1

There are 2 areas I would look at:

  • What security context is the script running under, specifically what user is executing it? It is probably a system security context and that context doesn't have access to the files.

  • Where is the script running and is the path to the place it is running not matching the relative paths defined.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.