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

how to import XTP files into SAS datasets?

1 Answers   Barclays, Institute For Plasma Research,


why is a stop statement needed for the point=option on a set statement? : Sas programming

0 Answers  


If you were told to create many records from one record show how you would do this using arrays and with PROC TRANSPOSE?

1 Answers   HCL, Quintiles,


When you will use nowd option in report???

6 Answers   Accenture,


Write SAS codes to compare two datasets. Suppose the allowable difference is 0.1.

2 Answers  






How can you limit the variables written to output dataset in data step?

0 Answers  


What is _n_?

23 Answers   Accenture,


How would you determine how far down on a page you have printed in order to print out footnotes?

3 Answers  


where to use sas business intelligence? : Sas-bi

0 Answers  


Do you need to compute new variables? If so,should you do this before you execute the report-writing procedure?

0 Answers  


Name validation tools used in SAS

0 Answers  


Which function is used to count the number of intervals between two sas dates?

0 Answers  


Categories