SAS OnlineTutor HomeFAQ PageSuggested Learning PathsContents+Search||next

Reading Variable-Length Records
Lesson Overview


Introduction

Some operating systems have different types of record formats for external files. An external file that has a fixed-length record format has an end-of-record marker after a predetermined number of columns. A typical record length is 80 columns.

fixed-length record format

Or, external files can have a variable-length record format where an end-of-record marker is placed after the last field.

variable-length record format

When records contain fields of varying widths or a varying number of fields, then variable-length records can use space more efficiently. This lesson shows you how to determine the length of each record and read variable-length records.

This lesson contains 21 pages and takes approximately 30-45 minutes to complete.


Objectives

In this lesson, you learn how to

  • determine the length of each record
  • read character variables that have varying lengths.

You can also review how to

  • use a line-hold specifier to hold the current record
  • execute SAS statements based on a variable value
  • explicitly write an observation to a data set.


Prerequisites

Before taking this lesson, you should have completed the following lessons:

Getting Started with SAS Programming

Creating SAS Data Sets

Reading Various Types of Raw Data

||next


Copyright © 2002 SAS Institute Inc., Cary, NC, USA. All rights reserved.

Terms of Use & Legal Information | Privacy Statement