Previous Page | Next Page

The DATASETS Procedure

Example 1: Removing All Labels and Formats in a Data Set


Procedure Features:

PROC CONTENTS

PROC DATASETS statement option:

MODIFY statement

ATTRIB

CONTENTS statement


The following example deletes all labels and formats within a data set.


Program

 Note about code
options ls=79 nodate nocenter;
title;
 Note about code
proc format;
   value clsfmt 1='Freshman' 2='Sophmore' 3='Junior' 4='Senior';
run;
 Note about code
data class;
   format z clsfmt.;
   label x='ID NUMBER'
      y='AGE'
      z='CLASS STATUS';
   input x y z;
datalines;
1 20 4
2 18 1
;
 Note about code
proc contents data=class;
run;

PROC CONTENTS with Labels and Format

The CONTENTS Procedure

Data Set Name        WORK.CLASS                        Observations          2
Member Type          DATA                              Variables             3
Engine               V9                                Indexes               0
Created              Friday, May 25, 2007 10:26:08 AM  Observation Length    24
Last Modified        Friday, May 25, 2007 10:26:08 AM  Deleted Observations  0
Protection                                             Compressed            NO
Data Set Type                                          Sorted                NO
Label
Data Representation  WINDOWS_32
Encoding             wlatin1  Western (Windows)


                       Engine/Host Dependent Information

Data Set Page Size          4096
Number of Data Set Pages    1
First Data Page             1
Max Obs per Page            168
Obs in First Data Page      2
Number of Data Set Repairs  0
File Name                   C:\DOCUME~1\mydir\LOCALS~1\Temp\SAS Temporary
                            Files\_TD3964\class.sas7bdat
Release Created             9.0201B0
Host Created                XP_PRO


      Alphabetic List of Variables and Attributes

#    Variable    Type    Len    Format     Label

2    x           Num       8               ID NUMBER
3    y           Num       8               AGE
1    z           Num       8    CLSFMT.    CLASS STATUS
 Note about code
proc datasets lib=work memtype=data;
   modify class; 
     attrib _all_ label=' '; 
     attrib _all_ format=;
run;
 Note about code
contents data=class;
run;
quit;

CONTENTS Statement without Labels and Format

The DATASETS Procedure

Data Set Name        WORK.CLASS                        Observations          2
Member Type          DATA                              Variables             3
Engine               V9                                Indexes               0
Created              Friday, May 25, 2007 10:26:08 AM  Observation Length    24
Last Modified        Friday, May 25, 2007 10:26:08 AM  Deleted Observations  0
Protection                                             Compressed            NO
Data Set Type                                          Sorted                NO
Label
Data Representation  WINDOWS_32
Encoding             wlatin1  Western (Windows)


                       Engine/Host Dependent Information

Data Set Page Size          4096
Number of Data Set Pages    1
First Data Page             1
Max Obs per Page            168
Obs in First Data Page      2
Number of Data Set Repairs  0
File Name                   C:\DOCUME~1\mydir\LOCALS~1\Temp\SAS Temporary
                            Files\_TD3964\class.sas7bdat
Release Created             9.0201B0
Host Created                XP_PRO


Alphabetic List of Variables and Attributes

#    Variable    Type    Len

2    x           Num       8
3    y           Num       8
1    z           Num       8

Previous Page | Next Page | Top of Page