Launching an Application

Introduction

After you create an application, you can deploy it in such a way that a user can launch it directly, without first having to launch SAS, find the frame, and run it. You can also configure a SAS/AF application to launch as a kiosk-like application, running in the foreground without menus, a title bar, or any of the SAS display manager windows (Program Editor, Log, or Output). When you exit your application, the SAS session automatically ends.
This appendix guides you through the process of modifying a copy of the SAS configuration file and using the INITCMD system option to create an icon that launches the Start_menu frame from the desktop.
These instructions apply to a standard SAS®9.4 installation on the Windows 7 operating system. Consult your SAS host companion for information about the specifics of your operating system.

Edit a Copy of the SAS CFG File

A SAS configuration file contains instructions that are executed each time you start a SAS session. To alter a configuration file so that the Start_menu application is executed, follow these steps:
  1. Find the SAS CFG file.
    Assuming a standard SAS installation on Windows, the CFG file can be found at C:\Program Files\SASHome\SASFoundation\9.4\sasV9.cfg.
  2. Duplicate the CFG file, and name the new version Startmenu.CFG.
  3. Open the Startmenu.cfg file and add to the bottom of the file, after all other lines, the following options:
    -awscontrol notitle
    -noawsmenu
    -initcmd "af c=sasuser.example.Start_menu.frame;
              toolclose;
              command close;
              wstatusln off;
              wwindowbar off;"
  4. Save and close the CFG file.
Note that the list of commands in the INITCMD option is enclosed in quotation marks.
The following tables describe the SAS system options and SAS commands that are used in the INITCMD option.
SAS System Options
Option
Description
awscontrol notitle
Turns off the system menu, and the minimize and maximize buttons in the main SAS window
noawsmenu
Turns off the menu bar in the main SAS window
initcmd
Specifies commands to execute during the start of a SAS session, and suppresses the Log, Output, Program Editor, Enhanced Editor, and Explorer windows when executing a SAS/AF application
SAS Commands
Command
Description
af c=sasuser.example.start_menu.frame
Executes the SAS/AF Start_menu frame
toolclose
Turns off the application toolbar
command close
Turns off the command bar
wstatusln off
Turns off the status line (normally at the bottom of the SAS window)
wwindowbar off
Turns off the window bar (normally at the bottom of the main SAS window)
Now you need to create a shortcut that references the Startmenu.CFG file while launching SAS.

Create a Shortcut to SAS That References Startmenu.CFG

To create a Windows shortcut that references the Startmenu.CFG file while starting SAS, follow these steps (changing the paths appropriately for your installation):
  1. Find the SAS executable.
    Assuming a standard SAS installation on Windows, the SAS executable can be located at C:\Program Files\SASHome\SASFoundation\9.4\sas.exe.
  2. Create a new shortcut to the SAS executable, naming it StartMenu.
  3. Right-click the StartMenu icon, and then select Properties.
  4. Edit the Target of the shortcut to reference Startmenu.CFG by appending the following text to the end of the existing Target:
    -config 'C:\Program Files\SASHome\SASFoundation\9.4\Startmenu.CFG'
    The complete Target line should look something like this. It is split over two lines here, but your Target should be on one line:
    "C:\Program Files\SASHome\SASFoundation\9.4\sas.exe" 
    -config 'C:\Program Files\SASHome\SASFoundation\9.4\Startmenu.CFG'
  5. Click OK.
Test the StartMenu shortcut. The Start_menu frame should launch, and the main SAS window should be full screen, with no title, menus, or toolbars. For more information about other start-up options, refer to your host companion and the Base SAS help.