101.FIND | COMPARE | VERIFY | AMPERSAND & | PROPCASE | SUBSTR | INDEX FUNCTIONS

FIND | COMPARE | VERIFY | AMPERSAND & | PROPCASE | SUBSTR | INDEX FUNCTIONS 

DATA A1;

A='Further, the company emphasized that much Further';

B=FIND(A,'PANY','I');

C=COMPARE(A,'that');

D='Further, the company emphasized that much';

E=FIND(A,'the');

F=FIND(A,'Fur',4);

G=VERIFY(A,D);

RUN;

PROC PRINT;

RUN;


OUTPUT:

Obs A B C D E F G
1 Further, the company emphasized that much Further 17 -1 Further, the company emphasized that much 4 43 0


DATA A2;

A='ABCJHDLABC';

B='ABCDKJDF';

C=VERIFY(B,A);

RUN;

PROC PRINT;

RUN;


OUTPUT:

Obs A B C
1 ABCJHDLABC ABCDKJDF 5


DATA A3;

INPUT NAME&$ 30.;

CARDS;

Kamireddy jagan reddy  

adithya desh pandey  

ankit patel rathod 

;

RUN;

PROC PRINT;

RUN;


OUTPUT:

Obs NAME
1 Kamireddy jagan reddy
2 adithya desh pandey
3 ankit patel rathod

DATA A4;

SET A3;

A=PROPCASE(NAME);

B=SUBSTR(A,1,1);

C=INDEX(A,' ');

D=SUBSTR(A,C);

FNAME=STRIP(B)||'.'||D;

RUN;

PROC PRINT;

RUN;


OUTPUT:

Obs NAME A B C D FNAME
1 Kamireddy jagan reddy Kamireddy Jagan Reddy K 10 Jagan Reddy K. Jagan Reddy
2 adithya desh pandey Adithya Desh Pandey A 8 Desh Pandey A. Desh Pandey
3 ankit patel rathod Ankit Patel Rathod A 6 Patel Rathod A. Patel Rathod


TRY AND COMMENT YOUR CODE...

-->PLEASE READ AND COMMENT THE BLOG...

--PLEASE FOLLOW THE BLOG FOR MORE UPDATES...

--FOLLOW US IN FACEBOOK SASALL4YOU AND JOIN ...

--JOIN US IN FACEBOOK AND TELEGRAM  CHANNEL FOR MORE UPDATES

   CLICK HERE : https://t.me/SasAll4You

Comments