How to use index function and tranwrd function

Reply
Contributor
Posts: 32

How to use index function and tranwrd function

I Created dataset as

data sushil.tsk1;

input subjid$ InvestigatorName$5-25;

datalines;

1001 Ramachandiran

1002 Umabadi

1003 Seshadi

1004 Mandadi

1005 Kodumudivenu

1006 Vadivelu

1007 SevadiKesavamoorhty

1008 Semmadirajan

run;

I wrote the code, to find the position of "di" in Investigator variable and replace the "di" with Change but its not working Could any one help me.

data sushil.task1;

set sushil.tsk1;

Inv_Pos = index(InvestigatorName,'id');

Inv_Change = Tranwrd(InvestigatorName,'id','CHANGE');

run;


Using this Code Required Output is not coming Could any one help me

Super User
Posts: 5,438

Re: How to use index function and tranwrd function

Posted in reply to SushilKumar

Seems like a typo, instead of di you have specified id in the Tranwrd call.

Data never sleeps
Contributor
Posts: 32

Re: How to use index function and tranwrd function

yes thank you i got that

Ask a Question
Discussion stats
  • 2 replies
  • 189 views
  • 0 likes
  • 2 in conversation