Skip to Content
SAS Essentials: Mastering SAS for Data Analytics, 2nd Edition
book

SAS Essentials: Mastering SAS for Data Analytics, 2nd Edition

by Alan C. Elliott, Wayne A. Woodward
August 2015
Beginner
520 pages
13h 7m
English
Wiley
Content preview from SAS Essentials: Mastering SAS for Data Analytics, 2nd Edition

APPENDIX D

QUICK REFERENCE

This appendix provides a series of brief descriptions of basic SAS® tasks. Most of the tasks are listed here without explanation, except for a reference to a chapter.

Ways to name a data set – can be used whenever a dataset is named:

DATA SOMEDATA;    * create working/temporary data set;
DATA “C:\SASDATA\SOMEDATA”; *create permanent data set
   in specified location;
LIBNAME MYSASLIB “C:\SASDATA”; * create a temporary SAS library;
DATA MYSASLIB.SOMEDATA;    * create permanent data set in MYSASLIB
   library;

Versions of the INPUT statement:

* freeform input;
INPUT ID $ GENDER $ SBP DBP WEIGHT;
* column numbers specify location of data;
INPUT ID 1-4 SEX $ 5-5 AGE 6-9;
* specify beginning column, name, informat.
INPUT @1 ID 4. @5 SEX $1. @10 BDATE DATE9.;

Read date using format specification (see format table, Appendix A):

DATA MYDATA;
INPUT @1 FNAME $11. @12 LNAME $12. @24 BDATE DATE9.;
DATALINES;
Bill       Smith       08JAN1952
;
RUN;

Ways to specify source of data or enter data set:

DATALINES;        * data are listed in the code following
   this statement;
INFILE filename;         * data are in an ASCII file on disk;
SET dataset;             * data are in a SAS data file;
PROC IMPORT;      * imports data from a non-SAS filetype;

Common ways to manipulate data within the DATA step (Chapters 47):

* Conditionally specify missing value; IF AGE LE 0 then AGE = .; IF SBP GE 140 THEN HIGHBP=1; ELSE HIGHBP=0; * If-Then-Else; IF GENDER="MALE"; * Subsetting if statement; * Define label for a variable name; LABEL ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

Hands-On SAS for Data Analysis

Hands-On SAS for Data Analysis

Harish Gulati
Practical Business Analytics Using SAS: A Hands-on Guide

Practical Business Analytics Using SAS: A Hands-on Guide

Venkat Reddy Konasani, Shailendra Kadre
Categorical Data Analysis Using SAS, Third Edition, 3rd Edition

Categorical Data Analysis Using SAS, Third Edition, 3rd Edition

Maura E. Stokes, Charles S. Davis, Gary G. Koch

Publisher Resources

ISBN: 9781119042167Purchase bookOther