backnextLearning Path
   


Introduction

When planning modifications to SAS data sets, be sure to examine the many SAS functions that are available. SAS functions are pre-written expressions that provide programming shortcuts for many calculations and manipulations of data.

This lesson teaches you how to use a variety of functions, such as those shown in the table below. You learn to convert data from one data type to another, to work with SAS date and time values, and to manipulate the values of character variables.



Function Description Form Sample Value
YEAR Extracts the year value from a SAS date value. YEAR(date)
2002
QTR Extracts the quarter value from a SAS date value. QTR(date)
1
MONTH Extracts the month value from a SAS date value. MONTH(date)
12
DAY Extracts the day value from a SAS date value. DAY(date)
5



Time to Complete

This lesson contains pages and takes approximately 2 hours to complete.



Objectives

In this lesson, you learn to

  • convert character data to numeric data
  • convert numeric data to character data
  • create SAS date values
  • extract the month, year, and interval from a SAS date value
  • perform calculations with date and datetime values and time intervals
  • extract, edit, and search the values of character variables
  • replace or remove all occurrences of a particular word within a character string.

Prerequisites

Before taking this lesson, you should complete the following lessons:

  • .

  Copyright © 2003 SAS Institute Inc., Cary, NC, USA. All rights reserved.
Terms of Use & Legal Information | Privacy Statement
backnext