Online File

How to use this page


Rick Aster: Professional SAS Programming Shortcuts: Contents

Chapter 27
Program
Remove duplicate characters


data _null_;
   chars = 'aeelmpx';

   do c = 2 to vlength(chars);
      if c > length(chars) then leave;
      do while (substr(chars, c - 1, 1) = substr(chars, c, 1));
         if c + 1 > vlength(chars) then substr(chars, c) = ' ';
         else substr(chars, c) = substr(chars, c + 1);
         if c > length(chars) then leave;
         end;
      end;
      
   put chars;
run;

 O /\

Global
Statements

RICK ASTER

SAS

BOOKS

Tech | Dictionary

Download | Rastinate

Rick Aster

Professional SAS Programming Shortcuts

Contents/Online Files

Corrections

Catalog Page