Exampler.org SAS PYTHON HTML
SAS Introduction
SAS Abs
SAS Anydigit
SAS ASC
SAS Case Stmnt.
SAS Ceiling
SAS Change type
SAS Char
SAS CMISS
SAS Coalesc
SAS Coalescec
SAS Concatenate
SAS Constant
SAS Create Table
SAS DateTime
SAS Day
SAS Find
SAS Floor
SAS HMS
SAS Holiday
SAS HOUR
SAS Import
SAS Informats
SAS Inobs
SAS Input Stmt.
SAS Int
SAS INTNX
SAS Length
SAS Libname
SAS Loops
SAS Minute
SAS Month
SAS MDY
SAS NMISS
SAS Notdigit
SAS Lowercase
SAS Outobs
SAS Put Stmt.
SAS Rename
SAS Round
SAS Scan
SAS Substr
SAS Sum
SAS STNAME
SAS STNAMEL
SAS Time
SAS Trunc
SAS Uppercase
SAS Week
SAS Year
SAS Financial Functions
SAS Compound

SAS NotDigit Function Example

What is it?

Syntax:

  • NotDigit('String');

SAS Notdigit Function:


 SAS NotDigit Example:




Data work.my_data_file;

    Result_1 = Notdigit('123456789A');
    Result_2 = Notdigit('A123456789');
    Result_3 = Notdigit('.001 ABCDE');

Run;





What's happening in the script above?

  • The NotDigit function is searching the string for the first instance of anything that isn't a number.
  • The function only returns the first instance
  • Additionally, spaces are counted as a position


NotDigit Function Examples:

Variable Input Output Description
Result_1 123456789A 10 Returns the position count of the Character A
Result_2 A123456789 1 Also returns the position count of the Character A
Result_3 .001 ABCDE 1 Returns the position count the period

See also; AnyDigit Function



Connect via LinkedIn

Kevin Regan

Have an article, idea, found a typo, want to contribute? Shoot me an email Here


Below are links to some Udemy Data Science Courses. I've been using Udemy for a number of years now, and I've found their courses super helpful, maybe you will also.