Download presentation
Presentation is loading. Please wait.
Published byJames Butler Modified over 8 years ago
1
Learning SAS Dr. Chaitali Basu Mukherji
2
What is SAS? SAS software started out in 1970s as a software package for statistical analysis By mid-1980s SAS branched out into graphics, online data entry, and compilers for the C programming language In the 1990s SAS family grew to include tools for visualizing data, administering data warehouses, and building interfaces to the World Wide Web. In this century, SAS continued to grow with products designed for cleansing messy data, discovering and developing drugs, and detecting money laundering
3
What is SAS Enterprise Guide? SAS Enterprise Guide gives you access to the power of SAS via a point-and- click interface. It does not itself analyze data, instead, generates SAS programs through Tasks There are over 80 tasks offered in SAS Enterprise Guide When you click Run in SAS Enterprise Guide, it submits the program to SAS SAS runs the program, and then sends the results (such as reports, graphs, data tables, and SAS logs) back to SAS Enterprise Guide so that you can see them SAS Enterprise Guide runs in only the Windows operating environment SAS Enterprise Guide always needs Base SAS to run the program. It can reside in same machine or it may be a separate machine Base SAS runs in many operating environments and on many types of computers You may have multiple SAS servers and can point the SAS Enterprise Guide to run analyses on any of them
4
SAS Components SAS has many different products To run SAS Enterprise Guide, you must have Base SAS software installed on your SAS server If it is a remote SAS server, you need a product called SAS Integration Technologies For running statistical analyses, you need SAS/STAT For running econometric time series analyses, you need SAS/ETS For graphics, you need SAS/GRAPH software For getting data from remote Data warehouses, you need SAS/ACCESS
5
Starting SAS Enterprise Guide Start SAS Enterprise Guide by either double-clicking the SAS Enterprise Guide 4.2 icon on your desktop, or selecting SAS Enterprise Guide 4.2 from the Windows Start menu This brings up the SAS Enterprise Guide windows in the background, with the Welcome window in the foreground The Welcome window allows you to choose between opening an existing project or starting a new project. Click New Project A window with left top panel having Project List, left bottom panel having Resource List and the Right panel having Process Flow should appear To reset the windows, select Tools Options from the menu bar and click Restore Window Layout To change location of Panel, click on the down arrow at the top right and select window for Dock Left or Dock Right
7
Basic Elements of SAS Enterprise Guide Project Tree: Displays your project in a hierarchical tree Workspace: Container for Process Flow, results from tasks that you run, Data Grids, SAS code, SAS logs, and Notes Process Flow: Displays graphical representation of project Resources pane: Shows either the Server List, Task List, SAS Folders, or Prompt Manager windows. To see multiple windows click on down arrow on the pane and select Show Multiple, then click on their icon to switch between windows – Server List displays all SAS servers that you can access during your SAS Enterprise Guide session – Task List displays all available tasks – SAS Folders contain links to all your stored processes, information maps, and projects in metadata – Prompt Manager displays all available prompt Task Status: When you are running a task, progress of the task appear in the Task Status window which can be opened from View Task Status of menu bar
9
Split and Un-split the Workspace You can split Workspace into two pieces Open any item you wish to view Click Workspace Layout icon on the menu bar and select either Stacked or Side By Side from the pull-down list You can also do this by selecting View -> Workspace Layout from menu bar You can click down-arrow at the top of workspace to view a drop-down list of all items that are currently open To display an item, select it from the list To un-split workspace, select Single from the pull-down List You can click Xs in the upper-right corners to close that section of the workspace
11
Projects For a new project, select File -> New -> Project from menu For an existing project, select File -> Open -> Project and go to your project Project Tree displays projects while Process Flow displays projects using a process flow diagram
12
Projects contd. Items (data, tasks, results, program, and note) in project are represented by icons, and connected to show relationship between them – Data files may be SAS data tables, raw data files, or files from other databases or applications, like Excel. Projects contain shortcuts to data files, not the actual data. If you delete a project, your data files will still exist – Tasks are specific analyses or reports that you run, such as List Data or Bar Chart. Every time you run a task, SAS Enterprise Guide adds an icon showing that task – Results are reports or graphs produced by tasks you run and are represented by icons labeled with type of output (SAS Report, HTML, PDF, RTF, or text) and name of task. – Notes are optional text files you use to record comments or instructions for later use. To create a note, select File -> New -> Note and a text window will open, allowing you to type whatever you wish – Programs are files that contain SAS code. You can open existing programs in SAS Enterprise Guide, or you can write new programs
13
Contd. You can display properties for any item by either double clicking or right-clicking its icon and selecting Properties The actions available are – – Renaming – Deleting – Saving (name can be project-name or projectname) – Exporting (save data, programs, and results in separate files) Each project is saved as a single file with file extension.egp
15
Managing Process Flows Complex projects can be divided into several process flows To add a new process flow go to File -> New -> Process Flow or right-click current process flow and select New -> Process Flow Right-click a process flow, to customize appearance like Grid, Layout, Auto Arrange, Zoom, and Background Color View process flow by double-clicking its name or click from down arrow above the workspace New process flow, are named Process Flow n. Give a more descriptive name, by Renaming Delete Process flow from properties if needed
17
Move, Copy and Link Items Move items from one process flow to another by holding down the control key (CTRL), and clicking all the items you want to move. Then Right click, and select Move to -> process-flowname Copy is similar to move except that you cannot copy results. Select items are copy using control-click and by selecting Copy, then on target process flow right-click to Paste When a process flow is run, items are executed from top left to bottom right, following the branches created by links between items Links can be added between items to show unclear relationships or to force items to run in a particular order To add a link Right-click initial item and select Link and a window listing all items to which you can link appears Select the Link and click OK Added links use a dashed line instead of a solid line
18
Move and Copy Items
19
Link Items
20
Printing Process Flows You can Print your Process flow For printing in specific page size and orientation, click the process flow and select File -> Page setup To preview, select File -> Print preview To print, select File -> Print
21
Running the Tasks Basic steps of running task are same Select Data on which to run by clicking its icon in the Project Tree or Process Flow before you open a task Open the Task by selecting it from the Tasks menu, or clicking its name in the Task List window Run the Task by going to List Data task, which has four pages: Data, Options, Titles, and Properties. Satisfy yourself with the settings and click on Run Not Satisfied with Result? Re-running tasks with modifications can be done by – Reopening task window and clicking Modify Task on the workspace toolbar for Results tab – Right-clicking task icon in Project Tree or Process Flow, and selecting Modify taskname from pop-up menu, making changes and clicking Run Re-running tasks without modifications can be done by – Reopening task and clicking Refresh on workspace toolbar for Results tab – Right-clicking task icon in the Project Tree or Process Flow, and selecting Run from pop-up
23
Task Templates Task templates allows saving tasks in a form that is independent of data i.e they save all user settings except the assignment of variables to task roles. So Data-driven tasks like Summary and Append Table cannot save templates. Creating Task Template – Go to Tasks -> Task Templates -> Task Template Manager from the menu bar and Click New to open the New Task Template window – Type a name in Name box, an optional description in Description box and Choose a task name from Create template from task lists where all tasks currently in the project are listed and then click Create – New task template will be listed in Task Template Manager, Click Close Using Task Template – There are two ways to open a task template either by selecting Tasks -> Task Templates -> task-template-name from menu bar, or by opening Task List window and selecting Task Templates from drop-down list and clicking on template name – Active data table is used by default and you need to choose different table by clicking on Edit button on Data page Sharing Task Template – From Task Template Manager, use Export to share your task template with others – From Task Template Manager, use Import to get task templates shared by others
25
SAS Data SAS needs data to be available as SAS data sets or data tables. Some common terminology used are – Rows are called observations, columns are called variables and data tables are called data sets Column names are 32 character long and can begin with or contain any character including blanks. But to enable compatibility between base SAS and Enterprise Guide, use names starting with a letter or underscore, and contain only letters, numerals, and underscores There are two basic types of data: numeric and character – Numeric data are divided into four data groups: numeric, currency, time, and date – Character data may contain numerals, letters, or special characters (such as $ and !) and can be up to 32,767 characters long For each data type, SAS Enterprise Guide has special tools -informats for reading, functions for manipulating, formats for displaying that data type SAS Enterprise Guide uses a different icon to identify each kind of data
26
Properties – Tables and Columns To set properties for data tables, right-click data icon in the Project Tree or Process Flow, and select Properties from pop- up menu Column properties from data tables tab can’t be changed – it is view only Data Grid opens in read-only mode. To switch to update mode, select Edit -> Protect Data and then right click on the column and select Properties Select the Informats and Formats as relevant For a list of Informats and Corresponding Results Check HereCheck Here For a list of Formats and Corresponding Displays Check HereCheck Here
27
Scheduling Projects You can schedule a complete project or just a process flow. SAS uses Windows Task Scheduler to schedule tasks. To schedule a project, select File -> Schedule project-name from menu bar To schedule a process flow, right-click the name of the process flow in the Project Tree and select Schedule process-flow-name from pop-up menu On scheduling a project, SAS Enterprise Guide creates a script that is saved in a file on your computer. There are 3 tabs – Task, Schedule and Settings In Settings Tab, other options, like maximum length of time a project will be allowed to run, if it will run when computer is in sleep mode are set When satisfied with all the settings, click OK to schedule the project
28
Viewing Results and Logs To check the results of scheduled run, open project after it has completed running To check run status of a project open Properties window for that project from select File -> Project Properties from the menu bar. The Last modified field shows date and time that the project last ran Open Projects don’t run SAS log is a record of what SAS did and generated for everything done by SAS Enterprise Guide. They contain actual code that SAS ran, plus any error messages, warnings, or notes. SAS generates Program Log and Project Log – A program log is generated by a SAS program. Tasks generate logs but rarely produce errors or warnings. All program or task logs are overwritten with new ones – A Project Log is a single cumulative record of everything that has been run in a particular project and is turned off by default. Project logs are appended and needs manual clear. Turn on Project Log from View ->Project Log
30
Changing Default Settings Select Tools -> Options from Menu bar to open thisthis To change default format for results, click Results General in the left and then check all formats you want to use: SAS Report, HTML, PDF, RTF, or text output To change default style for results, click the name of the format and then select a style To run SAS code automatically, click SAS Programs -> Additional SAS code and then click Edit. Type your code in Edit window, and click Save Click Custom Code and specify code to be run before or after tasks To restore windows to their default layout, click General and then Restore To close Options window and save changes click OK. Reset All button in the lower left corner will remove all changes
31
Options Page
32
Thank You
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.