Programación Sas Básica (By Julio Silva)
What is SAS and what can I use it for?
SAS is an integrated system of software solutions that enables you to perform the following tasks:
data entry, retrieval and management statistical and mathematical analysis
report writing and graphics design
business forecasting and decision support operations research and project management
applicationsdevelopment.
SAS interface
Menu and shortcuts
F3 F4 F5 F6
F7
Ctrl+E View - Contents Only
View - Results
View - Graph
Submit Recall Last Submit Editor Log Output Clear current window Explorer Results Graph
Programming process
There are two SAS steps: 1. DATA step: Permits to create and manipulate data 2. PROC step: Allows to analyse and exploit data. Theprogramming process is as follows: 1. Write the code on the Editor window 2. run the program 3. read the messages on the Log window 4. correct the code if necessary 5. read the Output window or the modified table.
Programming language
Programming language
Basic terms:
Data set: it is the rectangular form or table in which SAS
organizes data data value: each separate piece ofinformation in a data set library: virtual name given to a physical location. name: it is the name given to data sets, variables and other items observation: information about an individual entity statement: requests SAS to perform an operation or gives information to the system variable: containers that one creates within a program to store information . Variables have attributes, such as name andtype, that enable you to identify them and that define how they can be used.
Programming rules
Rules for SAS Statements:
SAS statements end with a semicolon you can enter SAS statements in lowercase, uppercase, or a
mixture of the two you can begin SAS statements in any column of a line and write several statements on the same line you can begin a statement on one line and continueit on another line, but you cannot split a word between two lines words in SAS statements are separated by blanks or by special characters.
Programming rules
SAS names are used for SAS data set names, variable names, and other items. Rules for most SAS names are:
A SAS name can contain from one to 32 characters. the first character must be a letter or an underscore subsequentcharacters must be letters, numbers, or
underscores blanks cannot appear in SAS names.
Creating a new library
There are two ways to create a new library: 1. Using the New Library icon 2. using the This second step creates a library named “malib” based on the physical repertoire “c:\sas” To erase the “malib” library we write
The DATA step
To create a table named “matable” inside the“malib” library we write
To create the same table from scratch we use:
Data matable; Input x y z; Cards; 123 4 5 6; Run;
The PROC step
To print the table we just created we use the code:
proc print matable; run;
Programación básica en SAS
¿Qué es SAS y para qué puedo utilizarlo?
SAS es un sistema integrado de software que nos permite desarrollar las siguientes tareas:
introducción, recuperación y manejo de datos
inálisis matemático y estadístico creación de gráficos predicciones de negocios y apoyo de decisiones investigación de operaciones y manejo de proyectos desarrollo de aplicaciones
Interfaz de SAS
Menú y atajos
F3 F4 F5 F6
F7
Ctrl+E View - Contents Only
View - Results
View - Graph
Correr programa Correrel último programa Editor Log Output Vaciar la ventana actual Explorer Results Graph
Proceso de programación
Existen dos pasos en SAS: 1. Paso DATA: Permite crear y manipular los datos 2. Paso PROC: Sirve para analizar y explotar los datos. El proceso de programación es el siguiente: 1. Escribir el código en la ventana “Editor” 2. correr el programa 3. leer los mensajes en la ventana “Log”...
Regístrate para leer el documento completo.