How to Start Programming in SAS with Basic Aproach

Be Familiar with Programming workspace

First thing first, lets us become familiar with SAS workspace. The SAS environment is designed to be easy to use, with windows for accomplishing all the basic SAS tasks. After you become familiar with the starting points for your SAS tasks, you are ready to use the full range of capabilities that SAS offers.

Below shown is the method for you to use SAS windows to manage your SAS session, to work with files, and to process SAS programs.

  • The main SAS windows are the Explorer, enhanced Editor (in the Windows operating environment only), Program Editor, Log, Output, and Results windows
  • Use window features, including pull-down menus, pop-up menus, toolbars, and help
  • Create SAS libraries & Explore and manage SAS files
  • Enter and submit SAS programs
  • Create and use file shortcuts

Using the Main SAS Windows

Once you pen the SAS, by default several primary windows are available for you. These include the Explorer, Log, Output, Results, and code editing windows. The window you use to edit your SAS programs may vary, depending on your operating system and needs. You use these SAS windows to explore and manage your files, to enter and submit SAS programs, to view messages, and to view and manage your output.

Your operating environment, and any options that you use when you start SAS, determine following

  • Which of the main SAS windows are displayed by default
  • Their general appearance & their position.
  • Features of Different SAS Windows

SAS windows have many features that help you get your work done. For example, you can

  • Maximize, minimize and restore windows
  • Use pull-down menus, pop-up menus, and toolbars & get more help.

Be familiar with most of these features, check out the below image start checking on your software package to start

SAS Free Tutorial, Learn SAS Programming for Free, SAS BASE

Minimizing and Restoring Windows

In the Windows and OS/2 environments, you can click the Minimize button Minimize button to send a window that you aren't using the SAS window bar. To restore the window to its former position, click the corresponding button on the SAS window bar.

In other operating environments, minimizing the window shrinks it to an icon.

Docking and Undocking Windows

In the Windows and OS/2 environments, the Explorer and Results windows are docked by default, so they can be resized but not minimized. If you prefer, you can select Window then Docked to undock the active window, or you can turn docking off completely in the Preferences dialog box.

Issuing Commands

In SAS, you can issue commands by

  • Making selections from a menu bar
  • By typing commands in a command box (or Toolbox) or on a command line.

SAS Free Tutorial, Learn SAS Programming for Free, SAS BASE

In most operating environments, SAS displays the menu bar by default.

In the Windows environment, the menu bar selections correspond to the active window. To display the menu bar if it is not displayed, you can type pmenus on in the command box (or ToolBox) or on the command line.

In all operating environments, SAS displays a command box (or ToolBox) or command line by default. You can display a command line in a particular window by activating that window and then using the Tools menu as indicated below:

  • In the Windows environment, select Tools then Options then Preferences, then select the View tab and select the Command line checkbox. 

  • In the UNIX, VMS, and z/OS environments, select Tools then Options then Turn Command Line On. 

  • In the z/OS environment, you can display both a command line and a menu bar simultaneously in a window by selecting Tools then Options then Command

In the Windows, UNIX, and VMS operating environments, you can also display a command line in a window by activating the window, typing command in the command box (or ToolBox), and Enter

Using Pop-Up Menus

Pop-up menus are context sensitive, they list actions that pertain only to a particular screen region or selection. Generally, you display pop-up menus by clicking the right mouse button. If you like, you can specify a function key to open pop-up menus. Simply select Tools then Options then Keys and type wpopup as a function key setting.

To open a pop-up menu in the z/OS or CMS operating environments, type ? in the selection field beside the item.

Getting Help

Help is available for all windows in SAS. From the Help menu, you can access comprehensive online help and documentation for SAS, or you can access task-oriented help for the active window. The Help menu is discussed in more detail later in this lesson.

Customizing Your SAS Environment

You can customize many features of the SAS workspace such as toolbars, pop-up menus, icons, and so on. Select the Tools menu to explore some of the customization options that are available.

You'll practice using features of SAS windows throughout this lesson. Now let's look at each of the main SAS windows individually.

Code Editing Windows

There are some choices available for you as below to write and edit SAS programs, choose one and start

1. The enhanced Editor window
2. The Program Editor window
3. The SAS Notepad window &
4. The host editor of your choice

This article focuses on the two SAS code editing windows. The enhanced Editor and The Program Editor windows.

The features of both editors are cane be described as below. 

Enhanced Editor Window

SAS Free Tutorial, Learn SAS Programming for Free, SAS BASEIn the MS Windows operating environment, an enhanced Editor window opens by default. You can use the enhanced Editor window to enter, edit, and submit SAS programs. The initial window title is Editor - Untitled until you open a file or save the contents of the editor to a file. Then the window title changes to reflect that filename. When the contents of the editor are modified, an asterisk is added to the title.

One can easily redisplay or open additional enhanced Editor windows by selecting ViewthenEnhanced Editor, Below image to demonstrate above theory.

Enhanced Editor Features

In the enhanced Editor, you can perform standard editing tasks as below

1. Opening SAS programs in various ways, including drag and drop
2. Entering, editing, and submitting SAS programs
3. Using the command line or menus
4. Saving SAS programs
5. Clearing contents.
6. Color coding and syntax checking of the SAS programming language
7. Expandable and collapsible sections
8. Recordable macros
9. Support for keyboard shortcuts (Alt or Shift plus keystroke)
10. Multi-level undo and redo.

For more information about the enhanced Editor, open or activate the enhanced Editor window, then select HelpthenUsing This Window.

Clearing the Editor

In the enhanced Editor and the SAS Notepad window, the code does not disappear when you submit it, this means you should act to do show, to clear any of these windows, you can activate the window and select Edit then Clear All

The Program Editor Window

Same as the enhanced Editor window, in the Program Editor window you enter, edit, and submit SAS programs. You can also open existing SAS programs. You can display the Program Editor window by selecting View then Program Editor. Clearing the code remains same as Enhanced Editor window.

 

Rating: 5 / 5 (80 votes)