Help using Base SAS procedures

Batch file

Occasional Contributor HM3
Occasional Contributor
Posts: 9

Batch file

I want to create a batch file in windows which will run SAS.
2.Run a fixed script(options like nocentre nodate) before I start my work.
3.Clean log,ouput and editor.
Pl help.
Super Contributor
Super Contributor
Posts: 3,174

Re: Batch file

The SAS.COM support website has technical documentation and supplemental conference/technical material available on this topic. Suggest you use the website SEARCH facility using your key words.

Scott Barry
SBBWorks, Inc.
Trusted Advisor
Posts: 2,113

Re: Batch file

Actually, I'm not sure that Windows supports what I think you want to do in the batch environment. It sounds like you want to do some pre-processing, open an INTERACTIVE session, and then do some post processing. I don't think that you can launch an interactive SAS session from a batch file in Windows.

If I've misinterpreted and you just want to run a batch job and send all the log and output text to the bit bucket, then the options for that SAS command are in the SAS companion for Windows.

Doc Muhlbaier
Posts: 8,743

Re: Batch file

I'm not sure why you would want a batch file to open SAS. On your windows desktop, SAS.EXE is the program that starts SAS. You might investigate the use of the CONFIG and AUTOEXEC files, which are two ways to initialize a SAS session to your liking (as with options, settings, work locations, library locations, etc).

What do you mean be a "fixed script" -- SAS doesn't really have "scripts" -- it has programs. You can choose to open SAS and only issue options and Display Manager and FILENAME or LIBNAME statements or you can choose to open SAS and run an entire program.

When SAS starts, you would only need to clear the log and output windows if you had RUN something. When SAS first starts up, the only information that is displayed is in the SAS log --with your site number and SAS version number -- which you might need for calling Tech Support (for example). When you first start up SAS, if no AUTOEXEC.SAS program is invoked, only the LOG window would need to be cleared. The OUTPUT window and the EDITOR window should both be "blank".

Before you go down the road of investigating a batch file to start SAS, you should reference the SAS Companion for Windows to determine how you can use SAS methods to configure and set up an interactive session.

If you want to run an existing program in batch or non-interactive mode, you can do that too. The SAS Companion for Windows will also have that information.

Ask a Question
Discussion stats
  • 3 replies
  • 4 in conversation