Chapter Contents

Previous

Next
SAS Companion for the CMS Environment

Estimating the Size of a SAS Data Set

To obtain a rough estimate of how much space you need for a disk-format SAS data set that was created by a V6, V7, or V8 engine, follow these steps:

  1. Use PROC CONTENTS to determine the size of each observation. (See Using the CONTENTS Procedure to Determine Observation Length.)

  2. Multiply the size of each observation by the number of observations.

  3. For V6 engines, add 10% for overhead. For V7 and V8 engines, add 1K (or 1,024 bytes) for overhead.

  4. The result of this calculation will be in bytes. You can convert this value to blocks based on the capacity of your data storage device.

Note:   This procedure is valid only for uncompressed native SAS data files that were created with a V6, V7, or V8 engine.  [cautionend]
Here is an example of a calculation for a V6 system that assumes a 2048-byte page size.

  1. PROC CONTENTS reveals an observation size of 484 blocks.

  2. 484 blocks-per-observation * 16 observations = 7744 bytes. Round up 7744 to the next multiple of 2048, which is 10240 bytes.

  3. (10240 * 1.10 ) + 10240 = 11264 bytes.

  4. 11264/4096 = 2.75, which rounds up to 3 blocks

Here is an example of a calculation for a V8 system.

This example assumes an 8192-byte page size.

  1. PROC CONTENTS reveals an observation size of 484 blocks.

  2. 484 blocks-per-observation * 16 observations = 7744 bytes. Round up 7744 to the next multiple of 8192, which is 16384 bytes.

  3. 16384 + 1024 = 17408 bytes.

  4. 17408/4096 = 4.25 , which rounds up to 5 blocks.


Using the CONTENTS Procedure to Determine Observation Length

To determine the length of each observation in a Version 8 SAS data set, create a SAS data set that contains one observation. Then run the CONTENTS procedure to determine the observation length. The CONTENTS procedure displays engine and host-dependent information, including page size, as well as the number of observations per page for uncompressed SAS data sets. For example, the following input produces a SAS data set plus PROC CONTENTS output:

data oranges;
   input variety $ flavor texture looks;
   cards;
navel 9 8 6
;
proc contents data=oranges;
run;

The output is shown in CONTENTS Procedure Output .

CONTENTS Procedure Output
                                  The SAS System                              1
                                CONTENTS PROCEDURE

   Data Set Name: WORK.ORANGES                        Observations:         1
   Member Type:   DATA                                Variables:            4
   Engine:        V8                                  Indexes:              0
   Created:       14:27 Monday, June 1, 1999          Observation Length:   32
   Last Modified: 14:27 Monday, June 1, 1999          Deleted Observations: 0
   Protection:                                        Compressed:           NO
   Data Set Type:                                     Sorted:               NO
   Label:

                   -----Engine/Host Dependent Information-----

         Data Set Page Size:         8192
         Number of Data Set Pages:   1
         First Data Page:            1
         Max Obs per Page:           254
         Obs in First Data Page:     1
         Number of Data Set Repairs: 0
         File Name:                  ORANGES WORK A1
         Release Created             7.00.00
         Host Created                VM/ESA
         Owner Name                  USERID
              -----Alphabetic List of Variables and Attributes-----

                       #    Variable    Type    Len    Pos
                       -----------------------------------
                       2    FLAVOR      Num       8      8
                       4    LOOKS       Num       8     24
                       3    TEXTURE     Num       8     16
                       1    VARIETY     Char      8      0

The only values that you need to pay attention to are Observation Length and Compressed:

Observation Length
is the record size in bytes.

Compressed
has the value NO if records are not compressed; it has the value YES if records are compressed. (If the records are compressed, do not use the procedure given in Estimating the Size of a SAS Data Set .)


Chapter Contents

Previous

Next

Top of Page

Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.