4.16M
Category: softwaresoftware

Sas base training

1.

2.

AGENDA
Introduction
Data Step
Variables
Restricting Data
Managing Data
Functions
Import/Export Data
Report Generation
Good Programming Practice

3.

INTRODUCTION
Interface
SAS Libraries
SAS Datasets

4.

INTRODUCTION
SAS Windows
SAS 9.4 Interface
3
1
2
Log
What happened, including what went wrong
3
Output
Results of program procedures that produce
output
2
1
Editor
Where code is written or imported and
submitted
Explorer
4 Shows libraries (SAS & Windows), their files
and where you can see data and some
outputs from sas procedures
4
5
Results
5 Shows how the output is made up of tables,
graphs, datasets etc.

5.

SAS 9.4 WINDOWS
EDITOR
The SAS text editor windows, Program Editor,
and NOTEPAD, work similarly to other Windows
editors. Therefore, you can edit your SAS code
without learning how to use a new text editor.
Title Bar
The title bar contains the Enhanced Editor icon and the name
of the file. If the file is new, the filename is Editor Untitled,
where x is a window number. An asterisk ( * ) in the title bar
indicates that any changes to the file have not been saved.
Expanded Code Section
An expanded code section displays all of the code within the
code section. It is indicated in the margin by the minus sign ( - ).
Collapsed Code Section
A collapsed code section displays only the signature line of
code (the line of code that contains the keyword). It is
indicated in the margin by the plus sign ( + ).
Margin
You use the margin on the left side of the Enhanced Editor window to select one or more lines of
text, expand and collapse code sections, display line numbers, code section brackets, and
bookmarks.

6.

SAS 9.4 WINDOWS
EDITOR
Opening Files
To open a file in the Program Editor:
1. With the editor window active, do one of the following:
• Click the Open toolbar button (the opened file folder)
• Type dlgopen in the command bar
• Select File and click Open
SAS displays the Open dialog box.
2. Use the Open dialog box to select the file that you want to include. By
default, SAS looks for files with the .sas file extension (which contain SAS
code, by convention). However, you can change the default by adjusting
the Files of type field. (If you change the selected file type, SAS will
remember that selection, and present it as the default the next time you
open a file for that window during the SAS session.)

7.

SAS 9.4 WINDOWS
EDITOR
Finding and Replacing Text
Find Text
1. Open the Find dialog box by selecting Edit then select Find
2. Supply the following information:
Find text: Enter a text string to find. The initial value of this field is the last text string that was used in a
search.
Direction: Select the Up or Down check box. Up specifies to search from the insertion point position
toward the beginning of the file. Down specifies to search from the insertion point position toward the
bottom of the file.
Match whole word only: Select the check box to specify that a match of the text must be a whole word
and not part of a word.
Match case: Select the check box to specify that upper- and lowercase characters must match exactly.
Find and Replace Text
1. Open the Replace dialog box by selecting Edit then select Replace
2. Supply the following information:
Find text: Enter a text string to find and replace. The initial value of this field is the last text string that
was used in a search.
Replace with: Enter the replacement string.
Direction: Select either the Up or Down check box. Up specifies to search from the insertion point
position toward the beginning of the file. Down specifies to search from the insertion point position
toward the bottom of the file.
Match whole word only: Select this check box to specify that any match of the text must be a whole word
and not part of a word.
Match case: Select this check box to specify that upper- and lowercase characters must match exactly.
3. If the text is found, click one of the following:
Replace to replace this single occurrence of the text with the replacement string.
Replace All to replace all occurrences of the text in the file with the replacement string.

8.

SAS 9.4 WINDOWS
LOG
Here the program
works without any
ERRORS/WORNINGS
Here there are
ERROR/WARNINGS
The SAS log is a record of everything that you do in your
SAS session or with your SAS program. Original program
statements are identified by line numbers. Interspersed
with SAS statements are messages from SAS. These
messages might begin with the words NOTE, INFO,
WARNING, ERROR, or an error number, and they might
refer to a SAS statement by its line number in the log.
In interactive mode, the SAS log is opened when SAS
starts. The SAS log is not named until you save it in the
active window. The name that you specify must follow
the file naming conventions for your operating
environment. The SAS log cannot be saved
automatically in interactive mode. However, SAS can
create a second copy of the SAS log if the ALTLOG=
system option is set either at SAS invocation or in a
configuration file.

9.

SAS 9.4 WINDOWS
LOG
Writing to the Log
You can instruct SAS to write additional information to the log by
using the following statements:
PUT statement
writes selected lines (including text strings and DATA step variable
values) to the SAS log.
%PUT statement
enables you to write a text string or macro variable values to the
SAS log. %PUT is a SAS macro program statement that is
independent of the DATA step and can be used anywhere.
ERROR statement
sets the automatic _ERROR_ variable to 1 and optionally writes to
the log a message that you specify. Use the ERROR statement in a
DATA step.
Use the PUT and ERROR statements in combination with
conditional processing to debug DATA steps by writing selected
information to the log.

10.

SAS 9.4 WINDOWS
OUTPUT
Uses of the Output Window
The Output window enables you to view LISTING output from your SAS programs. By default,
the Output window is positioned behind the other windows. When you create LISTING
output, the Output window automatically moves to the front of your display.
Open the Output Window
You can open the Output window in the following ways:
Command:
• Enter OUTPUT or OUT in the command line and press Enter.
• Enter LISTING or LST in the command line and press Enter.
• Menu:
• Select View then select Output.

11.

SAS 9.4 WINDOWS
EXPLORER
The Explorer window enables you to manage your files in the
windowing environment. You can use the SAS Explorer to perform
the following tasks:
• View lists of your SAS files.
• Create new SAS files.
• View, add, or delete libraries.
• Create shortcuts to external files.
• Open any SAS file and view its contents.
• Move, copy, and delete files.
• Open related windows, such as the New Library window.
Open the SAS Explorer Window
You can open SAS Explorer in the following ways:
Command:
• Enter EXPLORER in the command line and press Enter.
Menu:
• Select View then select Explorer.

12.

SAS 9.4 WINDOWS
RESULTS
Uses of the Results Window
The Results window enables you to view HTML
output from a SAS program. HTML is the default
output type, and HTMLBlue is the default output
style. The Results window uses a tree structure to
list various types of output that might be
available after you run SAS. You can view, save, or
print individual files. The Results window is empty
until you execute a SAS program and produce
output. When you submit a SAS program, the
output is displayed in the Results Viewer and the
file is listed in the Results window.
Open the Results Window
You can open the Results window in the following
ways:
Command:
Enter ODSRESULTS in the command line and press
Enter.
Menu:
Select View then select Results.

13.

SAS LIBRARIES
A SAS Library is a group of SAS
files that are stored in the same
directory and accessed by the
same engine
2
1
Double Click on
Libraries to see
SAS Libraries
3
As is shown SAS Library
contains
SAS Datasets
Other SAS files
Choose you
library, double
click on it and
see the content
in explorer
SAS data libraries help to
organize your work. For
example, if a SAS program uses
more than one SAS file, then
you can keep all the files in the
same library. Organizing files in
libraries makes it easier to
locate the files and reference
them in a program.

14.

SAS LIBRARIES
WORK Library
New created file goes to WORK library
Definition of WORK Library
The WORK library is the temporary
(scratch) library that is
automatically defined by SAS at the
beginning of each SAS session. The
WORK library stores two types of
temporary files: those that you
create and those that are created
internally by SAS as part of normal
processing. Typically, the WORK
library is deleted at the end of each
SAS session if the session
terminates normally.

15.

SAS LIBRARIES
Assigning a new library (Option 1)
To create a new SAS library with SAS code, you use the LIBNAME
statement. The LIBNAME statement associates the name of the library
with the physical location of the library

16.

SAS LIBRARIES
Assigning a new library (Option 1)
You can also create a new
SAS library by opening the
New Library window from
the libraries section
1
Right Click
Select New
2
Fill the fields and
click OK

17.

SAS DATASETS
Definition of a SAS Data set
A SAS data set is a SAS file
stored in a SAS library
that SAS creates and
processes. A SAS data set
contains data values that
are organized as a table
of observations (rows)
and variables (columns)
that can be processed by
SAS software.
Variables
Observation

18.

SAS DATASETS
A SAS data set also contains descriptor information such as the data types and lengths of the variables
3
1
Double
click on
dataset
to open
it
2
Double
click on
variable
name
Column Attributes Windows comes up

19.

DATA STEP
How SAS processes Code
Compilation
Execution

20.

How SAS Processes Code
Overview of the DATA Step
The DATA step consists of a group of SAS statements that begins with a DATA statement.
The DATA statement begins the process of building a SAS data set and names the data
set. The statements that make up the DATA step are compiled, and the syntax is
checked. If the syntax is correct, then the statements are executed. In its simplest form,
the DATA step is a loop with an automatic output and return action.
Execution Phase
Compile Phase
1
Compiles: SAS statements (including syntax checking)
2
5
Data-reading
statement:
Is there a record
to read?
Creates
• An input buffer
• A program data vector
• Descriptor information
3
4
Begins: With a DATA statements
Sets: variable values to missing in the
program data vector
6
7
NO
YES
Reads: an input record
Executes: additional executable records
Writes: an observation to the SAS data set
Returns: to the beginning of the DATA step
Closes: data set;
Goes on the
next DATA or
PROC step

21.

Compilation
During the Compilation Phase
When you submit a DATA step for execution, SAS checks the syntax of the
SAS statements and compiles them, that is, automatically translates the
statements into machine code. SAS further processes the code, and
creates the following three items:
Input Buffer
Is a logical area in memory into which SAS reads each record of data
from a raw data file when the program executes. (When SAS reads from
a SAS data set, however, the data is written directly to the program data
vector.)
Program Data Vector
Is a logical area of memory where SAS builds a data set, one observation
at a time. When a program executes, SAS reads data values from the
input buffer or creates them by executing SAS language statements. SAS
assigns the values to the appropriate variables in the program data
vector. From here, SAS writes the values to a SAS data set as a single
observation.
The program data vector also contains two automatic variables, _N_ and
_ERROR_. The _N_ variable counts the number of times the DATA step
begins to iterate. The _ERROR_ variable signals the occurrence of an
error caused by the data during execution. These automatic variables are
not written to the output data set.
Descriptor Information
Is information about each SAS data set, including data set attributes and
variable attributes. SAS creates and maintains the descriptor information.
1
Compiles: SAS statements (including syntax checking)
2
Creates
• An input buffer
• A program data vector
• Descriptor information

22.

Execution
1
During the Execution Phase
All executable statements in the DATA step are executed once for each
iteration. If your input file contains raw data, then SAS reads a record into
the input buffer. SAS then reads the values in the input buffer and assigns
the values to the appropriate variables in the program data vector. SAS
also calculates values for variables created by program statements, and
writes these values to the program data vector. When the program
reaches the end of the DATA step, three actions occur by default that
make using the SAS language different from using most other
programming languages:
1. SAS writes the current observation from the program data vector to
the data set.
2. The program loops back to the top of the DATA step.
3. Variables in the program data vector are reset to missing values.
Note: The following exceptions apply:
• Variables that you specify in a RETAIN statement are not reset to
missing values.
• The automatic variables _N_ and _ERROR_ are not reset to
missing.
If there is another record to read, then the program executes again. SAS
builds the second observation, and continues until there are no more
records to read. The data set is then closed, and SAS goes on to the next
DATA or PROC step.
2
Begins: With a DATA statements
Sets: variable values to missing in the
program data vector
3
Data-reading
statement:
Is there a record
to read?
4
5
NO
Closes: data set;
Goes on the
next DATA or
PROC step
YES
Reads: an input record
Executes: additional executable records
Writes: an observation to the SAS data set
Returns: to the beginning of the DATA step

23.

Example of a Data Step (Option 1)
1
2
3
Write the SAS code in
Editor window and press
RUN button for compilation
and execution
With Option 1 dataset
created using DATALINES
statement. In that case
data values are listed in
data step.
1. The DATA statement begins the DATA step and names the data set that is being created.
2. The INPUT statement creates five variables, indicates how SAS reads the values from the
input buffer, and assigns the values to variables in the program data vector.
3. The DATALINES statement marks the beginning of the input data. The single semicolon
marks the end of the input data and the DATA step.

24.

Example of a Data Step (Option 2)
With Option 2 dataset created based on
existed data step with set statement
1. The DATA statement begins the DATA
step and names the data set that is
being created in WORK library
NOTE: If library name is not specified,
dataset created in WORK library by default
1
2
3
2. The SET statement copy class dataset
from sashelp library to mydata dataset
in WORK library.
2
3. The DATA statement begins the DATA
step and names the data set that is
being created in Analysis library

25.

VARIABLES
Variable Attributes
Create new variables
Missing values

26.

Variable Attributes
Variable Attribute
Possible Values
Default Value
Name
Any valid SAS name
NOTE: SAS valid names will be covered in separate slide
None
Type*
Numeric or character
Numeric
Length*
2 to 8 Bytes**
1 to 32,767 bytes for character
8 bytes for numeric and
character
Format
Some examples: DATEw., TIMEw., WEEKDAYw., PVALUEw.d
Best12. for numeric, $w. for
character
Informat
Some examples: DATEw., TIMEw., ANYDTDTEw., MMDDYYw.
w.d for numeric, $w. for
character
Label
Up to 256 characters
None
*If they are not explicitly defined, a variable’s type and length are implicitly defined by its first occurrence in a DATA step
**The minimum length is 2 bytes in some operating environments, 3 bytes in others. See the SAS documentation for your operating
environment.

27.

VARIABLE NAME
• Identifies a variable. A variable name must conform to SAS naming rules. A SAS name can
be up to 32 characters long. The first character must be a letter (A, B, C, . . . , Z) or
underscore (_). Subsequent characters can be letters, digits (0 to 9), or underscores. Note
that blanks are not used. Mixed case variables are used.
The names _N_, _ERROR_, _FILE_, _INFILE_, _MSG_, _IORC_, and _CMD_ are reserved
for the variables that are generated automatically for a DATA step. Note that SAS
products use variable names that start and end with an underscore.
NOTE: it is recommended that you do not use names that start and end with an underscore
in your own applications.

28.

VARIABLE TYPE & LENGTH
In This example variables var1 and var2 are
defined as character with 30 length. Var3 is a
numeric variable and the length is 5.
NOTE: For assigning length to character variable
should be used $ sign.
Type
• Identifies a variable as numeric or character. Within a
DATA step, a variable is assumed to be numeric unless
character is indicated. Numeric values represent numbers,
can be read in a variety of ways, and are stored in floatingpoint format. Character values can contain letters,
numbers, and special characters and can be from 1 to
32,767 characters long.
Length
• Refers to the number of bytes used to store each of the
variable's values in a SAS data set. You can use a LENGTH
statement to set the length of both numeric and
character variables. Variable lengths specified in a LENGTH
statement affect the length of numeric variables only in
the output data set; during processing, all numeric
variables have a length of 8. Lengths of character variables
specified in a LENGTH statement affect both the length
during processing and the length in the output data set.

29.

VARIABLE FORMAT, INFORMAT & LABEL
Format
Refers to the instructions that SAS uses when printing
variable values. If no format is specified, the default
format is BEST12. for a numeric variable, and $w. for a
character variable. You can assign SAS formats to a
variable in the FORMAT statement.
Informat
Refers to the instructions that SAS uses when reading
data values. If no informat is specified, the default
informat is w.d for a numeric variable, and $w. for a
character variable. You can assign SAS informats to a
variable in the INFORMAT statement.
Label
Refers to a descriptive label up to 256 characters long. A
variable label, which can be printed by some SAS
procedures, is useful in report writing. You can assign a
label to a variable with a LABEL statement.

30.

CREATE NEW VARIABLES
These are some of the most common ways that you can create variables in a DATA step:
Use an assignment statement
Read data with the INPUT
statement in a DATA step
Specify a new variable in a
FORMAT or INFORMAT
statement
Specify a new variable in a
LENGTH statement

31.

Numeric missing values are represented by a single
period (.).
Character missing values are represented by a single
blank enclosed in quotes (' ').
MISSING VALUES
Working with missing values
Missing value
for character
variable
Missing value
for Numeric
variable
Assigning missing
value to
Character
and
Numeric
To check if variable is missing or not for current record
• For numeric:
if missing(height)
if height=.
• For character
if missing(sex)
if sex=‘ ‘
if sex=“ ”
To count number of missing values for given variables
in current record
• For numeric
count=nmiss(Age, Height, Weight)
count=cmiss(Age, Height, Weight)
• For character
count=cmiss(Name, Sex)

32.

DATA MANLPULATIOS
Setting Datasets
Keep, Drop
If and ELLSE IF
Subsetting IF and WHERE
Sorting Datasets
Merging Datasets
Commonly Used SAS Functions

33.

SETTING DATASETS
Besides creating SAS datasets using INPUT and DADALINES statements, SAS data sets can also be used as input to a DATA step.
As an example, you might want to use the information in an existing SAS data set to compute new variables.
As an example, consider the data set Class (stored in SASHELP library). This data set contains the variables NAME, AGE, HEIGHT,
WEIGHT. Suppose you want to compute the BMI for each subject in this data set.
Screenshot here, performs this task:
Program Code
Input Data
Output Data

34.

SETTING DATASETS TOGETHER
We can create new SAS Dataset by setting several Datasets.
For example:
We have two datasets for students in SOURCE library:
• One is students_m datasets for Male students
• Second is Syudents_f dataset for Female students
We want to create Students datasets by setting students_m and students_f datasets
Screenshot here, performs this task
Program Code
Input Data
Input Data
Output Data

35.

KEEP, DROP
If you do not need one or more variables from the input data set (the data set on the SET
statement), you can use a DROP= or KEEP= data set option. For example, to omit
WEIGHT and HEIGHT variables from from the new data set created by setting SASHELP.FISH dataset , you can use the following
methods:
SASHELP.FISH
Using drop statement
New created WORK.FISH Dataset
Using keep
statement

36.

IF and ELSEIF
Two of the basic tools for conditional processing are the IF and ELSE IF statements. To understand how these statements work,
suppose you have collected data on a group of students based on the following variables:
• Age (in years)
• Gender (recorded as M or F)
First task is to create a new variable that represents age groups:
Here is first attempt:
First the program checks the logical condition following the IF statement: That is age<20.
If this condition is TRUE then SAS will proceed with the statements following THEN
statement
If the condition following the IF statement is FALSE SAS will proceed with the statements
following the ELSE statement

37.

IF and ELSEIF
We can create complex logical expressions using AND or OR statements
The complex logical expression with AND operator is TRUE if all simple conditions are TRUE
The complex logical expression with OR operator is TRUE if at least one of simple conditions is TRUE

38.

SUBSETTING IF and WHERE
Subsetting a SAS data set involves selecting observations from one data set by defining selection criteria, usually in a
WHERE or subsetting IF statement. As an example, suppose you want to select all observations from the permanent
SAS data set Class where the value of SEX is F.
We can use WHERE statement put the condition in brackets next
to the dataset name (Recommended to use this one)
The result is the same for all of this 3 cases
We can use WHERE statement put the condition anywhere in
data step
We can use IF statement put the condition anywhere in data
step

39.

SORTING DATASETS
There are many reasons for sorting your data: to organize data for a report, before combining data sets, or before using a BY
statement in another PROC or DATA step. Fortunately, PROC SORT is quite simple.
The basic form of this procedure is
PROC SORT;
BY variable-1 ... Variable-n;
Run;
The variables named in the BY statement are called BY variables. You can specify as many BY variables as you wish. With one BY
variable, SAS sorts the data based on the values of that variable. With more than one variable, SAS sorts observations by the
first variable, then by the second variable within categories of the first, and so on.
By default proc sort sorts data in
ascending sequence. To sort in
descending use descending before
variable name

40.

MERGING DATASETS
SAS uses the term merge to describe the process of combining variables (columns) from two or more data sets. For example,
you could have an employee data set (Employee) containing ID numbers and names. If you had another data set (Hours)
containing ID numbers, along with a job class and the number of hours worked, you might want to add
the name from the Employee data set to each observation in the Hours data set.
EMPLOYEE Data
HOURS Data
COMBINE Data
NOTE: Datasets should be sorted
before merging. Sort-BY and
merge-By should be the same

41.

COMMONLY USED SAS FUNCTIONS
Function
Purpose
Syntax
Example
Function
Returns
UPCASE
To change all letters to uppercase
UPCASE(character-value)
UPCASE(“ABCxyz”)
“ABCXYZ”
LOWCASE
To change all letters to lowercase
LOWCASE(character-value)
LOWCASE(“ABCxyz”)
abcxyz
LENGTH
To determine the length of a character value, not
counting trailing blanks.
LENGTH(character-value)
LENGTH(“ abcXYZ”)
6
SUBSTR
To extract part of a string.
SUBSTR(character-value, start
<,length>)
STRING=“ABC123x”;
SUBSTR(STRING,4,2)
“12”
CATS
To concatenate (join) two or more character
strings or numeric values,
stripping both leading and trailing blanks on
character values.
CATS(item-1, item-2 <,item-n>)
A = "Bilbo"
B = "Frodo"
CATS(A,B)
“BilboFrobo”
CATX
To concatenate (join) two or more character
strings or numeric values,
and inserting
one or more separator characters between the
strings.
CATX(separator, item-1, item-2
<,item-n>)
A = "Bilbo"
B = "Frodo"
CATS(“ “, A,B)
“Bilbo Frobo”

42.

COMMONLY USED SAS FUNCTIONS
Functio
n
Purpose
STRIP
To strip leading and trailing blanks from character variables or
strings.
STRIP(charactervalue)
STRIP(“
SCAN
Extracts a specified word from a character value, where word is
defined as
the characters separated by a set of specified delimiters. The
length of the
returned variable is 200, unless previously defined.
SCAN(char-value, n
<,'delimiters‘)
STRING1 = "ABC DEF“
SCAN(STRING1,2,” “)
MISSIN
G
To determine if the argument is a missing (character or
numeric) value.
MISSING(variable)
NUM1=5
CHAR1=“ “
MISSING(NUM1)
MISSING(CHAR1)
0
1
VAR1=“123”
VAR2=“10/21/1980”
INPUT(VAR1, 3.)
INPUT(VAR2,MMDDY
Y10.)
123
7599 (equals to
10/21/1980)
PUT(17, 3.)
“17”
INPUT
PUT
Syntax
Example
Function
To perform character-to-numeric conversion.
To perform numeric-to-character conversion or to create a
character variable from a user-defined format.
INPUT(value,
informat)
PUT(value, format)
abc “)
Returns
“abc”
“DEF”
http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a001263753.htm

43.

FORMATS/INFORMATS
INPORT/EXPORT EXCEL
FORMATS
INFORMATS
IMPORT DATA
EXPORT DATA

44.

FORMATS
SAS provides built-in formats to improve the appearance of printed output. For example, you can print financial data with
dollar signs or add commas to large numbers. You can also create your own formats. For example, if you have a variable
called Gender with values of F and M, you can format these values so that they print as Male and Female. If you have a
variable representing age, you can use formats to display the values as age groups instead of actual ages
You create user-defined formats with PROC FORMAT; you associate your formats (or SAS built-in formats) with one or more
variables in a FORMAT statement.
You should notice several things about this procedure. First, you use a VALUE statement to create each
user-defined format. Next, formats used with character variables start with a dollar sign. Following the
format name are either unique values or ranges, an equal sign, and then the text you want to associate
with each value or range of values.
Rules concerning format names are the same as those for SAS variable names.
The first format to be defined is $GENDER. Format names do not need to be related to a variable name—calling this format $GENDER
makes it easier to remember that you will use it later to alter how the Gender values will be printed in SAS output.
Values for Gender are stored as M and F. Associating the $GENDER format with the
variable Gender results in M displaying as Male, F displaying as Female.
The format AGEGR is used to group ages into three categories. If you apply this format to the variable Age, the age groups are printed
instead of the actual ages. Remember that the internal values of SAS variables are not changed because they have been associated with a
format. The format affects only how values print or, in some cases, how SAS procedures process a variable.

45.

FORMATS
Lets see haw works format on data values
SAS code to apply the
3 formats to variables
Here we have created
1 $GENDER and AGEGR formats
We want to apply $GENDER
format to variables SEX and
2 AGEGR format to variable AGE in
SASHELP.CLASS dataset
4 The class dataset with
formatted variables

46.

INFORMATS
As we saw a FORMAT is a layout specification for how a variable should be printed or displayed.
An INFORMAT is a specification for how raw data should be read
You use an INVALUE statement to create an informat. The rules are similar to the ones
you use in creating formats.
Following the keyword INVALUE, you type the name of the informat you want to create.
The SEXN format can be used to create a new variable based on sex variable values “M” and “F”
The new variable is created based on SEX
variable using input function with SEXN informat

47.

IMPORT DATA from EXCEL
It is quite common to be given a Microsoft Office Excel spreadsheet as your data source.
Luckily, SAS has several methods to easily convert a spreadsheet into a SAS data set.
Using the Import Wizard to Convert a Spreadsheet to a SAS Data Set
The spreadsheet here was created using Excel. The Wage column (E) was computed by multiplying the Hours Worked
column (C) by the Rate Per Hour column (D). Notice that the column headings are not valid SAS variable names. In
addition, this spreadsheet has two worksheets: one named Temporary (for temporary workers) and the other named
Permanent (for permanent employees).

48.

Using the Import Wizard to Convert a Spreadsheet to a SAS Data Set
1
The first step is to
select Import Data from
the SAS File menu, as
shown here:
3 Click Next to bring up the next screen. Here you can either type in
the name for the Excel file you want to read, or select Browse to
obtain a list of the Excel spreadsheets on your system.
2
This brings up a screen where you can select
from a variety of formats (Excel, Access,dBase,
Lotus, and several others). Select Microsoft
Excel from the pull-down menu.

49.

Using the Import Wizard to Convert a Spreadsheet to a SAS Data Set
4
If you have multiple worksheets, you can select the one you want to import. The default worksheet name is Sheet1$ (SAS
places a dollar sign after the worksheet name). Any named ranges that have been created in the worksheet are also
listed. Worksheet names end in a $; the names of named ranges don’t.
Once you have selected the table you want to import, click Next. You are presented with a screen where you can enter a
5 library (Work, if you want a temporary SAS data set, or a libref created with a LIBNAME statement) and the name of the SAS
data set (labeled as Member in the destination screen). See the following:
If you then select Finish, SAS imports your spreadsheet. If you select Next, you can
choose to save the conversion program (PROC IMPORT). If you save this program (you
will be prompted for the name of a file in which to save the program), you can run it
later to perform your conversion.
IMPORT IS DONE
That’s all there is to it. In this example, you chose the Work library and
called your SAS data set Wages_Temporary.

50.

EXPORTING DATA
let’s see how you can use the Export Wizard to convert a SAS data set into an Excel spreadsheet. From the File menu,
select Export Data and then select Microsoft Excel.
1
On the next screen, enter the LIBNAME and the name of
2 the SAS data set you want to export (Sales in this example)
and click Next.

51.

EXPORTING DATA
3
Next, select Microsoft Excel from the pull-down menu.
4
5
Enter the spreadsheet file name
Select Finish and SAS writes the data to an Excel
spreadsheet (or select Next to write the PROC
EXPORT statements to a file).

52.

REPORT GENERATION
PROC CONTENTS
PROC FREQ
PROC MEANS
PROC REPORT

53.

PROC CONTENTS
The CONTENTS procedure generates summary information about the contents of a dataset, including:
• The variables' names, types, and attributes (including formats, informats, and labels)
• How many observations are in the dataset
• How many variables are in the dataset
• When the dataset was created
• This procedure is especially useful if you have imported your data from a file and want to check that your variables have
been read correctly, and have the appropriate variable type and format. (For example, you may wish to check that none
of your character variables have been truncated, and that your date variables have not been misread.)
The basic syntax of PROC CONTENTS is:
PROC CONTENTS DATA=sample;
RUN;
The results will be printed in SAS RESULTS window
We can keep the results in a data set. For that need to add OUT=[dataname] option:
PROC CONTENTS DATA=sample out=output;
RUN;

54.

PROC CONTENTS
Lets see how PROC CONTENTS works on SASHELP.CLASS dataset
After running this code SAS prints 3 tables in SAS RESULTS window with the following information.
And also outdata dataset is created in WORK library

55.

PROC FREQ
The FREQ procedure prints all values of a given categorical variable in the Output window, along with the number and
percentage of times each value appears. The FREQ procedure can work with both string (character) or numeric categorical
variables.
The basic syntax of the FREQ procedure is:
PROC FREQ DATA=dataset;
TABLES variable(s)/<options>
RUN
In the first line of the SAS code above, PROC FREQ tells SAS to execute the FREQ procedure on the dataset given in the
DATA= argument.
On the next line, the TABLES statement is where you put the names of the variables you want to produce a frequency table
for. You can list as many variables as you want, with each variable separated by a space. If the TABLES statement is not
included, then SAS will generate a table for every variable in the dataset.
The results will be printed in SAS RESULTS window
We can keep the results in a data set. For that need to add option OUT=[dataname];
PROC FREQ DATA=dataset;
TABLES variable(s)/out=outdata;
RUN;

56.

PROC FREQ
In the SASHELP.CLASS dataset variable SEX has values ‘F’ or ‘M’
Lets run PROC FREQ to see how many ‘F’ and how many ‘M’ values has the SEX variable
After running this code SAS prints the result in RESULTS window including the information of Frequency and Percent
Also outdata dataset is created in WORK library with the information of Frequency and Percent

57.

PROC MEANS
One of the most powerful and flexible Procedures you’ll find in the SAS System is PROC MEANS. You can use it to rapidly and
efficiently analyze the values of numeric variables and place those analyses either in the Output Window or in a SAS Data
Set (or both).
When using it, the term “analysis variable” refers to the numeric variable (or variables) whose values you want to have the
procedure analyze.
The basic syntax of the FREQ procedure is:
PROC MEANS DATA=dataset <options> ;
BY variable-1 variable-n;
VAR variable(s);
OUTPUT OUT=<Output dataset name>;
RUN;
“By” variables are those (numeric or character) variables whose values will be used to “classify” the analyses of the values
of the analysis variables. For example, if you want to analyze the numeric variable SALARY classified by GENDER, the analysis
variable is SALARY and the classification variable is GENDER. The analyses you can perform using PROC MEANS are referred
to as “statistics” or “analyses” and are implemented by specifying the “statistics keyword” for the desired analysis within the
PROC MEANS “task” or “unit of work.” So, if you wanted the MEAN and MEDIAN values of SALARY classified by GENDER, the
MEAN and MEDIAN statistics keywords would be specified in your PROC MEANS task.

58.

PROC MEANS
By default, PROC MEANS will analyze all numeric variables in your data set and “deliver’ those analyses to your Output Window. Five default
statistical measures are calculated:
N Number of observations with a non-missing value of the analysis variable
MEAN Mean (Average) of the analysis variable’s non-missing values
STD Standard Deviation
MAX Largest (Maximum) Value
MIN Smallest (Minimum) Value
If we want more statistics for given variable we need to tell the PROC MEANS what we want:
For example if we want N MEAN STD MAX MIN Q1 and Q3 for salary variable by Gender we need to do one of the following:
Option 1
PROC MEANS DATA=employee N MEAN STD MAX MIN Q1 Q3;
BY gender
VAR salary;
OUTPUT OUT=s_means;
RUN;
Option 2
PROC MEANS DATA=employee
BY gender
VAR salary;
OUTPUT OUT=s_means
N=<name> MEAN=<name> STD=<name> MAX=<name> MIN=<name> Q1=<name> Q3=<name>;
RUN;

59.

PROC MEANS
Lets see how PROC MEANS works in an example
The SAS dataset Class in SASHELP library contains student SEX and AGE.
Let us summarise AGE variable by GENDER
NOTE: Dataset should be sorted in the same BY group as in proc means BY group
We can add more statistics like Q1 and Q3
The result is displayed in SAS RESULTS WINDOW

60.

PROC MEANS
Besides displaying the results in RESULTS window PROC MEANS also can keep the results in SAS data set
For this we need to add OUTPUT OUT=<dataset> option
Option 1
Option 2
In Option 2 we need to give SAS valid names to PROC MEANS STATISTICS

61.

PROC REPORT
PROC REPORT will display data. That’s a given. That it is more powerful than the standard SAS® reporting tool PROC PRINT
is also becoming common knowledge. The syntax of PROC REPORT is different from all the other procedures
PROC REPORT DATA=datasetname <options>;
COLUMN <variable list and column specifications>;
DEFINE column /<define type and column attributes>;
DEFINE column/<define type and column attributes>;
….
COMPUTE blocks;
RUN;
• COLUMNS statement defines which columns appear in the report, and their order.
• DEFINE statements declare how variables are to be used in the report.
• COMPUTE blocks allow calculations to be performed in the report.

62.

PROC REPORT
Now we are ready to take these statements and options and begin creating reports using the SASHELP.CLASS data set
The variables after columns statement will be reported in the
order as is in columns statement
Each variable display label is after display statement
This is a very simple example of PROC REPORT

63.

PROC REPORT
Lets add a new column that is not in dataset.
For examp0le we need one more column: index which is equal to height/weight
This variable is not in dataset and we need to create index column using COMPUTE statement within PROC REPORT
Although the variable is not in the dataset but it should be listed in
columns statement
The calculation of index variable is within COMPUTE; ENDCOMP block
Note that DEFINE for index variable is COMPUTED, Since the variable is
not in dataset

64.

PROC REPORT
Now lets report CLASS dataset to list Females first then Males and display ‘F’ and ‘M’ only once for first row only.
For this we use GROUP instead of DISPLAY
Note that DEFINE for SEX variable is GROUP and the values of Sex
variable with Gender label are displayed only once and the report is
sorted to display Female students first then Male students

65.

GOOD PROGRAMMING PRACTICE
To insure accuracy, multiple programmers should review all code. Programmers should therefore write code in ways that makes
review as easy to read as possible. Good formatting of the code is essential. The following are some basic tips on good
formatting:

66.

GOOD PROGRAMMING PRACTICE

67.

GOOD PROGRAMMING PRACTICE

68.

GOOD PROGRAMMING PRACTICE

69.

70.

AGENDA
Advanced Features
Data manipulations
SAS Macros
Proc SQL

71.

Advanced Features
Output
Loops
Retain
Arrays

72.

OUTPUT
The OUTPUT statement tells SAS to write the current observation to a SAS data set immediately, not at the end of the DATA step. If no
data set name is specified in the OUTPUT statement, the observation is written to the data set or data sets that are listed in the DATA
statement.
In the example bellow is created compound data set with 3
observations since there are 3 output statements: So for each record
after variables calculations used output statement to write the
current observation in the data set
In the example bellow is created two datasets based on
sashelp.class dataset. Male records will be written in male dataset
and female records will be written in female dataset.

73.

LOOPS
Many programming tasks require that blocks of code be run more than once. SAS provides several ways to accomplish
this. This chapter covers DO groups, DO loops, DO WHILE statements, and DO UNTIL statements.
DO and END
The DO statement specifies that the statements following the DO statement be executed as a group until a matching END statement
appears. DO statements often appear in IF-THEN/ELSE statements, where they designate groups of statements to be performed when
the IF condition is true or false.
For example
Input Data
The program
Output Data

74.

LOOPS
DO Loops
Loops are fundamental to programming because they enable you to repeat a computation for various values of parameters. Different
languages use different keywords to define the iteration statement.
The basic iterative DO statement in SAS has the syntax DO value = start TO stop. An END statement marks the end of the loop, as
shown in the following example:
Note: OUTPUT statement used to write the records in each iteration of do/end
By default the
increasing value is 1
By statement used
to identify the
increasing step

75.

LOOPS
DO While
The DO WHILE statement tests the condition at the top of the loop. If the condition is false the first time the macro processor tests it, the
DO WHILE loop does not iterate.

76.

LOOPS
DO Until
The DO WHILE statement executes statements in a DO loop repetitively while a condition is true, checking the condition before each
iteration of the DO loop. The DO UNTIL statement evaluates the condition at the bottom of the loop; the DO WHILE statement
evaluates the condition at the top of the loop.
Note: The statements in a DO UNTIL loop always execute at least one time, whereas the statements in a DO WHILE loop do not iterate
even once if the condition is false.

77.

LOOPS
Leave and Continue
SAS programmers who have experience with other programming languages sometimes wonder whether the SAS language supports
statements that are equivalent to the "break" and "continue" statements in other languages. The answer is yes. The LEAVE statement in
the SAS DATA step is equivalent to the "break" statement. It provides a way to immediately exit from an iterative loop. The CONTINUE
statements in the SAS DATA step skips over any remaining statements in the body of a loop and starts the next iteration.

78.

RETAIN
The RETAIN statement simply copies retaining values by telling the SAS not to reset the variables to missing at the beginning of each
iteration of the DATA step. If you would not use retain statement then SAS would return missing at the beginning of each iteration.
The RETAIN statement also used to order the variables in data
step

79.

ARRAYS
First of all, what is an array? SAS arrays are a collection of elements (usually SAS variables) that allow you to write SAS statements
referencing this group of variables.
Note: SAS arrays are different from arrays in many other programming languages. They do not hold values, and they allow you to
refer to a collection of SAS variables in a convenient manner.
Typically arrays are used to perform a similar operation on a group of variables.

80.

DATA MANIPULATION
Proc Transpose
Proc Compare
Descriptive Summary Tables
Data Listings
Proc Report

81.

PROC TRANSPOSE
Up Transpose
The TRANSPOSE procedure creates an output data set by restructuring the values in a SAS data set, transposing selected variables into
observations. The TRANSPOSE procedure can often eliminate the need to write a lengthy DATA step to achieve the same result. Further,
the output data set can be used in subsequent DATA or PROC steps for analysis, reporting, or further data manipulation.

82.

PROC TRANSPOSE
Down Transpose

83.

PROC COMPARE
Compares the contents of two SAS data sets, selected variables in different data sets, or variables within the same data set. Comparison of
two datasets is a technique used to know that two datasets are equal or if they have discrepancies. This method can be used to validate
that a dataset has been created correctly or that the changes in a dataset are only those that are expected. I.e. observations were added or
removed or corrections were done.
Class_primary
Class_qc
Now lets compare the above two datasets. If we look at row 7 we can see the height and weight have discrepancies. Lets see
how does proc compare present the discrepancies

84.

PROC COMPARE
After data statement is written the primary data. This data need to be
compared with the qc data which is after compare statement.
Here is displayed datasets names, creation dates, modified date, number of variables
and number of observations. So in this part number of variables and number of
observations are matching
Both this two datasets have 5 variables and all 5 variables are common. So
this means the two datasets contain the same variables
In this section is displayed
• First compared record which is 1st record
• First unequal record number, which is 7th, since in 7th record height
and weight have discrepancies
• last unequal record number, which also is 7th, since only in 7th record
there are discrepancies
Both have 19 observations. 18 of them are with all compared variables
and one mismatch

85.

PROC COMPARE
This section tell as about variables mismatch summary.
So according to this result in the two datasets there are 3 variables that are exactly
equal for all the records, and two variables have mismatches.
Here is listed the variables that have mismatches: the list include variable names,
type, length, occurrence of mismatches (in our case it is 1 since only 7th record has
mismatches) and the maximum difference (for HEIGHT: 59.8-58.2=1.6)
In this section displayed the variable values that have difference. List includes the
record number (7th in our case) variable values in primary (on left) and in qc(on
right) datasets.

86.

PROC COMPARE
As we see proc compare prints the results in RESULTS window. We can add more options to create a new SAS dataset to keep the
differences. For that we need to add option OUT=<dataset-name>
In the example bellow used proc compare to compare class_primary and class_qc datasets and the results is kept in compare_dif
dataset.
The other options listed after output dataset name are for the output dataset accuracy
From the output dataset we can see that only HEIGHT and WEIGHT variables have differences.

87.

PROC COMPARE
After all corrections in primary dataset (or in qc, whichever is not correct) proc compare prints the following result, which means both
datasets are exactly equal.

88.

Descriptive Summary Tables
Lets learn how to create descriptive summary tables on an example:
SASHELP.CARS is a data about cars.
We need to create the following summary table for invoice based on cars data
N is the number of cars in each group
SD=standard deviation

89.

Descriptive Summary Tables
The format of invoice variable is changed: $ sign is removed

90.

Descriptive Summary Tables

91.

Descriptive Summary Tables

92.

Descriptive Summary Tables

93.

Descriptive Summary Tables
So the summary table is ready.
Note that SAS Log should be clean of warnings/errors and undesirable notes during the programming.

94.

Produce Listings
Lets learn how to Produce data listingson an example:
SASHELP.Fish is a data about fish with the information Species, Weight, Length1-3, Height, Width.
Need to create the following listing of fish data

95.

Produce Listings

96.

Produce Listings
Listing is created. Note that each Species
displayed only once in the first column.

97.

Proc Report
After getting table/listing results in SAS Dataset usually we need to report them in rtf file.
Mostly we can use Proc Report
Now lets try to print the Fish data listing in the previews slide in RT file:
For that:
1. Need to tell SAS the RTF file destination using ODS RTF FILE=“filename.rtf” statement
2. Design Proc report
3. Close the file using ODS RTF Close.
1
2
3

98.

Proc Report
Here is the result of previous code.
So the dataset is printed in rtf file. But some corrections needs.
1. Adjust columns widths
2. Change the title
3. Add Some footnotes
4. Center align all columns titles and for only Weight center align values as well

99.

Proc Report
Style statement used to change the column attributes. To adjust columns widths used cellwidth statement:
Note that summof all columns widths should not be greater than 99 to avoid the truncation

100.

Proc Report
To change the title and add footnote used Title and Footnote statements before proc report

101.

Proc Report
To justify columns values left or center used just= option within style. For column headers used Style (header) statement

102.

SAS macros
Introduction to SAS Macros
Local and Global Declarations
Using built-in macro procedures and functions

103.

Introduction to SAS Macros
Macros are particularly useful if you want to make your SAS programs more flexible and allow them to be used in different situations
without having to rewrite entire programs. Macro variables also provide a useful method for passing information from one DATA step to
another. You can even select which procedures within a large program to run, depending on the day of the week or the values in your
data.
Macro statements:
Begin with a % and a macro keyword and ends with %mend;. The formal parameters are within parentheses;
%macro MyMacro(in1, in2, in3);
--- Macro Body—
The Macro declaration
%mend;
%MyMacro(A, B, C);
Macro Call

104.

Local and Global Declarations
Creating Macro Variables
The %LET statement is very often the first macro language statement that is learned. It is roughly the macro language equivalent of the of
the DATA step's assignment statement. The %LET statement is followed by the macro variable name, an equal sign (=), and then the text
value to be assigned to the macro variable.
%LET macro-variable-name=macro-variable-value
If the %LET statement is outside of any macro, its value will be available throughout the entire program, and it is said to be a global macro
variable. On the other hand, if the macro variable is defined inside of a macro it may be local, and its
value will only be available within that macro.
Macro variable created with the name myvar and the value is the text SAS_System. To use the macro variable in the other parts of program
will be used ‘&’ sign and the name of macro variable.
%put statement used to print the macro variable value in the log file

105.

Local and Global Declarations
Macro variables can be used in DATA STEP to give values the new variables
We can keep other variables names in a macro variable
We can keep dataset names in macro variable

106.

User Defined Macro
Lets create a macro which will be used to print the first 10 observations of the input data;
1. Macro decleration begins with %macro. Next is macro name
and the parameter.
2. Created a local macro variable n. Note that this macro
variable is visible only within the printdata macro since it is
local and defined there.
3. Used SAS Proc Print to print the input dataset. With Obs
option we can conroll the printed observations count
4. Macro declaration ends with %mens
5. Macro call with % sign and macro name. In this case the
input parameter is SASHELP.CLASS dataset

107.

Built-in Macros
There are several built-in macro variables available to you as soon as you begin a SAS session. Two useful ones are &SYSDATE9 and
&SYSTIME. As you may guess, the former stores the date you started your SAS session (in DATE9. format) and the latter stores the time
the session started. As an example, you could use these automatic macro
variables to include a date and time in a TITLE statement, like this:
This is a good time to tell you that if you place a macro variable inside quotation marks, SAS resolves only macro variables that are inside
double quotation marks.
https://v8doc.sas.com/sashtml/macro/z1071968.htm

108.

SQL
Introduction to SQL
Creating new variables and Datasets using SQL
Merging Datasets with SQL
Conditional statements and aggregate functions

109.

Introduction to SQL
SQL is one of the many languages built into the SAS® System. Using PROC SQL, the SAS user has access to a powerful data manipulation
and query tool. Topics covered will include selecting, subsetting, sorting and grouping data--all without use of DATA step code or any
procedures other than PROC SQL.
SQL is a language build on a very small number of keywords:
• SELECT
• FROM
• ON
• WHERE
• GROUP BY
• ORDER BY
columns (variables) that you want
tables (datasets) that you want
join conditions that must be met
row (observation) conditions that must be met
summarize by these columns
sort by these columns

110.

Creating new variables and Datasets using SQL
Create table statement used to create a new table. Next comes the table name.
Table columns names are within parenthesis. After each column name is written column attributes: Type and label.
testdata
To add records with values used insert into statement. Values are within parenthesis.
testdata

111.

Creating new variables and Datasets using SQL
Using the SASHELP.CLASS dataset with Base SAS code, you can see here how to print the entire dataset to the results window using the
PRINT procedure. Results can be obtained using a SELECT statement. To display all columns in the Results window, an asterisk (*) is used
following a SELECT to indicate that you would like to keep all variables (columns) in the output. A call to PROC SQL SAS is concluded with a
semi-colon, followed by a QUIT statement
SAS
SQL

112.

Creating new variables and Datasets using SQL
For datasets with a large number of variables, it may be preferable to only view a subset of those variables. With Proc Print, this would be
accomplished with a VAR statement. Here, the VAR statement is used to print only the Name and Age variables from SASHELP.CLASS:
SAS
SQL

113.

Creating new variables and Datasets using SQL
Similar to the Data Step in base SAS programming, PROC SQL can also be used to create new datasets from existing data. To create a new
dataset in the WORK library called class_new, which contains all the variables and observations from SASHELP.CLASS, the Base SAS data step
is used along with a SET statement as follows. The equivalent output dataset is produced by using CREATE TABLE and AS statements before
the SELECT statement:
SAS
SQL

114.

Creating new variables and Datasets using SQL
Using the CLASS dataset as an example, say that you would like to know what the height is for each person in both inches and centimeters.
Using a single select statement, the name variable is kept, the current height variable can be renamed to height_inches, and a new height
variable called height_cm can be created by multiplying the height in inches by 2.54 to convert to centimeters.
class_heights
sashelp.class

115.

Merging Datasets with SQL
Inner Join
The SQL procedure offers another tool for combining data sets through a JOIN. In particular it offers the inner join, left join, right join.
test1
test2
Inner _ join

116.

Merging Datasets with SQL
Left Join
test1
test2
left _ join

117.

Merging Datasets with SQL
Right Join
test1
test2
right _ join

118.

Conditional statements and aggregate functions
PROC SQL is a wonderful tool for
summarizing (or aggregating) data. It
provides a number of useful summary (or
aggregate) functions to help perform
calculations, descriptive statistics, and other
aggregating operations in a SELECT
statement or HAVING clause. These
functions are designed to summarize
information and not display detail about
data. A number of summary functions are
available including facilities to count nonmissing values; determine the minimum and
maximum values in specific columns; return
the range of values; compute the mean,
standard deviation, and variance of specific
values; and other aggregating functions. In
the following table an alphabetical listing of
the available summary functions are
displayed and, when multiple names for the
same function are available, the ANSIapproved name appears first.
Summary Function
Description
AVG, MEAN
Average or mean of values
COUNT, FREQ, N
Aggregate number of non-missing values
CSS
Corrected sum of squares
CV
Coefficient of variation
MAX
Largest value
MIN
Smallest value
NMISS
Number of missing values
PRT
Probability of a greater absolute value of Student’s t
RANGE
Difference between the largest and smallest values
STD
Standard deviation
STDERR
Standard error of the mean
SUM
Sum of values
SUMWGT
Sum of the weight variable values which is 1
T
Testing the hypothesis that the population mean is zero
USS
Uncorrected sum of squares
VAR
Variance

119.

Usage of the Most Useful Aggregate Functions
Summary Function Usage
AVG, MEAN, MIN,
MAX, STD, N,
STDERR
Can be used during summary table development. In summary tables usually needs to display n, Mean,
SD (Standard Deviation), Standard Error, Minimum and Maximum.
COUNT
1. Can be used to check if a dataset is empty or not.
Select count(*)- returns number of observations.
2. For displaying number of subjects by treatment group
Count (subjid) as n
Group by treatment
CSS
You can use an aggregate function to produce a statistical summary of data in the entire table that is
listed in the FROM clause or for each group that is specified in a GROUP BY clause
NMISS
Can be used to identify if the subject has any missing test or check how many missing tests has the
subject in source data.
Select nmiss(hgt, wgt, bmi, sbp, dbp)-will return number of tests with missing results
SUM
Can be used to calculate the total dose for day for subject if the subject has multiple dosing records per
day in the source data

120.

Conditional statements and aggregate functions
sashelp.class

121.

Some Useful Advanced SAS Features
TOOL
USAGE
Proc Templete
This proc is a strong tool for developing statistical graphs
Data _NULL_
Can be used for creating macro variables. No dataset will be created.
%sgdesign;
Type this in editor and ODS Graphic Designer opens for graph creation
SASHELP.VTABLE
The VTABLE dataset in SASHELP library contains information about all the existing libraries and
Datasets
Batch Run
SAS programs can be ran without opening them. Just right click on sas file and select batch submit. If
there are multiple sas programs that need to be ran you can create a batch file using windows tool and
include all the programs for ran
English     Русский Rules