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