Search the site...

SASCRUNCH TRAINING
  • Home
  • Member's Area
  • How to Start
  • SAS Interface
  • Creating a Data Set
  • Practical SAS Training Course
  • SAS Certified Specialist Training Program
  • Proc SQL Course
  • Introduction to Time Series Analysis
  • SAS Project Training Course
  • Full Training / Membership
  • Sign up
  • About us
  • Contact us
  • Home
  • Member's Area
  • How to Start
  • SAS Interface
  • Creating a Data Set
  • Practical SAS Training Course
  • SAS Certified Specialist Training Program
  • Proc SQL Course
  • Introduction to Time Series Analysis
  • SAS Project Training Course
  • Full Training / Membership
  • Sign up
  • About us
  • Contact us
Sentry Page Protection
Please Wait...
Proc Format [1-2]
SAS Base Exam


Proc Print
The PRINT procedure prints the data portion of a data set.

Example

Copy and run the CARRIER data set from the yellow box below. 
Picture

The CARRIER data set contains 6 variables.
  • Order
  • Date
  • Length
  • Width
  • Height
  • Weight

Let's run the PRINT procedure on this data set.

Example

Proc Print Data=Order;
Var Order Date Weight;
Run;
Picture

The PRINT procedure has a VAR statement that specifies the variables to be printed.

The variables ORDER, DATE and WEIGHT are printed on the output:
Picture


Variable Format

You can add a format statement to the PRINT procedure to change the display of the variable values. 

Example

The variable WEIGHT is currently displayed with no decimal place.
Picture

Now, let's add a format statement to the PRINT procedure and change the display to 2 decimal places.

Example

Proc Print Data=Carrier;
Var Order Date Weight;
Format Weight 6.2;
Run;
Picture

​The WEIGHT variable is now displayed with 2 decimal places.
Picture

[Note: the concept of format will be explained in details in later sections.]

Exercise
Print the data portion of the CARRIER data set. Display only the following variables:
  • ORDER
  • HEIGHT
  • LENGTH

Display both the HEIGHT and LENGTH variables in 1 decimal places.
Next

Need some help?
Get Hint
Get Solution
Fill out my online form.

Home 
​
1 2 3 4 5 6 7
Summary | Final Test | Coding Exercises
Coding Project

Already a member? Go to member's area.