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

% let A=3+4 what is result

4 Answers   Satyam,


Can you execute macro within another macro? : sas-macro

0 Answers  


Can you execute a macro within a macro? Describe. : sas-macro

0 Answers  


How to create an external dataset with sas code?

0 Answers  


what are sas bi dashboard components? : Sas-bi

0 Answers  






How sas treats the dsd delimiters?

0 Answers  


how to generate the test data in sas without input data? : Sas-administrator

0 Answers  


Can we replace a dataset into view?

6 Answers   CliniRx,


what is the difference between proc report and proc format?

7 Answers   CTS,


What is Linear Regression?

0 Answers  


What is by-group processing?

0 Answers  


how can u convert this 25-jul-2010 from numeric to charcter?

3 Answers  


Categories