O'Reilly logo

Learning SAS by Example by Ron Cody

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 2. Writing Your First SAS Program

2.1

A Simple Program to Read Raw Data and Produce a Report

11

2.2

Enhancing the Program

18

2.3

More on Comment Statements

20

2.4

How SAS Works (a Look Inside the “Black Box”)

22

2.5

Problems

25

A Simple Program to Read Raw Data and Produce a Report

Let’s start out with a simple program to read data from a text file and produce some basic summaries. Then we’ll go on to enhance the program.

The task: you have data values in a text file. These values represent Gender (M or F), Age, Height, and Weight. Each data value is separated from the next by one or more blanks. You want to produce two reports: one showing the frequencies for Gender (how many Ms and Fs); the other showing the average age, height, and weight for all the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required