SAS-Executing SAS in batch mode in Windows and Unix

Executing SAS in batch mode



Windows
CALLING SAS PROGRAM TO RUN UNDER WINDOWS
Submitting a SAS program from a Windows script has two phases, one is to call first a SAS exe program to
invoke SAS system and the next part is to call the SAS program with options. Here is the example of the Windows
batch statement to execute the SAS program called test.sas:

'''"C:\Program Files\Sas\Sas 9.1\sas.exe" -SYSIN C:\test.sas -ICON –NOSPLASH -LOG C:\Logs\MyPgm.log -PRINT C:\Outputs\MyPgm.lst'''

'''"C:\Program Files\Sas\Sas 9.1\sas.exe"''' –> Has to be the location of the sas installation in your system.
All the above pieces of the statement to invoke the test.sas have to be written in one line of the batch file.
The ICON and NOSPLASH SAS options disable (these options are not working) displaying the pop-up panels with info about running program and a startup panel. The LOG and PRINT allow to locate the log and listing files.


CHECK THE PROCESS
Use the “tasklist” command to check if the process is running.

Unix
CALLING SAS PROGRAM TO RUN UNDER UNIX
>'''nohup sas filrname.sas &''' -- Runnning the SAS code as a job after saving the sas file
The above command will return a process ID, which corresponds to the SAS process being executed. This has to be noted down for future reference.

CHECK THE PROCESS
> '''ps''' -- to check whether the process is running or not.
The above command will help you to list all the processes. The PID of the sas process executed should be visible, if not it has gone to completion or stopped because of error. The log and output files will be available in the same location (location of .sas file).

  1. gravatar

    # by Anonymous - April 10, 2014 at 12:27 AM

    Good response in return of this matter with solid arguments and telling everyything
    regardinng that.

Blog Widget by LinkWithin

Search this blog..

Loading