Online File

How to use this page


Rick Aster: Professional SAS Programming Shortcuts: Contents

Chapter 46
Program
Converting a BY group to an observation


data main.int1;
   array dirn{12} $ 3 _temporary_ 
       ('N' 'N-E' 'N-W' 'S' 'S-E' 'S-W' 'E' 'E-N' 'E-S' 'W' 'W-N' 'W-S');
   array dcount{12} n n_e n_w s s_e s_w e e_n e_s w w_n w_s;
   retain dcount;
   set main.int2;
   by when;
   if first.when then do i = 1 to 12;
      dcount{i} = .;
      end;
   do i = 1 to 12;
      if dir = dirn{i} then dcount{i} = count;
      end;
   if last.when then output;
run;

 O /\

Global
Statements

RICK ASTER

SAS

BOOKS

Tech | Dictionary

Download | Rastinate

Rick Aster

Professional SAS Programming Shortcuts

Contents/Online Files

Corrections

Catalog Page