BookmarkSubscribeRSS Feed
Kurt_Bremser
Super User

SAS setup needs to include

  • client/server or local
  • if c/s, type of server operating system
  • 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)
Ronein
Meteorite | Level 14

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?

 

 

Kurt_Bremser
Super User

"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.

Ronein
Meteorite | Level 14
So as I understand from you 3 files are involved:
1-sas program file (.sas)
2-batch file(.bat)
3-SAS executable file
What is the extension of SAS executable file?
Is this file necessary?
As i understand only essential to have sas program file and batch file.

Kurt_Bremser
Super User

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).

Ronein
Meteorite | Level 14

Any SAS program  end with .sas

So I just need to save my sas program normally as I always do?

Kurt_Bremser
Super User

@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.

SASKiwi
PROC Star

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.

Patrick
Opal | Level 21

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. 

SAS Innovate 2025: Register Now

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!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 23 replies
  • 3838 views
  • 2 likes
  • 6 in conversation