0
votes

I have a SAS code which works flawlessly when I first open the program and run the code interactively. However, if I try to run it as a batch file or execute it from the command prompt using the -sysin option, it doesn't run and I don't know why.

Part of the reason might be that when I run SAS, I receive this dialog box which I need to manually close:

Screencap 1

When I try to choose the option "Do not show this dialog box again" it doesn't work, and it shows the dialog every time I open SAS. This may be because my registry and profile files are corrupted:

Screencap2

Would this be the reason why? If I run the program interactively after closing the dialog box, the program run just fine. I tried to follow some steps to repair the registry and profile files, but it didn't work. Is that what I should focus on, or is there likely another reason it won't run in batch?

Thanks for your input!

edit: I was able to get the program to run from the batch file, but I get the following errors about permissions in the log file:

ERROR: Insufficient authorization to access //destinationonselecteddrive
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE PRINTTO used (Total process time):
      real time           0.01 seconds
      cpu time            0.00 seconds

I do not have these issues with insufficient authorization when I run the program interactively, only in batch mode. Could it be a metadata issue?

2
I think if you run the program batch using a different SAS profile, it should run fine. You probably want to create a custom CONFIG file to point to the different SAS profile. I do it all the time.dj_paige
What does it doesn't run mean? Nothing happens? Or you get an error? The dialog box bit is irrelevant (that won't have any impact on a non-interactive session) but the other part (the config files) could be. Any chance you have multiple SAS sessions open at once?Joe
And what exaclty happens when you run as a batch file? Do you get at least a brief sas popup?Joe
I made an edit to my original post. I asked it to produce a log file and it says I don't have authorization to access the drives indicated in the SAS code. However, this only happens in batch mode. When I open SAS and run the code, it runs fine and I don't get any errors regarding access to those drives.Sammy
How are you running it in batch mode?Joe

2 Answers

0
votes

You have to check with which profile your batch is running. When run interactively it may (and it will normally) use a different profile than the one you are using while running interactively. That means different user and password. You can check in the management console (or ask your administrator to check).

0
votes

It sounds most likely like there is a problem with the user profile. At my old job I ran into problem with the profile when I ran concurrent SAS sessions. I had to set my user profile to read only using the RSASUSER option (SAS instruction here). If that is not the issue try creating a new profile catalog in a new location and then adding the -SASUSER option with the new location (SAS info on how to do that).