SAS-Startup with SAS script auto-loaded?

Reply
New Contributor ts
New Contributor
Posts: 3

SAS-Startup with SAS script auto-loaded?

Hello SAS community,

I am quite new to SAS (working here with 9.2 on Linux) and have a (hopefully) simple question:

  • If I start SAS by simply entering sas at the command line, the interactive mode is run.
  • If I start SAS by entering sas followed by a SAS program (p.ex. sas myprog.sas) at the command line, the batch mode is run (and the sas program is executed).
  • Question: How can I start SAS in interactive mode from the command line and (auto-)load a SAS program without having to manually click File > Open > ... inside the SAS editor? Are there any command line parameters (something like sas --gui myprog.sas) to get this job done?

Thanks in advance.

Greetings

ts

Super Contributor
Posts: 644

Re: SAS-Startup with SAS script auto-loaded?

Check out the system options.  -sasinit might be what you want.

Richard in NZ

New Contributor ts
New Contributor
Posts: 3

Re: SAS-Startup with SAS script auto-loaded?

Posted in reply to RichardinOz

Thanks for your answer. Unfortunately, I did not find any system option called sasinit at the SAS Knowledge Base . Running sas -sasinit myprog.sas or sas myprog.sas -sasinit did not help either. I guess I am missing something essentially, right? :smileyblush:

SAS Super FREQ
Posts: 708

Re: SAS-Startup with SAS script auto-loaded?

Hi

Have a go with this command line:

/SAS/SASFoundation/9.4/sas -initstmt 'dm "pgm;include !HOME/xsetinit.sas;";'

The INITSTMT option allows to run SAS code when SAS starts. The DM statement allows to execute SAS Display Manager commands. The PGM command will activate the Program Editor window, then the INCLUDE command will load the text from a file into the editor

New Contributor ts
New Contributor
Posts: 3

Re: SAS-Startup with SAS script auto-loaded?

Posted in reply to Bruno_SAS

Perfect. Thanks a lot!

Ask a Question
Discussion stats
  • 4 replies
  • 1006 views
  • 4 likes
  • 3 in conversation