Online File

How to use this page


Rick Aster: Professional SAS Programming Shortcuts: Contents

Chapter 13
Program
Reading hierarchical data to create relational data


data
    tax.family (keep=order family)
    tax.genus (keep=family genus genusc)
    tax.species (keep=genus species speciesc)
    ;
   retain;
   length order family $ 24
       genus genusc species speciesc $ 32;
   infile magnolio truncover;
   input @1 recordtype $char1. @;
   select (recordtype);
      when ('O') do;
         input @3 order $char24.;
         family = '';
         genus = ''; genusc = '';
         species = ''; speciesc = '';
         end;
      when ('F') do;
         input @3 family $char24.;
         genus = ''; genusc = '';
         species = ''; speciesc = '';
         output tax.family;
         end;
      when ('G') do;
         input @3 genus $char24. @28 genusc $char24.;
         species = ''; speciesc = '';
         output tax.genus;
         end;
      when ('S') do;
         input @3 species $char24. @28 speciesc $char24.;
         output tax.species;
         end;
      otherwise ;
      end;
run;

 O /\

Global
Statements

RICK ASTER

SAS

BOOKS

Tech | Dictionary

Download | Rastinate

Rick Aster

Professional SAS Programming Shortcuts

Contents/Online Files

Corrections

Catalog Page