I am trying to read the email_list file and output only email addresses separated by semi-column. But my code goes into a loop.
Can anybody help me in this??
email_file.txt has following records:
Doe, John <john.doe@abc.com>;Smith, Jeff <jeff.smith@abc.com>; lever, dave <dave.lever@abc.com>
Below is my code:
data test; length text $32767; infile 'c\email_file.txt' lrecl=32767 dsd dlm='09'x truncover; input text $; run;
data t1; set test; length tx3 $500; tx3=""; tx1=text; do until (length(cats(tx1))=0); space_position = INDEX(tx1, '<'); slash_position = INDEX(tx1, '>'); space_to_slash = slash_position - space_position; tx2 = substr(tx1, space_position+1, space_to_slash-1); tx3=cats(tx3,tx2,";"); tx4=substr(tx1,find(tx1,";")+1); tx1=tx4; end; run;
... View more