SlideShare ist ein Scribd-Unternehmen logo
1 von 47
*Built-in functions
*Data manipulation
*Updated often to include new applications
*Different packages complete certain tasks
more easily than others
*Packages we will introduce
*SAS
*R (S-plus)
*Easy to input and output data sets
*Preferred for data manipulation
*“proc” used to complete analyses with built-in
functions
*Macros used to build your own functions
*SAS Structure
*Efficient SAS Code for Large Files
*SAS Macro Facility
*Missing semicolon
*Misspelling
*Unmatched quotes/comments
*Mixed proc and data statement
*Using wrong options
*Data Step: input, create, manipulate or output
data
*Always start with a data line
*Ex. data one;
*Procedure Step: complete an operation on data
*Always start with a proc line
*Ex. proc contents;
*System options are global instructions that
affect the entire SAS session and control the
way SAS performs operations. SAS system
options differ from SAS data set options and
statement options in that once you invoke a
system option, it remains in effect for all
subsequent data and proc steps in a SAS job,
unless you specify them.
*In order to view which options are available and
in effect for your SAS session, use proc options;
run;
* center controls whether SAS procedure output is centered. By default, output is
centered. To specify not centered, use nocenter.
* date prints the date and time to the log and output window. By default, the date and
time is printed. To suppress the printing of the date, use nodate.
* label allows SAS procedures to use labels with variables. By default, labels are
permitted. To suppress the printing of labels, use nolabel.
* notes controls whether notes are printed to the SAS log. By default, notes are printed.
To suppress the printing of notes, use nonotes.
* number controls whether page numbers are printed. By default, page numbers are
printed. To suppress the printing of page numbers, use nonumber.
* linesize= specifies the line size (printer line width) for the SAS log and the SAS
procedure output file used by the data step and procedures.
* pagesize= specifies # of lines that can be printed per page of SAS output.
* missing= specifies the character to be printed for missing numeric values.
* formchar= specifies the the list of graphics characters that define table boundaries.
Example:
OPTIONS NOCENTER NODATE NONOTES LINESIZE=80 MISSING=. ;
SAS data set control options specify how SAS data
sets are input, processed, and output.
*firstobs= causes SAS to begin reading at a specified observation in a
data set. The default is firstobs=1.
*obs= specifies the last observation from a data set or the last
record from a raw data file that SAS is to read. To return to using
all observations in a data set use obs=all
*replace specifies whether permanently stored SAS data sets are to
be replaced. By default, the SAS system will over-write existing SAS
data sets if the SAS data set is re-specified in a data step. To
suppress this option, use noreplace.
Example:
*OPTIONS OBS=100 NOREPLACE;
Error handling options specify how the SAS System
reports on and recovers from error conditions.
* errors= controls the maximum number of observations for which
complete error messages are printed. The default maximum number
of complete error messages is errors=20
* fmterr controls whether the SAS System generates an error message
when the system cannot find a format to associate with a variable.
SAS will generate an ERROR message for every unknown format it
encounters and will terminate the SAS job without running any
following data and proc steps. To read a SAS system data set without
requiring a SAS format library, use nofmterr.
Example:
OPTIONS ERRORS=100 NOFMTERR;
*data statement names the data set you are
making
*Can use any of the following commands to
input data
*infile Identifies an external raw data file to read
with an INPUT statement
*input Lists variable names in the input file
*cards Indicates internal data
*set Reads a SAS data set
*To look at the variables in a data set, use
*proc contents data=dataset;
run;
*To look at the actual data in the data set,
*proc print data=dataset (obs=num);
var varlist;
run;
data treat;
infile “g:sharedBIO271treat.dat”;
input id bpa bpb chola cholb;
run;
proc print data = treat (obs=10);
run;
proc contents data=treat;
run;
*blank space (default)
*DELIMITER= option specifies that the INPUT
statement use a character other than a blank
as a delimiter for data values that are read
with list input
Sometimes you want to input the data yourself
Try the following data step:
data nums;
infile datalines dsd delimiter=‘&';
input X Y Z;
datalines;
1&2&3
4&5&6
7&8&9 ;
Notice that there are no semicolons until the
end of the datalines
*Another way to input data using the
keyboard (and often a last resort if having
problems input the data) is cards
*Similar to datalines
*data score;
input test1 test2 test3;
cards;
91 87 95
97 . 92
. 89 99
;
run;
*Sometimes your data will have characters
*Example:
data fam;
input name$ age;
cards;
Brian 27
Andrew 29
Kate 24
run;
proc print data=fam;
run;
*What is different and what happens if you
don’t have the dollar sign?
*The final way we will show to input data is if
you have a SAS data set , you can use a
libname command
libname summer "g:sharedbio271";
data treat2;
set summer.treat2;
run;
*Look at the data set with proc print
Variable label: Use the label statement in the data step
to assign labels to the variables.  You could also assign
labels to variables in proc steps, but then the labels only
exist for that step.  When labels are assigned in the data
step they are available for all procedures that use that
data set.
Example:
DATA labtreat;
SET treat;
LABEL id=“patient id” bpa =“BP on treatment A" bpb =“BP on treatment B"
cholA=“Cholesterol on treatment A” cholB=“Cholesterol on treatment B";
RUN;
PROC CONTENTS DATA=labtreat;
RUN;
*Make a data set with the following data calling
it redsox
*8, 58, 491, 163
7, 50, 469, 133
31, 107, 458, 136
33, 111, 410, 117
*Label the variables HR, RBI, AB, HITS
*Use proc print to ensure that you have input
the data correctly
*One of the best parts of SAS is the ability to complete data
manipulations
*There are four major types of manipulations
*Subset of data
*Drop / keep variables
*Drop observations
*Concatenate data files
*Merge data files
*Create new variables
*SAS easily allows you to make a data set
with a subset of the variables
*What do you think happens with this code?
DATA redsox2;
SET redsox;
KEEP ba rbi;
RUN;
*How do you think you could use drop to do
the same thing?
*We can also get a subset of the observations
*Read in treat2 from the g: drive
*This is helpful when we want to remove
missing data
DATA notreat2;
SET treat2;
IF cholA ^= . ;
RUN;
*SAS allows us to combine dataset by adding
more observations, using
data tottreat;
set treat treat2;
run;
*Check that it worked using proc print
*If a variable is called by a different name in
each dataset, you must use:
data momdad;
set dads(RENAME=(dadinc=inc)) moms(RENAME=(mominc=inc));
run;
*SAS also allows us to add more variables by merging
data files
*The data set demo gives demographic information
about the patients in treat
*Read in demo
*Now, use this code to combine the information
data extratreat;
merge treat demo;
by id;
run;
*Note: the data in each data set must be sorted to
use this code
*We can make new variables in a data step
*Let’s make a new variable in the redsox data set by
finding batting average and a variable for hr30
data redsox2;
set redsox;
ba=hits/ab;
if hr>=30 then hr30=1 else hr30=0;
run;
*Make a new data set called redsox3 using the
following data and combine it with redsox
7, 51, 378, 113
4, 41, 367, 99
20, 58, 361, 109
*Make a new variable in redsox3 that equals 1 if
rbi is more than 100 and 0 if rib is less than or
equal to 100
*file: Specifies the current output file for PUT
statements
*put: Writes lines to the SAS log, to the SAS
procedure output file, or to an external file
that is specified in the most recent FILE
statement.
Example:
data _null_;
set redsox;
file ‘p:redsox.csv' delimiter=',' dsd;
put hr rbi ab hits;
run;
*The INFILE statement specifies the input file for
any INPUT statements in the DATA step. The FILE
statement specifies the output file for any PUT
statements in the DATA step.
*Both the FILE and INFILE statements allow you to
use options that provide SAS with additional
information about the external file being used.
*An INFILE statement usually identifies data from an
external file. A DATALINES statement indicates that
data follow in the job stream. You can use the
INFILE statement with the file specification
DATALINES to take advantage of certain data-
reading options that effect how the INPUT
statement reads in-stream data.
*Missing values in SAS are shown by .
*As a general rule, SAS procedures that perform
computations handle missing data by omitting
the missing values, including proc means, proc
freq, proc corr, and proc reg
*Check SAS web page for more information
* SAS treats a missing value as the smallest
possible value (e.g., negative infinity) in
logical statements.
data times6;
set times ;
if (var1 <= 1.5) then varc1 = 0; else varc1 = 1 ;
run ;
Output:
Obs id var1 varc1
1 1 1.5 0
2 2 . 0
3 3 2.1 1
*proc print and proc contents- we have seen
these
*proc sort
*proc means
*proc univariate
*proc plot
*var: lists the variables you want to perform the
proc on
*by: breaks the data into groups
*where: limits the data set to a specific group
of observations
*output: allows you to output the results into a
data set
*We can use proc sort to sort data
*The code to complete this is
proc sort data=extratreat ; by gender ; run ;
proc sort data=extratreat out=extreat ; by gender ; run ;
proc sort data=extratreat out=extreat2; by descending
gender ; run ;
proc sort data=extratreat out=extreat3 noduplicates;
by gender ; run ;
*The basic form of proc means is
*proc means data=extratreat;
var ______;
by _______;
where _______;
output out=stat mean=bpamean cholamean;
run;
*The basic form of proc univariate is the
same, but much more information is given
*It is helpful to use the output window to
get the info you need
*To make different plots in SAS, you use
proc plot
*Scatterplot
*proc plot data=redsox;
plot rbi*ab;
run;
*You can also make plots using
*proc univariate data=redsox plot;
var rbi;
run;
*Find the mean blood pressure on treatment A
in women
*Make a scatterplot of blood pressure on
treatment B versus blood pressure on
treatment A in men
*Find the median number of home runs hit by
the Red Sox
Macros are the SAS method of making functions
*Avoid repetitious SAS code
*Create generalizable and flexible SAS code
*Pass information from one part of a SAS job to
another
*Conditionally execute data steps and PROCs
*SAS macro variable
*SAS Macro
*There are many discussions of macro variables
on the web; one good one is given here:
http://www2.sas.com/proceedings/sugi30/130
-30.pdf
Two delimiters will trigger the macro
processor in a SAS program.
*&macro-variable
This refers to a macro variable. The current
value of the variable will replace &macro-variable;
*%macro-name
This refers to a macro, which consists of one or
more complete SAS statements, or even whole data
or proc steps.
*SAS Macro variables can be defined and used
anywhere in a SAS program, except in data
lines. They are independent of a SAS dataset.
%LET: assign text to a macro variable;
%LET macrovar = value
1. Macrovar is the name of a global macro variable;
2. Value is macro variable value, which is a character
string without quotation or macro expression.
%PUT: display macro variable values as text
in the SAS log; %put _all_, %put _user_
&macrovar: Substitute the value of a macro
variable in a program;
*Here is an example of how to use a macro variable:
*%let int=treat;
proc means data=&int;
run;
*Now we can rerun the code again simply changing the
value of the macro variable, without altering the rest
of the code.
*%let int=redsox;
proc means data=&int;
run;
*This is extremely helpful when you have a large
amount of code you want to reference
*Definition:
%MACRO macro-name (parm1, parm2,
parmk);
Macro definition (&parm1,&parm2,
&parmk)
%MEND macro-name;
*Application:
%macro-name(values of parm1, parm2,
,parmk);
Import Excel to SAS Datasets by a Macro
%macro excelsas(in, out);
proc import out=work.&out
datafile=“g:sharedbio271&in"
dbms=excel replace;
getnames=yes; run;
%mend excelsas;
% excelsas(practice.xls,test)
Use proc print to ensure that you have the data
input properly
%let int=treat;
%let dop=%str(id bpa);
%macro happy;
data new;
set &int;
drop &dop;
run;
proc means data=new;
run;
%mend happy;
%happy
Sas-training-in-mumbai

Weitere Àhnliche Inhalte

Was ist angesagt?

Export Data using R Studio
Export Data using R StudioExport Data using R Studio
Export Data using R StudioRupak Roy
 
Tony jambu (obscure) tools of the trade for tuning oracle sq ls
Tony jambu   (obscure) tools of the trade for tuning oracle sq lsTony jambu   (obscure) tools of the trade for tuning oracle sq ls
Tony jambu (obscure) tools of the trade for tuning oracle sq lsInSync Conference
 
Arrays in SAS
Arrays in SASArrays in SAS
Arrays in SASguest2160992
 
Import Data using R
Import Data using R Import Data using R
Import Data using R Rupak Roy
 
Comparing SAS Files
Comparing SAS FilesComparing SAS Files
Comparing SAS FilesLaura A Schild
 
Oracle sql loader utility
Oracle sql loader utilityOracle sql loader utility
Oracle sql loader utilitynageswarareddapps
 
Stata Cheat Sheets (all)
Stata Cheat Sheets (all)Stata Cheat Sheets (all)
Stata Cheat Sheets (all)Laura Hughes
 
Data Warehouse and Business Intelligence - Recipe 4 - Staging area - how to v...
Data Warehouse and Business Intelligence - Recipe 4 - Staging area - how to v...Data Warehouse and Business Intelligence - Recipe 4 - Staging area - how to v...
Data Warehouse and Business Intelligence - Recipe 4 - Staging area - how to v...Massimo Cenci
 
Postgresql Database Administration- Day3
Postgresql Database Administration- Day3Postgresql Database Administration- Day3
Postgresql Database Administration- Day3PoguttuezhiniVP
 
Myth busters - performance tuning 101 2007
Myth busters - performance tuning 101 2007Myth busters - performance tuning 101 2007
Myth busters - performance tuning 101 2007paulguerin
 
Recipe 5 of Data Warehouse and Business Intelligence - The null values manage...
Recipe 5 of Data Warehouse and Business Intelligence - The null values manage...Recipe 5 of Data Warehouse and Business Intelligence - The null values manage...
Recipe 5 of Data Warehouse and Business Intelligence - The null values manage...Massimo Cenci
 
Data Warehouse and Business Intelligence - Recipe 7 - A messaging system for ...
Data Warehouse and Business Intelligence - Recipe 7 - A messaging system for ...Data Warehouse and Business Intelligence - Recipe 7 - A messaging system for ...
Data Warehouse and Business Intelligence - Recipe 7 - A messaging system for ...Massimo Cenci
 
Prog1 chap1 and chap 2
Prog1 chap1 and chap 2Prog1 chap1 and chap 2
Prog1 chap1 and chap 2rowensCap
 
Aaa ped-6-Data manipulation: Data Files, and Data Cleaning & Preparation
Aaa ped-6-Data manipulation:  Data Files, and Data Cleaning & PreparationAaa ped-6-Data manipulation:  Data Files, and Data Cleaning & Preparation
Aaa ped-6-Data manipulation: Data Files, and Data Cleaning & PreparationAminaRepo
 
DataBase Management System Lab File
DataBase Management System Lab FileDataBase Management System Lab File
DataBase Management System Lab FileUttam Singh Chaudhary
 
R hive tutorial - apply functions and map reduce
R hive tutorial - apply functions and map reduceR hive tutorial - apply functions and map reduce
R hive tutorial - apply functions and map reduceAiden Seonghak Hong
 

Was ist angesagt? (20)

Export Data using R Studio
Export Data using R StudioExport Data using R Studio
Export Data using R Studio
 
Tony jambu (obscure) tools of the trade for tuning oracle sq ls
Tony jambu   (obscure) tools of the trade for tuning oracle sq lsTony jambu   (obscure) tools of the trade for tuning oracle sq ls
Tony jambu (obscure) tools of the trade for tuning oracle sq ls
 
Arrays in SAS
Arrays in SASArrays in SAS
Arrays in SAS
 
Import Data using R
Import Data using R Import Data using R
Import Data using R
 
Sas practice programs
Sas practice programsSas practice programs
Sas practice programs
 
Comparing SAS Files
Comparing SAS FilesComparing SAS Files
Comparing SAS Files
 
Oracle sql loader utility
Oracle sql loader utilityOracle sql loader utility
Oracle sql loader utility
 
Stata Cheat Sheets (all)
Stata Cheat Sheets (all)Stata Cheat Sheets (all)
Stata Cheat Sheets (all)
 
Sql loader good example
Sql loader good exampleSql loader good example
Sql loader good example
 
Data Warehouse and Business Intelligence - Recipe 4 - Staging area - how to v...
Data Warehouse and Business Intelligence - Recipe 4 - Staging area - how to v...Data Warehouse and Business Intelligence - Recipe 4 - Staging area - how to v...
Data Warehouse and Business Intelligence - Recipe 4 - Staging area - how to v...
 
Postgresql Database Administration- Day3
Postgresql Database Administration- Day3Postgresql Database Administration- Day3
Postgresql Database Administration- Day3
 
R Get Started I
R Get Started IR Get Started I
R Get Started I
 
R Get Started II
R Get Started IIR Get Started II
R Get Started II
 
Myth busters - performance tuning 101 2007
Myth busters - performance tuning 101 2007Myth busters - performance tuning 101 2007
Myth busters - performance tuning 101 2007
 
Recipe 5 of Data Warehouse and Business Intelligence - The null values manage...
Recipe 5 of Data Warehouse and Business Intelligence - The null values manage...Recipe 5 of Data Warehouse and Business Intelligence - The null values manage...
Recipe 5 of Data Warehouse and Business Intelligence - The null values manage...
 
Data Warehouse and Business Intelligence - Recipe 7 - A messaging system for ...
Data Warehouse and Business Intelligence - Recipe 7 - A messaging system for ...Data Warehouse and Business Intelligence - Recipe 7 - A messaging system for ...
Data Warehouse and Business Intelligence - Recipe 7 - A messaging system for ...
 
Prog1 chap1 and chap 2
Prog1 chap1 and chap 2Prog1 chap1 and chap 2
Prog1 chap1 and chap 2
 
Aaa ped-6-Data manipulation: Data Files, and Data Cleaning & Preparation
Aaa ped-6-Data manipulation:  Data Files, and Data Cleaning & PreparationAaa ped-6-Data manipulation:  Data Files, and Data Cleaning & Preparation
Aaa ped-6-Data manipulation: Data Files, and Data Cleaning & Preparation
 
DataBase Management System Lab File
DataBase Management System Lab FileDataBase Management System Lab File
DataBase Management System Lab File
 
R hive tutorial - apply functions and map reduce
R hive tutorial - apply functions and map reduceR hive tutorial - apply functions and map reduce
R hive tutorial - apply functions and map reduce
 

Andere mochten auch

Universal Design
Universal Design Universal Design
Universal Design Scott Levy
 
Pepipost - Product Overview
Pepipost - Product OverviewPepipost - Product Overview
Pepipost - Product OverviewDibya Prakash Sahoo
 
2012ă‚ąăƒŒăƒăƒ‹ă‚șăƒ ïŒżB1ïŒżæ”żæČ»ćź¶ăźç”Ÿă‚“ă éƒœćž‚ïŒżé«˜æ©‹æščïŒż11N1082
2012ă‚ąăƒŒăƒăƒ‹ă‚șăƒ ïŒżB1ïŒżæ”żæČ»ćź¶ăźç”Ÿă‚“ă éƒœćž‚ïŒżé«˜æ©‹æščïŒż11N10822012ă‚ąăƒŒăƒăƒ‹ă‚șăƒ ïŒżB1ïŒżæ”żæČ»ćź¶ăźç”Ÿă‚“ă éƒœćž‚ïŒżé«˜æ©‹æščïŒż11N1082
2012ă‚ąăƒŒăƒăƒ‹ă‚șăƒ ïŒżB1ïŒżæ”żæČ»ćź¶ăźç”Ÿă‚“ă éƒœćž‚ïŒżé«˜æ©‹æščïŒż11N108211N1082
 
mapa conceptual
mapa conceptualmapa conceptual
mapa conceptualfelipesoache
 
UNIT 7 INTERIORS
UNIT 7 INTERIORSUNIT 7 INTERIORS
UNIT 7 INTERIORSshilpi roy
 
IDCC 172 Accord formation professionnelle
IDCC 172 Accord formation professionnelle IDCC 172 Accord formation professionnelle
IDCC 172 Accord formation professionnelle Société Tripalio
 
You've been framed
You've been framedYou've been framed
You've been framedkatiehatton123
 
How to Create a Winning Recruitment Strategy
How to Create a Winning Recruitment StrategyHow to Create a Winning Recruitment Strategy
How to Create a Winning Recruitment StrategyCareerBuilder
 
ćœŸćŁŒćŸźç”Ÿç‰©ă«ă‚ˆă‚‹ăƒă‚€ă‚Șă‚Żăƒ­ăƒƒă‚źăƒłă‚°ăźæž©ćșŠäŸć­˜æ€§ă«ă€ă„お
ćœŸćŁŒćŸźç”Ÿç‰©ă«ă‚ˆă‚‹ăƒă‚€ă‚Șă‚Żăƒ­ăƒƒă‚źăƒłă‚°ăźæž©ćșŠäŸć­˜æ€§ă«ă€ă„お�ćœŸćŁŒćŸźç”Ÿç‰©ă«ă‚ˆă‚‹ăƒă‚€ă‚Șă‚Żăƒ­ăƒƒă‚źăƒłă‚°ăźæž©ćșŠäŸć­˜æ€§ă«ă€ă„お�
ćœŸćŁŒćŸźç”Ÿç‰©ă«ă‚ˆă‚‹ăƒă‚€ă‚Șă‚Żăƒ­ăƒƒă‚źăƒłă‚°ăźæž©ćșŠäŸć­˜æ€§ă«ă€ă„おKatsutoshi Seki
 
noreply@utah.gov_20160224_110554-2
noreply@utah.gov_20160224_110554-2noreply@utah.gov_20160224_110554-2
noreply@utah.gov_20160224_110554-2Ryan B. Whitesides
 
The stone age
The stone ageThe stone age
The stone ageHST130mcc
 
PhD_dissertation_Niels_Erik_Olesen
PhD_dissertation_Niels_Erik_OlesenPhD_dissertation_Niels_Erik_Olesen
PhD_dissertation_Niels_Erik_OlesenNiels Erik Olesen
 

Andere mochten auch (17)

Mikey CV Final
Mikey CV FinalMikey CV Final
Mikey CV Final
 
Ppweb
PpwebPpweb
Ppweb
 
word
wordword
word
 
Universal Design
Universal Design Universal Design
Universal Design
 
Pepipost - Product Overview
Pepipost - Product OverviewPepipost - Product Overview
Pepipost - Product Overview
 
2012ă‚ąăƒŒăƒăƒ‹ă‚șăƒ ïŒżB1ïŒżæ”żæČ»ćź¶ăźç”Ÿă‚“ă éƒœćž‚ïŒżé«˜æ©‹æščïŒż11N1082
2012ă‚ąăƒŒăƒăƒ‹ă‚șăƒ ïŒżB1ïŒżæ”żæČ»ćź¶ăźç”Ÿă‚“ă éƒœćž‚ïŒżé«˜æ©‹æščïŒż11N10822012ă‚ąăƒŒăƒăƒ‹ă‚șăƒ ïŒżB1ïŒżæ”żæČ»ćź¶ăźç”Ÿă‚“ă éƒœćž‚ïŒżé«˜æ©‹æščïŒż11N1082
2012ă‚ąăƒŒăƒăƒ‹ă‚șăƒ ïŒżB1ïŒżæ”żæČ»ćź¶ăźç”Ÿă‚“ă éƒœćž‚ïŒżé«˜æ©‹æščïŒż11N1082
 
Strona internetowa firmy
Strona internetowa firmyStrona internetowa firmy
Strona internetowa firmy
 
Question two
Question twoQuestion two
Question two
 
mapa conceptual
mapa conceptualmapa conceptual
mapa conceptual
 
UNIT 7 INTERIORS
UNIT 7 INTERIORSUNIT 7 INTERIORS
UNIT 7 INTERIORS
 
IDCC 172 Accord formation professionnelle
IDCC 172 Accord formation professionnelle IDCC 172 Accord formation professionnelle
IDCC 172 Accord formation professionnelle
 
You've been framed
You've been framedYou've been framed
You've been framed
 
How to Create a Winning Recruitment Strategy
How to Create a Winning Recruitment StrategyHow to Create a Winning Recruitment Strategy
How to Create a Winning Recruitment Strategy
 
ćœŸćŁŒćŸźç”Ÿç‰©ă«ă‚ˆă‚‹ăƒă‚€ă‚Șă‚Żăƒ­ăƒƒă‚źăƒłă‚°ăźæž©ćșŠäŸć­˜æ€§ă«ă€ă„お
ćœŸćŁŒćŸźç”Ÿç‰©ă«ă‚ˆă‚‹ăƒă‚€ă‚Șă‚Żăƒ­ăƒƒă‚źăƒłă‚°ăźæž©ćșŠäŸć­˜æ€§ă«ă€ă„お�ćœŸćŁŒćŸźç”Ÿç‰©ă«ă‚ˆă‚‹ăƒă‚€ă‚Șă‚Żăƒ­ăƒƒă‚źăƒłă‚°ăźæž©ćșŠäŸć­˜æ€§ă«ă€ă„お�
ćœŸćŁŒćŸźç”Ÿç‰©ă«ă‚ˆă‚‹ăƒă‚€ă‚Șă‚Żăƒ­ăƒƒă‚źăƒłă‚°ăźæž©ćșŠäŸć­˜æ€§ă«ă€ă„お
 
noreply@utah.gov_20160224_110554-2
noreply@utah.gov_20160224_110554-2noreply@utah.gov_20160224_110554-2
noreply@utah.gov_20160224_110554-2
 
The stone age
The stone ageThe stone age
The stone age
 
PhD_dissertation_Niels_Erik_Olesen
PhD_dissertation_Niels_Erik_OlesenPhD_dissertation_Niels_Erik_Olesen
PhD_dissertation_Niels_Erik_Olesen
 

Ähnlich wie Sas-training-in-mumbai

Introduction to-sas-1211594349119006-8
Introduction to-sas-1211594349119006-8Introduction to-sas-1211594349119006-8
Introduction to-sas-1211594349119006-8thotakoti
 
Introduction To Sas
Introduction To SasIntroduction To Sas
Introduction To Sashalasti
 
SAS cheat sheet
SAS cheat sheetSAS cheat sheet
SAS cheat sheetAli Ajouz
 
IntroducciĂłn al Software AnalĂ­tico SAS
IntroducciĂłn al Software AnalĂ­tico SASIntroducciĂłn al Software AnalĂ­tico SAS
IntroducciĂłn al Software AnalĂ­tico SASJorge RodrĂ­guez M.
 
I need help with Applied Statistics and the SAS Programming Language.pdf
I need help with Applied Statistics and the SAS Programming Language.pdfI need help with Applied Statistics and the SAS Programming Language.pdf
I need help with Applied Statistics and the SAS Programming Language.pdfMadansilks
 
Data Match Merging in SAS
Data Match Merging in SASData Match Merging in SAS
Data Match Merging in SASguest2160992
 
SAS Programming Notes
SAS Programming NotesSAS Programming Notes
SAS Programming NotesGnana Murthy A
 
Basics Of SAS Programming Language
Basics Of SAS Programming LanguageBasics Of SAS Programming Language
Basics Of SAS Programming Languageguest2160992
 
Understanding SAS Data Step Processing
Understanding SAS Data Step ProcessingUnderstanding SAS Data Step Processing
Understanding SAS Data Step Processingguest2160992
 
Draft sas and r and sas (may, 2018 asa meeting)
Draft sas and r and sas (may, 2018 asa meeting)Draft sas and r and sas (may, 2018 asa meeting)
Draft sas and r and sas (may, 2018 asa meeting)Barry DeCicco
 
R stata
R stataR stata
R stataAjay Ohri
 

Ähnlich wie Sas-training-in-mumbai (20)

Introduction to-sas-1211594349119006-8
Introduction to-sas-1211594349119006-8Introduction to-sas-1211594349119006-8
Introduction to-sas-1211594349119006-8
 
SAS - Training
SAS - Training SAS - Training
SAS - Training
 
Introduction To Sas
Introduction To SasIntroduction To Sas
Introduction To Sas
 
SAS Commands
SAS CommandsSAS Commands
SAS Commands
 
Sas classes in mumbai
Sas classes in mumbaiSas classes in mumbai
Sas classes in mumbai
 
SAS cheat sheet
SAS cheat sheetSAS cheat sheet
SAS cheat sheet
 
IntroducciĂłn al Software AnalĂ­tico SAS
IntroducciĂłn al Software AnalĂ­tico SASIntroducciĂłn al Software AnalĂ­tico SAS
IntroducciĂłn al Software AnalĂ­tico SAS
 
I need help with Applied Statistics and the SAS Programming Language.pdf
I need help with Applied Statistics and the SAS Programming Language.pdfI need help with Applied Statistics and the SAS Programming Language.pdf
I need help with Applied Statistics and the SAS Programming Language.pdf
 
Data Match Merging in SAS
Data Match Merging in SASData Match Merging in SAS
Data Match Merging in SAS
 
SAS Programming Notes
SAS Programming NotesSAS Programming Notes
SAS Programming Notes
 
Basics Of SAS Programming Language
Basics Of SAS Programming LanguageBasics Of SAS Programming Language
Basics Of SAS Programming Language
 
SAS - overview of SAS
SAS - overview of SASSAS - overview of SAS
SAS - overview of SAS
 
Sas summary guide
Sas summary guideSas summary guide
Sas summary guide
 
SAS Online Training by Real Time Working Professionals in USA,UK,India,Middle...
SAS Online Training by Real Time Working Professionals in USA,UK,India,Middle...SAS Online Training by Real Time Working Professionals in USA,UK,India,Middle...
SAS Online Training by Real Time Working Professionals in USA,UK,India,Middle...
 
Understanding SAS Data Step Processing
Understanding SAS Data Step ProcessingUnderstanding SAS Data Step Processing
Understanding SAS Data Step Processing
 
Draft sas and r and sas (may, 2018 asa meeting)
Draft sas and r and sas (may, 2018 asa meeting)Draft sas and r and sas (may, 2018 asa meeting)
Draft sas and r and sas (may, 2018 asa meeting)
 
Aggregate.pptx
Aggregate.pptxAggregate.pptx
Aggregate.pptx
 
R stata
R stataR stata
R stata
 
Sas
SasSas
Sas
 
07.bootstrapping
07.bootstrapping07.bootstrapping
07.bootstrapping
 

Mehr von Unmesh Baile

java-corporate-training-institute-in-mumbai
java-corporate-training-institute-in-mumbaijava-corporate-training-institute-in-mumbai
java-corporate-training-institute-in-mumbaiUnmesh Baile
 
Php mysql training-in-mumbai
Php mysql training-in-mumbaiPhp mysql training-in-mumbai
Php mysql training-in-mumbaiUnmesh Baile
 
Java course-in-mumbai
Java course-in-mumbaiJava course-in-mumbai
Java course-in-mumbaiUnmesh Baile
 
Robotics corporate-training-in-mumbai
Robotics corporate-training-in-mumbaiRobotics corporate-training-in-mumbai
Robotics corporate-training-in-mumbaiUnmesh Baile
 
Corporate-training-for-msbi-course-in-mumbai
Corporate-training-for-msbi-course-in-mumbaiCorporate-training-for-msbi-course-in-mumbai
Corporate-training-for-msbi-course-in-mumbaiUnmesh Baile
 
Linux corporate-training-in-mumbai
Linux corporate-training-in-mumbaiLinux corporate-training-in-mumbai
Linux corporate-training-in-mumbaiUnmesh Baile
 
Professional dataware-housing-training-in-mumbai
Professional dataware-housing-training-in-mumbaiProfessional dataware-housing-training-in-mumbai
Professional dataware-housing-training-in-mumbaiUnmesh Baile
 
Best-embedded-corporate-training-in-mumbai
Best-embedded-corporate-training-in-mumbaiBest-embedded-corporate-training-in-mumbai
Best-embedded-corporate-training-in-mumbaiUnmesh Baile
 
Selenium-corporate-training-in-mumbai
Selenium-corporate-training-in-mumbaiSelenium-corporate-training-in-mumbai
Selenium-corporate-training-in-mumbaiUnmesh Baile
 
Weblogic-clustering-failover-and-load-balancing-training
Weblogic-clustering-failover-and-load-balancing-trainingWeblogic-clustering-failover-and-load-balancing-training
Weblogic-clustering-failover-and-load-balancing-trainingUnmesh Baile
 
Advance-excel-professional-trainer-in-mumbai
Advance-excel-professional-trainer-in-mumbaiAdvance-excel-professional-trainer-in-mumbai
Advance-excel-professional-trainer-in-mumbaiUnmesh Baile
 
Best corporate-r-programming-training-in-mumbai
Best corporate-r-programming-training-in-mumbaiBest corporate-r-programming-training-in-mumbai
Best corporate-r-programming-training-in-mumbaiUnmesh Baile
 
R-programming-training-in-mumbai
R-programming-training-in-mumbaiR-programming-training-in-mumbai
R-programming-training-in-mumbaiUnmesh Baile
 
Corporate-data-warehousing-training
Corporate-data-warehousing-trainingCorporate-data-warehousing-training
Corporate-data-warehousing-trainingUnmesh Baile
 
Microsoft-business-intelligence-training-in-mumbai
Microsoft-business-intelligence-training-in-mumbaiMicrosoft-business-intelligence-training-in-mumbai
Microsoft-business-intelligence-training-in-mumbaiUnmesh Baile
 
Linux-training-for-beginners-in-mumbai
Linux-training-for-beginners-in-mumbaiLinux-training-for-beginners-in-mumbai
Linux-training-for-beginners-in-mumbaiUnmesh Baile
 
Corporate-informatica-training-in-mumbai
Corporate-informatica-training-in-mumbaiCorporate-informatica-training-in-mumbai
Corporate-informatica-training-in-mumbaiUnmesh Baile
 
Corporate-informatica-training-in-mumbai
Corporate-informatica-training-in-mumbaiCorporate-informatica-training-in-mumbai
Corporate-informatica-training-in-mumbaiUnmesh Baile
 
Best-robotics-training-in-mumbai
Best-robotics-training-in-mumbaiBest-robotics-training-in-mumbai
Best-robotics-training-in-mumbaiUnmesh Baile
 
Best-embedded-system-classes-in-mumbai
Best-embedded-system-classes-in-mumbaiBest-embedded-system-classes-in-mumbai
Best-embedded-system-classes-in-mumbaiUnmesh Baile
 

Mehr von Unmesh Baile (20)

java-corporate-training-institute-in-mumbai
java-corporate-training-institute-in-mumbaijava-corporate-training-institute-in-mumbai
java-corporate-training-institute-in-mumbai
 
Php mysql training-in-mumbai
Php mysql training-in-mumbaiPhp mysql training-in-mumbai
Php mysql training-in-mumbai
 
Java course-in-mumbai
Java course-in-mumbaiJava course-in-mumbai
Java course-in-mumbai
 
Robotics corporate-training-in-mumbai
Robotics corporate-training-in-mumbaiRobotics corporate-training-in-mumbai
Robotics corporate-training-in-mumbai
 
Corporate-training-for-msbi-course-in-mumbai
Corporate-training-for-msbi-course-in-mumbaiCorporate-training-for-msbi-course-in-mumbai
Corporate-training-for-msbi-course-in-mumbai
 
Linux corporate-training-in-mumbai
Linux corporate-training-in-mumbaiLinux corporate-training-in-mumbai
Linux corporate-training-in-mumbai
 
Professional dataware-housing-training-in-mumbai
Professional dataware-housing-training-in-mumbaiProfessional dataware-housing-training-in-mumbai
Professional dataware-housing-training-in-mumbai
 
Best-embedded-corporate-training-in-mumbai
Best-embedded-corporate-training-in-mumbaiBest-embedded-corporate-training-in-mumbai
Best-embedded-corporate-training-in-mumbai
 
Selenium-corporate-training-in-mumbai
Selenium-corporate-training-in-mumbaiSelenium-corporate-training-in-mumbai
Selenium-corporate-training-in-mumbai
 
Weblogic-clustering-failover-and-load-balancing-training
Weblogic-clustering-failover-and-load-balancing-trainingWeblogic-clustering-failover-and-load-balancing-training
Weblogic-clustering-failover-and-load-balancing-training
 
Advance-excel-professional-trainer-in-mumbai
Advance-excel-professional-trainer-in-mumbaiAdvance-excel-professional-trainer-in-mumbai
Advance-excel-professional-trainer-in-mumbai
 
Best corporate-r-programming-training-in-mumbai
Best corporate-r-programming-training-in-mumbaiBest corporate-r-programming-training-in-mumbai
Best corporate-r-programming-training-in-mumbai
 
R-programming-training-in-mumbai
R-programming-training-in-mumbaiR-programming-training-in-mumbai
R-programming-training-in-mumbai
 
Corporate-data-warehousing-training
Corporate-data-warehousing-trainingCorporate-data-warehousing-training
Corporate-data-warehousing-training
 
Microsoft-business-intelligence-training-in-mumbai
Microsoft-business-intelligence-training-in-mumbaiMicrosoft-business-intelligence-training-in-mumbai
Microsoft-business-intelligence-training-in-mumbai
 
Linux-training-for-beginners-in-mumbai
Linux-training-for-beginners-in-mumbaiLinux-training-for-beginners-in-mumbai
Linux-training-for-beginners-in-mumbai
 
Corporate-informatica-training-in-mumbai
Corporate-informatica-training-in-mumbaiCorporate-informatica-training-in-mumbai
Corporate-informatica-training-in-mumbai
 
Corporate-informatica-training-in-mumbai
Corporate-informatica-training-in-mumbaiCorporate-informatica-training-in-mumbai
Corporate-informatica-training-in-mumbai
 
Best-robotics-training-in-mumbai
Best-robotics-training-in-mumbaiBest-robotics-training-in-mumbai
Best-robotics-training-in-mumbai
 
Best-embedded-system-classes-in-mumbai
Best-embedded-system-classes-in-mumbaiBest-embedded-system-classes-in-mumbai
Best-embedded-system-classes-in-mumbai
 

KĂŒrzlich hochgeladen

Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 

KĂŒrzlich hochgeladen (20)

Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 

Sas-training-in-mumbai

  • 1.
  • 2. *Built-in functions *Data manipulation *Updated often to include new applications *Different packages complete certain tasks more easily than others *Packages we will introduce *SAS *R (S-plus)
  • 3. *Easy to input and output data sets *Preferred for data manipulation *“proc” used to complete analyses with built-in functions *Macros used to build your own functions
  • 4. *SAS Structure *Efficient SAS Code for Large Files *SAS Macro Facility
  • 5. *Missing semicolon *Misspelling *Unmatched quotes/comments *Mixed proc and data statement *Using wrong options
  • 6. *Data Step: input, create, manipulate or output data *Always start with a data line *Ex. data one; *Procedure Step: complete an operation on data *Always start with a proc line *Ex. proc contents;
  • 7. *System options are global instructions that affect the entire SAS session and control the way SAS performs operations. SAS system options differ from SAS data set options and statement options in that once you invoke a system option, it remains in effect for all subsequent data and proc steps in a SAS job, unless you specify them. *In order to view which options are available and in effect for your SAS session, use proc options; run;
  • 8. * center controls whether SAS procedure output is centered. By default, output is centered. To specify not centered, use nocenter. * date prints the date and time to the log and output window. By default, the date and time is printed. To suppress the printing of the date, use nodate. * label allows SAS procedures to use labels with variables. By default, labels are permitted. To suppress the printing of labels, use nolabel. * notes controls whether notes are printed to the SAS log. By default, notes are printed. To suppress the printing of notes, use nonotes. * number controls whether page numbers are printed. By default, page numbers are printed. To suppress the printing of page numbers, use nonumber. * linesize= specifies the line size (printer line width) for the SAS log and the SAS procedure output file used by the data step and procedures. * pagesize= specifies # of lines that can be printed per page of SAS output. * missing= specifies the character to be printed for missing numeric values. * formchar= specifies the the list of graphics characters that define table boundaries. Example: OPTIONS NOCENTER NODATE NONOTES LINESIZE=80 MISSING=. ;
  • 9. SAS data set control options specify how SAS data sets are input, processed, and output. *firstobs= causes SAS to begin reading at a specified observation in a data set. The default is firstobs=1. *obs= specifies the last observation from a data set or the last record from a raw data file that SAS is to read. To return to using all observations in a data set use obs=all *replace specifies whether permanently stored SAS data sets are to be replaced. By default, the SAS system will over-write existing SAS data sets if the SAS data set is re-specified in a data step. To suppress this option, use noreplace. Example: *OPTIONS OBS=100 NOREPLACE;
  • 10. Error handling options specify how the SAS System reports on and recovers from error conditions. * errors= controls the maximum number of observations for which complete error messages are printed. The default maximum number of complete error messages is errors=20 * fmterr controls whether the SAS System generates an error message when the system cannot find a format to associate with a variable. SAS will generate an ERROR message for every unknown format it encounters and will terminate the SAS job without running any following data and proc steps. To read a SAS system data set without requiring a SAS format library, use nofmterr. Example: OPTIONS ERRORS=100 NOFMTERR;
  • 11. *data statement names the data set you are making *Can use any of the following commands to input data *infile Identifies an external raw data file to read with an INPUT statement *input Lists variable names in the input file *cards Indicates internal data *set Reads a SAS data set
  • 12. *To look at the variables in a data set, use *proc contents data=dataset; run; *To look at the actual data in the data set, *proc print data=dataset (obs=num); var varlist; run;
  • 13. data treat; infile “g:sharedBIO271treat.dat”; input id bpa bpb chola cholb; run; proc print data = treat (obs=10); run; proc contents data=treat; run;
  • 14. *blank space (default) *DELIMITER= option specifies that the INPUT statement use a character other than a blank as a delimiter for data values that are read with list input
  • 15. Sometimes you want to input the data yourself Try the following data step: data nums; infile datalines dsd delimiter=‘&'; input X Y Z; datalines; 1&2&3 4&5&6 7&8&9 ; Notice that there are no semicolons until the end of the datalines
  • 16. *Another way to input data using the keyboard (and often a last resort if having problems input the data) is cards *Similar to datalines *data score; input test1 test2 test3; cards; 91 87 95 97 . 92 . 89 99 ; run;
  • 17. *Sometimes your data will have characters *Example: data fam; input name$ age; cards; Brian 27 Andrew 29 Kate 24 run; proc print data=fam; run; *What is different and what happens if you don’t have the dollar sign?
  • 18. *The final way we will show to input data is if you have a SAS data set , you can use a libname command libname summer "g:sharedbio271"; data treat2; set summer.treat2; run; *Look at the data set with proc print
  • 19. Variable label: Use the label statement in the data step to assign labels to the variables.  You could also assign labels to variables in proc steps, but then the labels only exist for that step.  When labels are assigned in the data step they are available for all procedures that use that data set. Example: DATA labtreat; SET treat; LABEL id=“patient id” bpa =“BP on treatment A" bpb =“BP on treatment B" cholA=“Cholesterol on treatment A” cholB=“Cholesterol on treatment B"; RUN; PROC CONTENTS DATA=labtreat; RUN;
  • 20. *Make a data set with the following data calling it redsox *8, 58, 491, 163 7, 50, 469, 133 31, 107, 458, 136 33, 111, 410, 117 *Label the variables HR, RBI, AB, HITS *Use proc print to ensure that you have input the data correctly
  • 21. *One of the best parts of SAS is the ability to complete data manipulations *There are four major types of manipulations *Subset of data *Drop / keep variables *Drop observations *Concatenate data files *Merge data files *Create new variables
  • 22. *SAS easily allows you to make a data set with a subset of the variables *What do you think happens with this code? DATA redsox2; SET redsox; KEEP ba rbi; RUN; *How do you think you could use drop to do the same thing?
  • 23. *We can also get a subset of the observations *Read in treat2 from the g: drive *This is helpful when we want to remove missing data DATA notreat2; SET treat2; IF cholA ^= . ; RUN;
  • 24. *SAS allows us to combine dataset by adding more observations, using data tottreat; set treat treat2; run; *Check that it worked using proc print *If a variable is called by a different name in each dataset, you must use: data momdad; set dads(RENAME=(dadinc=inc)) moms(RENAME=(mominc=inc)); run;
  • 25. *SAS also allows us to add more variables by merging data files *The data set demo gives demographic information about the patients in treat *Read in demo *Now, use this code to combine the information data extratreat; merge treat demo; by id; run; *Note: the data in each data set must be sorted to use this code
  • 26. *We can make new variables in a data step *Let’s make a new variable in the redsox data set by finding batting average and a variable for hr30 data redsox2; set redsox; ba=hits/ab; if hr>=30 then hr30=1 else hr30=0; run;
  • 27. *Make a new data set called redsox3 using the following data and combine it with redsox 7, 51, 378, 113 4, 41, 367, 99 20, 58, 361, 109 *Make a new variable in redsox3 that equals 1 if rbi is more than 100 and 0 if rib is less than or equal to 100
  • 28. *file: Specifies the current output file for PUT statements *put: Writes lines to the SAS log, to the SAS procedure output file, or to an external file that is specified in the most recent FILE statement. Example: data _null_; set redsox; file ‘p:redsox.csv' delimiter=',' dsd; put hr rbi ab hits; run;
  • 29. *The INFILE statement specifies the input file for any INPUT statements in the DATA step. The FILE statement specifies the output file for any PUT statements in the DATA step. *Both the FILE and INFILE statements allow you to use options that provide SAS with additional information about the external file being used. *An INFILE statement usually identifies data from an external file. A DATALINES statement indicates that data follow in the job stream. You can use the INFILE statement with the file specification DATALINES to take advantage of certain data- reading options that effect how the INPUT statement reads in-stream data.
  • 30. *Missing values in SAS are shown by . *As a general rule, SAS procedures that perform computations handle missing data by omitting the missing values, including proc means, proc freq, proc corr, and proc reg *Check SAS web page for more information
  • 31. * SAS treats a missing value as the smallest possible value (e.g., negative infinity) in logical statements. data times6; set times ; if (var1 <= 1.5) then varc1 = 0; else varc1 = 1 ; run ; Output: Obs id var1 varc1 1 1 1.5 0 2 2 . 0 3 3 2.1 1
  • 32. *proc print and proc contents- we have seen these *proc sort *proc means *proc univariate *proc plot
  • 33. *var: lists the variables you want to perform the proc on *by: breaks the data into groups *where: limits the data set to a specific group of observations *output: allows you to output the results into a data set
  • 34. *We can use proc sort to sort data *The code to complete this is proc sort data=extratreat ; by gender ; run ; proc sort data=extratreat out=extreat ; by gender ; run ; proc sort data=extratreat out=extreat2; by descending gender ; run ; proc sort data=extratreat out=extreat3 noduplicates; by gender ; run ;
  • 35. *The basic form of proc means is *proc means data=extratreat; var ______; by _______; where _______; output out=stat mean=bpamean cholamean; run; *The basic form of proc univariate is the same, but much more information is given *It is helpful to use the output window to get the info you need
  • 36. *To make different plots in SAS, you use proc plot *Scatterplot *proc plot data=redsox; plot rbi*ab; run; *You can also make plots using *proc univariate data=redsox plot; var rbi; run;
  • 37. *Find the mean blood pressure on treatment A in women *Make a scatterplot of blood pressure on treatment B versus blood pressure on treatment A in men *Find the median number of home runs hit by the Red Sox
  • 38. Macros are the SAS method of making functions *Avoid repetitious SAS code *Create generalizable and flexible SAS code *Pass information from one part of a SAS job to another *Conditionally execute data steps and PROCs
  • 39. *SAS macro variable *SAS Macro *There are many discussions of macro variables on the web; one good one is given here: http://www2.sas.com/proceedings/sugi30/130 -30.pdf
  • 40. Two delimiters will trigger the macro processor in a SAS program. *&macro-variable This refers to a macro variable. The current value of the variable will replace &macro-variable; *%macro-name This refers to a macro, which consists of one or more complete SAS statements, or even whole data or proc steps.
  • 41. *SAS Macro variables can be defined and used anywhere in a SAS program, except in data lines. They are independent of a SAS dataset.
  • 42. %LET: assign text to a macro variable; %LET macrovar = value 1. Macrovar is the name of a global macro variable; 2. Value is macro variable value, which is a character string without quotation or macro expression. %PUT: display macro variable values as text in the SAS log; %put _all_, %put _user_ &macrovar: Substitute the value of a macro variable in a program;
  • 43. *Here is an example of how to use a macro variable: *%let int=treat; proc means data=&int; run; *Now we can rerun the code again simply changing the value of the macro variable, without altering the rest of the code. *%let int=redsox; proc means data=&int; run; *This is extremely helpful when you have a large amount of code you want to reference
  • 44. *Definition: %MACRO macro-name (parm1, parm2,
parmk); Macro definition (&parm1,&parm2,
&parmk) %MEND macro-name; *Application: %macro-name(values of parm1, parm2,
,parmk);
  • 45. Import Excel to SAS Datasets by a Macro %macro excelsas(in, out); proc import out=work.&out datafile=“g:sharedbio271&in" dbms=excel replace; getnames=yes; run; %mend excelsas; % excelsas(practice.xls,test) Use proc print to ensure that you have the data input properly
  • 46. %let int=treat; %let dop=%str(id bpa); %macro happy; data new; set &int; drop &dop; run; proc means data=new; run; %mend happy; %happy