I need to find the numeric field which contains blank in
between..Ex:123 456...there is blank in between the 123
456..I need to know if there is any SAS function to find a
field..


Please suggest...

Answers were Sorted based on User's Feedback



I need to find the numeric field which contains blank in between..Ex:123 456...there is blank in b..

Answer / kalyan

we can use index function to find any specific string.

test=index('123 456',' ') it will give 4, the position of blank. is this helpful?

Is This Answer Correct ?    8 Yes 0 No

I need to find the numeric field which contains blank in between..Ex:123 456...there is blank in b..

Answer / mahesh babu

data test;
a="123 456";
b=anyspace(a);
run;

Is This Answer Correct ?    2 Yes 0 No

I need to find the numeric field which contains blank in between..Ex:123 456...there is blank in b..

Answer / amaranuswathi

Please suggest if any function is there to find to find the
particular field...

Is This Answer Correct ?    0 Yes 0 No

I need to find the numeric field which contains blank in between..Ex:123 456...there is blank in b..

Answer / akhil

If I am having a data set c
data test;
input c $ 20.;

cards;
123 456
217 236
456235
225 5665
55
77 85
46556
4588 56
;
run;
proc print;
run;

Now I am going to fetch observation having space in between,

data e(drop=e t);
set test;
e=length(c);
t=find(c,'');
if e>t;
run;
proc print data=e;
run;

Is This Answer Correct ?    0 Yes 0 No

I need to find the numeric field which contains blank in between..Ex:123 456...there is blank in b..

Answer / akhil126

data test;
input c $ 20.;

cards;
123 456
217 236
456235
225 5665
55
77 85
46556
4588 56
;
run;
proc print;
run;

data e(drop=e t);
set test;
e=length(c);
t=find(c,'');
if e>t;
run;
proc print data=e;
run;

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More SAS Interview Questions

Name statements that are execution only?

7 Answers  


How would you include common or reuse code to be processed along with your statements?

3 Answers   Accenture,


How would you remove a format that has been permanently associated with a variable? ________________

5 Answers   Quintiles, TCS,


where will go the observations that were deleted by delete statement?

2 Answers  


which date functions advances a date time or date/time value by a given interval? : Sas programming

0 Answers  


What do the SAS log messages "numeric values have been converted to character" mean?

0 Answers   Quintiles,


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

2 Answers  


What do you feel about hardcoding?

3 Answers   Pfizer,


How do you add a number to a macro variable?

3 Answers  


How to convert a numeric variable to a character variable?

0 Answers  


What makes sas stand out to be the best over other data analytics tools?

0 Answers  


Which is the Best SAS training Institute in Delhi NCR for SAS certification preparation

1 Answers   SAS,


Categories