Write a SAS macro to calculate number of numbers in an
email address

Answers were Sorted based on User's Feedback



Write a SAS macro to calculate number of numbers in an email address..

Answer / dey

%macro logic(email=);
data _null_;
length EMAIL $50;
Email=&email;
retain count 0;
do i = 1 to length(EMAIL);
if missing(substr(EMAIL,i,1)*1)=0 then
COUNT= COUNT +1;
end;
call symput('count',count);
RUN;
%put &count;
%mend logic;

%logic(email='dey_anurup123444@yahoo.12co.in')

Is This Answer Correct ?    1 Yes 1 No

Write a SAS macro to calculate number of numbers in an email address..

Answer / naresh

Use compress function and remove characters and special characters then you will get digits.. Now find the length of the string...

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More SAS Interview Questions

what is scheduling and how will u implement it. In scheduling 5 jobs r running if there is an error occured at 3rd job and how will u check and waht necessary steps will u take not to repeat the same mistake

0 Answers   Blue Star,


What do you know about symput and symget?

0 Answers  


Define run-group processing?

0 Answers  


how to delete the duplicate columns permanently in SQL

2 Answers   Satyam,


Explain the use of proc gplot? : sas-grid-administration

0 Answers  






In PROC PRINT, can you print only variables that begin with the letter “A”?

8 Answers  


what is the difference between floor and ceil functions in sas? : Sas-administrator

0 Answers  


What is Transaction...? And what are Comment, Roll back n Save point..?

2 Answers  


What is the difference between an informat and a format. Name three informats or formats.

6 Answers  


what is the purpose of _error_? : Sas programming

0 Answers  


what are the methods that you would employ to fine tune your SQL extract process using SAS/Access or Proc SQL?

1 Answers  


What is the SAS data set?

0 Answers  


Categories