SAS setup needs to include
You wrote "path names to the SAS executable or sasbatch script (with a server, sasbatch script is preferred, as it sets up the same environment you have in Enterprise Guide or SAS Studio)"
When you wrote "SAS executable" ,do you mean "SAS program"?
As I understand the batch script (extension .bat) is not a SAS file .
You wrote "sasbatch script "- why?
"SAS executable" is the SAS system itself, which can then be used to run your SAS program. sasbatch.sh (or sasbatch.bat) is a script file provided in a server environment, which sets up your server context (e.g. SASApp) in batch like you have it interactively. The script ulimately calls the SAS executable with parameters and environment variables correctly set.
If you need to use the sasbatch script or can use the SAS executable directly depends on your SAS setup. Therefore you must get in touch with your SAS admin(s).
Any SAS program end with .sas
So I just need to save my sas program normally as I always do?
@Ronein wrote:
Any SAS program end with .sas
So I just need to save my sas program normally as I always do?
Yes. The big question is where to save it so your SAS executable can find it.
You really, really, really should go talk to your SAS administrator. They can walk you through the steps for setting up batch jobs as they are run in your company instead of asking lots of questions on the SAS Community. I'm a SAS administrator where I work and do exactly this for SAS users who want to run batch jobs, using SMC as described below.
SAS under Windows already has BAT files specifically set up to run SAS batch jobs. You can find it here: <SAS Install directory>\SAS\Config\Lev1\SASApp\BatchServer\sasbatch.bat. There is absolutely no need to create your own.
Also SAS provides a point-and-click interface to create, run and schedule SAS batch jobs called SAS Management Console. There is really no need to get involved with command lines at all or even know the folder sasbatch.bat is located in. You just click and type your way through the options and it is all done in a couple of minutes. Your SAS administrator can show wyou all this.
SAS environments come with schedulers. Ask your SAS admin how you can get a SAS program scheduled in your environment.
Writing a .bat file or better the OS command to execute a .sas file in batch won't make it actually execute daily.
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
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.
Ready to level-up your skills? Choose your own adventure.