BookmarkSubscribeRSS Feed
Sreelekha
Fluorite | Level 6

Hi All,

 

I have a .bat file which runs SAS scripts in the background.
The job has to pick a number of .csv files and .xls files from a specified path and run it to update the database.

 

The job is failing to pick the .xls file and failing with the error that. the .xls file was not found. But, that is not the case as the file is already present in that specified path.

 

If i run the SAS script individually, there are no errors.

 

There has been no code change in the previous months.
There was a server upgrade where the server was upgraded from Windows server 2008 to Windows server 2012. Is that related to this?

Could you guys please help me with a solution for this?

 

Regards,
Sreelekha

6 REPLIES 6
Kurt_Bremser
Super User

Windows has such a convoluted security "concept" that it is quite easy to have different permissions (and/or network mounts) between a job run in interactive and a job run in batch mode, as those are different contexts even with the same user-id.

 

Note: when SAS tells you a file is not there, it's not there, period. Which can mean that the file is actually there, but there is not accessible to the SAS process at this very moment.

Sreelekha
Fluorite | Level 6

Thank you for your reply.

But the other CSV files from the same path are accessible. Since, yesterday I have been getting this error. Hence, this isnt momentary.

RW9
Diamond | Level 26 RW9
Diamond | Level 26

Are you sure the file is there, if the program tells you its not, I am going to believe that I am afraid.  Note that:

"XYZ.xlsx" is not "X YZ.xslx"

and 

"XYZ.xls" is not "XYZ.xlsx"

For example.  AS we can't see anything of your process, can't help further.

Note, why on earth are you using xls file format, which is decades out of support. Move to XLSX, or better still bin Office in totum and go with nice plain open source files.

Sreelekha
Fluorite | Level 6

Yes,
But the individual script is running fine. Absolutely no errors.

Ksharp
Super User

Maybe that excel is open or locked.

Try to copy that excel to somewhere and import the copy file again.

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

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
  • 6 replies
  • 851 views
  • 0 likes
  • 4 in conversation