We have a string like this "kannafromsalembut" ,from this i
want to get only "fromsal" (but one condition with out
using substring function)here we can not use scan because in
the given string there is no delimeter? so give ans without
out using substring ?

Answers were Sorted based on User's Feedback



We have a string like this "kannafromsalembut" ,from this i want to get only "fromsa..

Answer / ram kumar

data _null_;
file print;
tranw=tranwrd('kannafromsalembut','kanna',' ');
tranw1=tranwrd(tranw,'embut',' ');
tranw2=strip(tranw2);
put tranw2= ;
run;
this will give your required output. that is tranw2=fromsal.

Is This Answer Correct ?    11 Yes 4 No

We have a string like this "kannafromsalembut" ,from this i want to get only "fromsa..

Answer / abcds

data _null_;
file print;
tranw = tranwrd('kannafromsalembut','kanna',' ');
tranw1 = tranwrd(tranw,'embut',' ');
tranw2 = strip(tranw1);
put tranw2= ;
run;
this is the correct one.

Is This Answer Correct ?    7 Yes 0 No

We have a string like this "kannafromsalembut" ,from this i want to get only "fromsa..

Answer / kumarravi123

One will get appreciate from our team members if u give
correct answer

Is This Answer Correct ?    2 Yes 1 No

We have a string like this "kannafromsalembut" ,from this i want to get only "fromsa..

Answer / ramkgupta

thank you abcds for correcting my small mistake.

Is This Answer Correct ?    0 Yes 0 No

We have a string like this "kannafromsalembut" ,from this i want to get only "fromsa..

Answer / nagmani

data p;
input @6 x$ 7.;
cards;
kannafromsalembul
;
run;

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More SAS Interview Questions

Tell different ways to create Macrovarible?

3 Answers   Accenture, PharmaNet i3,


Describe the function and untility of the most difficult SAS macro that you have written.

0 Answers  


How to find out no. of business days in a month using macros.???(excluding weekends and holidays).

2 Answers   HSBC,


How are numeric and character missing values represented internally?

0 Answers   Quintiles,


how can you create zero observation dataset? : Sas programming

0 Answers  






How do you add a number to a macro variable?

2 Answers  


What do the mod and int function do? : Sas programming

0 Answers  


How sas treats the dsd delimiters?

0 Answers  


how can you improve the performance of a query, If it is excuting very slowly?

2 Answers   Zensar,


What’s the difference between var b1 – b3 and var b1 — b3?

0 Answers  


Mention what is the difference between nodupkey and nodup options?

0 Answers  


How would you create multiple observations from a single observation?

1 Answers   Quintiles,


Categories