BookmarkSubscribeRSS Feed
SushilKumar
Calcite | Level 5

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

2 REPLIES 2
LinusH
Tourmaline | Level 20

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

Data never sleeps
SushilKumar
Calcite | Level 5

yes thank you i got that

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 542 views
  • 0 likes
  • 2 in conversation