Você está na página 1de 36

Learning SAS

Lesson 1:
http://www.youtube.com/watch?v=dwKfZq9lPFM
SAS Interface:
1 box divided into 2, 1st part has 2 tabs like EXPLORER & RESULTS. 2nd part
has 3 tabs: OUTPUT, LOG & EDITOR.
Explorer: has files and libraries etc: every assignment in library is assigned
a default name as WORK and it displays results same as in excel sheet.
Results: it shows the subsidiary results file. Every time a change in code is
made a new result is created.
Editor: here we write the code to be executed like,
Data main;
x=1;
run;

main is name of the data set


it is the observation

proc print data=main;


main
run;

proc = procedure and then print the data

Output: it shows the output sets of the code.


The output of above code is:
Observation
1

X
1

Log: it shows the details of what has been done in order to execute the code
and what the observation no. etc details are.

Lesson 2:
http://www.youtube.com/watch?v=MFd7wRoH5xw
SAS Code:
The above code is simple one as in one value for one variable. But if we can
more than one variable then use code:

Data main;
Input x y z;
describe.
Cards;
values for these variables
246
789
;
Run;
Proc print data=main;
Run;

data set is main,


x y z are different variable use input to
cards is used before mentioning the data
Values

procedure prints the data set

The output is:


Observation X Y Z
1
2 4 6
2
7 8 9
*Also statement proc contents data=main shows the contents of the
program as in the no. of observation or the no. of values etc.

Lesson 3:
https://www.youtube.com/watch?v=4UaAlL7VwY0
Importing External Data:
1. From Text file:
/* TEMPLATED CODE: .txt file type, with or without delimiters */
data [appropriate data set name here];
infile "[your file location here, including .txt extension]"
LRECL=[a logical length of your data to emcompass ENTIRE data]
*for eg, in above code the length is 5 (x space y space z) but we
write 100 and depending on the data you can write.
DLM=',';
*DLM=Deliminator like comma space etc to be used in the data like
x y z or x,y,z so like wise we can include comma or space we used
space.
input
[variable names here];
run;
We used:
data infile_main;
infile "C:\My SAS Files\main.txt"
LRECL=100
DLM= ;
input x y z;
run;
But there will an error as the SAS will start reading from the top and the top
line represents the variables so to overcome we include in DLM a line i.e.:
DLM= firstobs=2;
And now the code will run as it tells SAS to start reading from second line.
2. From SAS data set:
As told earlier that the current assignments are stored in the work libraries.
But if we want we can store our code in another library by using following
code:

Libname <name> <location>;


We used:
Libname home C:/My SAS files;
Now if we want to import this SAS data set file exactly into SAS then we have
to use the code:
Data sas_format;
set <libname>.<data name>;
Run;
We used:
Data sas_format;
work library with name
Set home.main;
Run;

*this code will create new data in the


sas_format

3. From Excel File:


/* TEMPLATED CODE: Microsoft Excel (.xls) file type */
proc import out=[your data set name here]
datafile='[your file location here, including .xls extension]'
dbms=excel replace;
*translational system used every time by the import procedure and
replace statement will tell SAS to replace the data if it exsists.
*Optional statements are below;
sheet='[specify sheet to obtain]';
*used if data sets is in different sheet first one and is CASE
sensitive(use S and not s).
getnames=[yes/no - first row = variable names];
*if first row is variable use yes otherwise no.
mixed=[yes/no - refers to data types, if num AND char varibles, use yes];
usedate=[yes/no - read date formatted data as date formatted SAS data];
scantime=[yes/no - read in time formatted data as long as variable is not
date format];

run;
We Used:
proc import out=imported_excel
datafile='C:\My SAS Files\main.xls'
dbms=excel replace;
*Optional statements are below;
sheet='Sheet1';
getnames=yes;
run;
*Proc import can be used to import access files, csv, or dbf etc. you only
have to change the statement dbms=csv; or dbms=access; and so.
Helpful Notes:
1. The LIBNAME statement is used to point SAS towards a specific folder on
your computer.
2. The INFILE statement "reads" data into SAS if it is of a certain format
(usually comma, space, or tab delimited).
3. PROC IMPORT - imports data of any of several different file formats into
SAS.
4. The SET statement imports data from a library into SAS at the DATA STEP.
5. The library name in a data step's data name "writes" data from SAS into
your library folder using SAS's own file format system.

Lesson 4:
https://www.youtube.com/watch?v=zlDMwF3kQ6s
Merging data Sets:
If we have following two codes;
Data main;
Input x y z;
Cards;
123
789
;
Run;
&
Data more_people;
Input x y z;
cards;
123
456
;
run;
Now if we want to merge these two then we have to create new data set
using code:
/* 1. Use one SET statement when you have the same variables, but
different observations */
data final_one;
set main more_people;
run;
And by selecting all 3 codes and running print statement:

proc print data=final_one;


Run;
We get:
Obs
1
2
3
4

X
1
7
1
4

Y
2
8
2
5

Z
3
9
3
6

/* 2. Use two SET statements when you have different variables, but
the same observations */
First data set is main and now second is more_vars with different variables:
data more_vars;
input a b c;
cards;
20 40 60
10 20 30
;
run;
To merge both these main & more_vars we use code with 2 set statement:
data new_final;
set main;
set more_vars;
run;
Now after by selecting all 3 codes and running print statement:
proc print data=new_final;
run;
We get:
Obs X Y Z A

1
2

1 2 3 20 40 60
7 8 9 10 20 30

/* 3. Use the MERGE statement when you have a common index


variable, and any new variables or observations */
First data set is main and now second is more_vars_and_people with common
index variable and new variables:
data more_vars_and_people;
input x a b c;
cards;
1 20 40 60
7 10 20 30
2 11 12 13
3 14 15 16
;
run;
To merge both these main & more_vars_and_people we should have an index
variable to merge on (e.g. an ID variable).
Thus, you must SORT your data BY that index variable using code;
proc sort data=main;
by x;
proc sort data=more_vars_and_people;
by x;
run;
And then use final code with set:
data merged_final;
merge main more_vars_and_people;
by x;
run;
Now after by selecting all 3 codes(main & more_vars_and_people & sort &
set) and running print statement:
proc print data=merged_final;

run;
We get:
Obs
1
2
3
4

X
1
2
3
7

Y
2
.
.
8

Z
3
.
.
9

A
20
11
14
10

B
40
12
15
20

C
60
13
16
30

*the dot(.) represent the missing values.


/* 4. SQL is an advanced programming language for databases.
Here, I provide a basic example to merge the two datasets using a
LEFT JOIN. I will include more information about JOIN types in a
follow up video. For now, think of a LEFT JOIN as one that only
includes the data from the second dataset (more_vars_and_people)
that corresponds to data from the original dataset (main).
*/
*Read sql for additional information
proc sql;
*no data since it is independent of
data set and uses sql data
create table sql_final as
table=dataset in sql & name given is
sql_name
select L.*, R.*
select everything from the left &
everything from right
from main as L
(where left is main data set & right is
more_vars_and_people dataset)
LEFT JOIN more_vars_and_people as R
[and it is done on left join
where x variable from left]
on L.x = R.x;
[dataset(main) & x var from right
dataset(more_vars_and_people)]
quit;
[no run here quit is to be used]
Now after by selecting above codes and running print statement:
proc print data=sql_final;

run;
We get:
Obs X Y Z A B C
1
1 2 3 20 40 60
2
7 8 9 10 20 30
Helpful Notes:
1. Use one SET statement when you have the same variables, but different
observations.
2. Use two SET statements when you have different variables, but the same
observations.
3. Use the MERGE statement when you have a common index variable, and
any new variables or observations.
4. The MERGE statement first requires that you use the SORT procedure
(PROC SORT) to sort on the index variable before merging.
5. Make sure that you add the BY statement after the MERGE statement in
your DATA step or you will have a new dataset that is merged incorrectly.
6. PROC SQL is an advanced method of merging data that can be very
powerful for large datasets. It uses different kinds of "JOINS" that I will
provide more information on in a later video.

Lesson 5:
https://www.youtube.com/watch?v=Jj8WOndCNC8
Data Reduction and Data Cleaning:

Main Code:
data main;
input x y z;
cards;
123
789
;
run;
proc contents data=main; run;
proc print data=main; run;

show contents of the code


print the dataset

/* 1. Reduce data in the DATA STEP using a simple IF statement */


data reduced_main;
set main;
if x = 1;
run;
proc print data=main;
run;
proc print data=reduced_main;
run;
The output will be:
Obs X Y Z
1
1 2 3
/* 2. Reduce data in the PROC STEP using a simple WHERE

statement */
proc print data=main;
where x = 1;
run;
proc print data=main;
run;
proc print data=reduced_main;
run;
The output will be:
Obs X Y Z
1
1 2 3
/* 3. Reduce data in the DATA STEP by KEEPing only the variables
you do want */
data reduced_main;
set main;
KEEP x y;
run;

[works on variable rather than observations]

proc print data=main;


run;
proc print data=reduced_main;
run;
The output will be:
Obs X Y
1
1 2
2
7 8
/* 4. Reduce data in the DATA STEP by DROPing the variables you
don't want */
data reduced_main;
set main;
DROP y;
run;

proc print data=main;


run;
proc print data=reduced_main;
run;

The output will be:


Obs X
Z
1
1
3
2
7
9
/* 5. Clean up variables using the RENAME statement within a DATA
STEP */
data clean_main;
set main;
rename x = ID
y = month
z = day;
run;
proc contents data=main;
variables x y & z but after]
run;
proc contents data=clean_main;
month and day]
run;

[ contents earlier show

[ it shows variables as ID

The output will be:


Obs ID Month Day
1
1
2
3
2
7
8
9
/* 6. Clean up variables using a LABEL statement within a DATA STEP */
data clean_main;
set clean_main;
opposed to earlier ones]
label

[set is done on same dataset

ID = "Identification Number"
month = "Month of the Year"
day = "Day of the Year";
run;
proc contents data=main;
called label with each
run;
proc contents data=clean_main;
mentioned label in code]
run;

[contents now show a new heading

variable called by the

So if we run code:
proc freq data=clean_main;
table month;
run;
We get:

Months
etc
2
8

Month of the year (label)


Frequency
Cumulative

etc

1
1

/* 7. FORMAT value labels using the PROC FORMAT and FORMAT


statements */
PROC FORMAT;
value months. 1="January" 2="February" 3="March" 4="April" 5="May"
6="June" 7="July" 8="August" 9="September" 10="October"
11="November" 12="December";
run;

data clean_main;
[here we are not changing the value of 1 to
January only formatting it]
set clean_main;
format month months.; [Here month is the variable and months.(dot)
is the value of format]
run;
Now after running code:
proc freq data=clean_main;
table month;
run;
We get:

Months
etc

Month of the year (label)


Frequency

Cumulative

etc

February (formatted)
August (formatted

1
1

*Thus we get name of months rather than numeric values. And we


have formatted it.
Helpful Notes:
1. There are two places you can reduce the data you analyze; in the DATA
STEP, and in the PROC STEP.
2. To subset data in the DATA STEP, use the IF statement.
3. To subset data in the PROC STEP, use the WHERE statement.
4. Another way to reduce data is to eliminate variables using a KEEP or DROP
statement. This method is useful if you are creating a second data set or
analytic version of your main dataset.
5. The RENAME statement simply changes a variables name.

Lesson 6:
https://www.youtube.com/watch?v=p_a0WP74lCQ

SAS Arithmetic and Variable Creation:

Main Code:
data main;
input x y;
cards;
12
34
56
78
;
run;
proc print data=main;
run;

Output is:

Obs X Y
1

1 2

3 4

5 6

7 8

Now to create 3rd variable and perform arithmetic operations, for this we
write code as:

data new_main;
set main;
a = x + y;
b = x - y;
c = x * y;
d = x / y;
e = x ** y;
f = ((x + y) * (x - y));
run;

addition
subtraction
Multiplication
Division
Exponential(X ki power Y)

proc contents data=new_main;


run;
Above proc code shows the contents of the code written above that which
shows something like this:

Variables

6
7

d
e

Here the variables are sorted alphabetical wise but if we use code:

proc contents data=new_main varnum;


numberwise]
run;

[varnum helps to sort

the variables will be sorted numberwise, like this:

Variables

6
7

d
e

Now the final output of the new_main dataset, using code:

proc print data=new_main;

run;

Output:
Obs
1
2
3
4

X
1
3
5
7

Y
2
4
6
8

A
3
7
11
15

B
-1
-1
-1
-1

C
2
12
30
56

D
0.5
0.75
0.8333
0.875

E
F
1
-3
81
-7
15625
-11
58974641 -15

Helpful Notes:
1. SAS uses many of the same arithmetic operators to add, subtract, divide
and multiply as other programming languages and basic algebra.
2. Arithmetic operations on variables affect the entire list of observations. So
be careful in operating with existing variables and make new variables if you
can afford to.
3. The varnum option on the PROC CONTENTS statement can allow you to
see the variables listed in the order they were created.
Lesson 7:
https://www.youtube.com/watch?v=UsbDpmUQG9g

The One Sample t-Test and Testing for Normality:

Today's Code:
*This example, taken from Huntsberger and Billingsley (1989, p. 290), tests
whether
the mean length of a certain type of court case is more than 80 days by
using 20 randomly chosen cases.;

data time;
input time @@;
cards;
43 90 84 87 116 95 86 99 93 92
121 71 66 98 79 102 60 112 105 98
;
run;
* What does the data look like?;

proc print data=time;


run;

Output:

Obs Time
1
43
2

90

84

87

116

95

86

99

93

10 92
11 121

12 71
13 66
14 98
15

79

16 102
17

60

18

112

19

105

20

98

/* THE T-TEST PROCEDURE WITHOUT GRAPHIC OPTIONS */


**************************************************;
* THE NULL HYPOTHESIS;
**********************;
* 1. Ask yourself: What is the NULL hypothesis (h0)?;
* 2. In this case, the NULL hypothesis is: "mean length of cases is equal to 80
days";
* ALTERNATIVE HYPOTHESES;
*************************;
* 1. Ask yourself: What is the ALTERNATIVE hypothesis (h1,or Ha)?;
* 2. In this case, the ALTERNATIVE hypothesis is that the mean length of
cases is GREATER than 80 days;
* 3. We can see that we're saying "greater than" because of the option: sides
= u. U means "upper" or above/ greater than;
* 4. If we wanted to test that the mean was simply DIFFERENT? We'd specify
"sides = 2";
* 5. If we wanted to test that the mean was LOWER than 80 days? We'd
specify "sides = L" for "less than";
* THE LEVEL OF SIGNIFICANCE;

****************************;
* 1. In Statistics, we must specify the level of significance (alpha).
* 2. Roughly, you can interpret this as "This conclusion did not occur by
chance."
* 3. The flip-side of level of significance is called confidence (1-alpha).
* 4. It's common practice to use an alpha-value of 5% so we can be "95%
confident" of our results.

The code for testing:


PROC TTEST DATA=TIME H0=80 SIDES=U ALPHA=0.05;
VAR TIME;
[mention the
variable(TIME) to be tested]
RUN;

/* THE T-TEST PROCEDURE WITH GRAPHIC OPTIONS */


**************************************************;
* THE NORMALITY ASSUMPTION - GRAPHICAL ANALYSIS;
***********************************************;
* 1. Most statistics can be classified as either "parametric" or "nonparametric";
* 2. Parametric statistics have an inherent assumption that the data is
normally distributed.;
* 3. Roughly, "Normally distributed data" simply means that data fall into a
pattern if you measure it often enough;
* 4. That pattern is generally a "Bell shaped curve".;
* 5. You can test if the data is normally distributed by looking at the
histogram of the data and using a QQ-Plot.;
* 6. If it's not immediately obvious, use PROC UNIVARIATE;
The code:

ODS GRAPHICS ON;


[Graphics on]
PROC TTEST DATA=TIME H0=80 PLOTS(SHOWH0) SIDES=U ALPHA=0.05;
VAR TIME;

RUN;
[And PLOTS(SHOWH0) option means that we want to see
normal distribution]
ODS GRAPHICS OFF;
[Graphics off]

*Now in the results window under the variable time there are two more
option showing the graphics of the statistics

* THE NORMALITY ASSUMPTION - NUMERICAL ANALYSIS;


***********************************************;
* Assess normality with the Anderson-Darling test (Null hypothesis: data is
normally distributed);

The code:

proc univariate data=time;


var time;
histogram /normal;
test statistics;
run;

* This is the required line to get normality

*Now in the results section under variable time, there will be a


subfolder of histogram under which there will be a normal fit folder
and in this click on goodness of fit. In this goodness of fit SAS uses
3 tests to calculate the normality of the statistics and in Andersondarling test see the p value and compare with to get the result.
Helpful Notes:
1. The TTEST procedure requires the data be normally distributed.
2. Specifying the null-hypothesis value and the alternative hypothesis using

the h0= and sides= options on the PROC statement allow you to specifically
control what you are testing.
3. Specify the level of significance (alpha) using the alpha= option on the
PROC statement.
4. To graphically visualize the data and assess the normality assumption, use
the ODS graphics on and off statements above and below the PROC step to
show the histogram and QQ plots.
5. Lastly, formal normality assumptions (the better route) can be done using
the Anderson-Darling test in PROC UNIVARIATE. Remember that the null
hypothesis is essentially that the data is normally distributed, so you'll want
to have a non-significant p-value to know the data is normal.
Lesson 8:
https://www.youtube.com/watch?v=ULq9kQtIDMQ

Paired and Two-Sample t Tests:

Today's Code:
/* I. PAIRED t TEST EXAMPLE */

/* In this example, taken from the SUGI Supplemental Library User's Guide,
Version 5 Edition, a stimulus is being examined to determine its effect on
systolic blood pressure. Twelve men participate in the study. Each man's
systolic blood pressure is measured both before and after the stimulus is
applied.
*/
data pressure;
input SBPbefore SBPafter @@;
datalines;
120 128 124 131 130 131 118 127
140 132 128 125 140 141 135 137

126 118 130 132 126 129 127 135


;
run;

Output of this code:

Obs SBPbefore SBPafter


1

120

124

128
131

130

131

4
5

118
140

127
132

128

125

140

141

8
9

135
126

137
118

10

130

132

11

126

129

12

127

135

* NOTE: THIS IS PAIRED* DATA BECAUSE THE MEASURES DEPEND ON THE


SUBJECT
In other words, when you have different measurements that are measured
on the same subject, the data is dependent on the subject and is therefore
related to each other. As such, two-sample tests are inappropriate because
the data are not independent of each other!;

/* PAIRED T TEST WITHOUT GRAPHICS */

proc ttest data=pressure;


paired SBPbefore*SBPafter;
run;

Output:

You will get the results and see the p value in order to accept or reject the
hypothesis at 5% level of significance.

/* PAIRED T TEST WITH GRAPHICS */

ods graphics on;


proc ttest data=pressure;
paired SBPbefore*SBPafter;
run;
ods graphics off;

Output:

Here the histogram and the QQ plot shows the data to be normal and it
should be done to check as this test is done only on normal data.
* Test for Normality of Each Variable Separately;

proc univariate data=pressure;


var SBPbefore SBPafter;
histogram /normal;
run;

Output:

*Now in the results section under variable time, there will be a


subfolder of histogram under which there will be a normal fit folder
and in this click on goodness of fit. In this goodness of fit SAS uses
3 tests to calculate the normality of the statistics and in Andersondarling test see the p value and compare with to get the result.

/* II. TWO SAMPLE t TEST EXAMPLE */

/* In the following example, the golf scores for males and females in a
physical education class are compared. The sample sizes from each
population are equal, but this is not required for further analysis. The scores
are thought to be approximately normally distributed within gender.*/
data scores;
input Gender $ Score @@;
cards;
f 75 f 76 f 80 f 77 f 80 f 77 f 73
m 82 m 80 m 85 m 85 m 78 m 87 m 82
;
run;

The Output:

Obs Gender Score


1

75

76

80

77

80

77

7
8

f
m

73
82

80

10

85

11

85

12

78

13

87

14

82

* NOTE: THIS IS INDEPENDENT* DATA BECAUSE THE MEASURES ARE FROM


DIFFERENT SUBJECTS
In other words, when you have different measurements that are not
measured
on the same subject, the data is independent of every other subject and is
therefore
not related to each other. As such, two-sample tests are appropriate because
the data are independent of each other!;
/* TWO-SAMPLE T TEST WITHOUT GRAPHICS */

proc ttest data=scores cochran ci=equal umpu;


class Gender;
var Score;
run;

Output:

You will get the results and in results there are more subfolders. Here you
find whether the variances of two sample equal or not and on this basis
choose the relevant test and find whether null hypothesis is correct or not by
seeing the p value at 5% level of significance.

/* TWO-SAMPLE T TEST WITH GRAPHICS */

ods graphics on;


proc ttest data=scores cochran ci=equal umpu;
class Gender;
the dataset]
var Score;
run;
ods graphics off;

[Class statement breaks

Output:

Here the histogram and the QQ plot shows the data to be normal and it
should be done to check as this test is done only on normal data.

* Test for Normality of A Single Variable Across Different Classes;

proc univariate data=scores;


class gender;
var score;
histogram /normal;
run;

Output:

*Now in the results section under variable time, there will be a subfolder of
histogram under which there will be a normal fit folder and in this click on
goodness of fit. In this goodness of fit SAS uses 3 tests to calculate the
normality of the statistics and in Anderson-darling test see the p value and
compare with to get the result

Helpful Notes:
1. The TTEST procedure requires the data be normally distributed.
2. The PAIRED statement is required when you want to compare two
dependent measurements.
3. The CLASS statement is used when you want to compare measurements
of a variable from two different groups (e.g. gender differences).

Lesson 9:

https://www.youtube.com/watch?v=bEXKgIJSfzg&list=PL7CB9B66A2F4FB9B3
Macro Coding and Macro Variables:

Today's Code:
data main;
input ID var1 var2;
cards;
123
245
367
489

;
run;
proc contents data=main; run;

[shows content of the dataset]

Output of this code:

Obs ID Var1 Var2


1
2
3
4

2 4
3 6
4 8

3
5
7
9

/* 1. Create a macro variable using the %let statement */

%let newvar = var3; [% sign means macro & it means SAS can call new
variable var3 anytime or we can call it a global variable]
/* 2. Use the & operator to call a macro variable */

data new_main;
set main;
&newvar = var1+var2;
macro way of doing]
run;

[same as var3 = var1 + var2 but &newvar this

proc contents data=main; run;


proc contents data=new_main; run;
proc print data=new_main;
run;

Output of this code:

Obs ID Var1 Var2 Var3


1
2
3
4

2 4
3 6
4 8

3 5
5 9
7 13
9 17

/* 3. Create a macro to transform a variable */

%MACRO transform_this(x);

&x._squared = &x ** 2;
inverse of X]
&x._cubed = &x *** 3;
&x._inverse = 1 / &x;

%MEND transform_this;
data newer_main;
set new_main;
%transform_this(var1);
run;
proc print data=newer_main;
run;

Output:

[new function to transform x]

[which is square of X and Cube of X &


[dot(.) implies additional information for x]

[opening %macro & closing %mend]

Obs ID Var1 Var2 Var1_squared var1_cubed var1_inverse


1
2
3
4

1
2
3
4

2
4
6
8

5
7
9

16
36
64

64
216
512

0.5
0.25
0.1667
0.125

/* 4. Create a macro to run the CONTENTS procedure on any data set */


proc contents data=main; run;
proc contents data=new_main; run;
proc contents data=newer_main; run;
%MACRO contents_of(data_set);
proc contents data=&data_set;
run;
%MEND contents_of;
%contents_of(main);
%contents_of(newer_main);

Output:
It shows the contents of the data set main & new_main respectively.
/* 5. Create a macro to run the PRINT procedure on any data set */

%MACRO print_this(data_set);
proc print data=&data_set;
run;
%MEND print_this;

%Print_this(main);
% Print_this (newer_main);

Output:

Obs ID Var1 Var2


1
2
3
4

2 4
3 6
4 8

3
5
7
9

&

Obs ID Var1 Var2 Var1_squared var1_cubed var1_inverse


1
2
3
4

1
2
3
4

2
4
6
8

5
7
9

16
36
64

64
216
512

0.5
0.25
0.1667
0.125

Helpful Notes:
1. There are two places one can use macro variables: within a macro, and
globally outside of all STEPS.
2. The ampersand operator: &, defines a macro variable within a macro and
is used to call macro variables anywhere.
3. The %let statement allows you to define macro variables outside of a

macro, though the & operator still must be used to call the macro variable
elsewhere.
4. The MACRO statement begins the definition of a macro and the MEND
ends the definition.
5. It is optional to restate the macro name after the MEND statement.
6. A macro can be thought of as a function, where one passes something into
the function and certain things are returned. Unlike a function, however,
macros do not always have to return something.
Lesson 10:
https://www.youtube.com/watch?v=XCtJdcpImo&index=12&list=PL7CB9B66A2F4FB9B3

Configuring the SAS Environment for Efficiency:

Helpful Notes:
1. Enhanced Editor configuration
General:
Change the Tabs to 2 spaces and replace tabs with spaces.
This can help you organize the code as you write it out.
Appearance:
File Elements - they can be re-colored to suit your style.
2. Function Keys and using them. A discussion on the "Run" button (F8).
3. Using keys to navigate within SAS
F5 is program
F6 is log
F7 is output
I would remap those so they're in order left to right.
4. Preferences:
Specifically, check out the Results section
SAS 9.3 changes the default from LISTING type to HTML

You can change this back to LISTING and SAS 9.3 should operate as it did in
SAS 9.2 and previous versions.
There is one benefit of using SAS 9.3's HTML style, in that you can directly
export specific output tables to Excel or other supported systems such as
Microsoft OneNote. I don't use SAS 9.3 so I can't show this.

Você também pode gostar