# FUNCTIONS

SAS FUNCTIONS

Get Started. It's Free
FUNCTIONS

## 3. Numeric functions

### 3.1. int

3.1.1. with out decimal place 34.5=34

### 3.2. round

3.2.1. rounds nearest integer decimal value 34.54=35

### 3.3. ceil

3.3.1. round up highest integer value 25.5=26

### 3.4. floor

3.4.1. rounds up lowest integer value 25.25 = 25

### 3.5. abs

3.5.1. absolute value convert +ve to -ve & -ve to +ve

### 3.6. fact

3.6.1. returns factorials 5 factorial=120

### 3.7. log

3.7.1. returns loge base vaalues

### 3.8. lag

3.8.1. get the values from previous variable

### 3.9. log10

3.9.1. returns log10 values

### 3.10. mod

3.10.1. returns remainder

## 4. Character Functions

### 4.1. SUBSTR

4.1.1. data fd; x='i will stir and bash up'; y=substr(x,8,4); run;

### 4.2. SCAN

4.2.1. data ff; x='i -will - stir - and - bash up'; y=scan(x,3,'-'); run;

### 4.3. COMPRESS

4.3.1. data fg; x='i will stir and bash up'; y=compress(x,'iab'); run;

### 4.4. COMPBL

4.4.1. data fh; x='i will stir and bash up'; y=compbl(x); run;

### 4.5. TRIM

4.5.1. data fj; x='this '; y='is'; z='gowtham'; new=trim(x)||' '||y||' '||z; run;

### 4.6. STRIP

4.6.1. data fl; x='this '; y=' is'; z='gowtham'; new=trim(x)||' '||strip(y)||' '||z; run;

### 4.7. CATX

4.7.1. data fq; w='this '; x=' is'; y=' gorantla '; z=' gowtham '; new=catx(' ',w,x,y,z); run;

### 4.8. TRANWRD

4.8.1. data ft; x='this is gowtham gorantla'; y=tranwrd(x,'gowtham','govinda'); run;

### 4.9. TRANSLATE

4.9.1. data fw; x='this is gowtham gorantla'; y=translate(x,'hs','go'); run;

### 4.10. INDEX

4.10.1. data fz; name='this is gorantla gowtham'; INDEX=index(name,'s'); INDEXC=indexc(name,'is'); INDEXW=indexw(name,'is '); run;

### 4.11. FIND

4.11.1. SAME AS INDEX