Online File

How to use this page


Rick Aster: Professional SAS Programming Shortcuts: Contents

Chapter 25
Program
Parsing chemical symbols (for SAS 8)


data _null_;
   compound = 'NaHCO3';
   rem = compound;
   array el{16} $ 6;
   do i = 1 to dim(el) while (rem ne '');
      ellen = indexc(substr(rem, 2), 'ABCDEFGHIJKLMNOPQRSTUVWXYZ');
      if ellen = 0 then ellen = length(rem);
      el{i} = substr(rem, 1, ellen);
      rem = substr(rem, ellen + 1);
      put el{i};
      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