Building email address

Regular Contributor
Posts: 181

Building email address

If your e-mail is of the form (like ) you can use this to derive the email address from system variable _CLIENTUSERNAME:


    /* determine email address from _CLIENTUSERNAME */

    data _null_;
        emailaddress=trim(compress(lowcase(substr(scan(&_CLIENTUSERNAME, -1),1,1)||scan(&_CLIENTUSERNAME, 1))||''));
        firstname   =trim(compress(lowcase(scan(&_CLIENTUSERNAME,-1))));
        lastname    =trim(compress(lowcase(scan(&_CLIENTUSERNAME,+1))));
        call symput('firstname', trim(firstname));
        call symput('lastname', trim(lastname));
        call symput('emailaddress', trim(emailaddress));
    %put &=emailaddress;

Super User
Posts: 23,323

Re: Building email address

Posted in reply to tomrvincent

Hi @tomrvincent. It looks like you're trying to post content that can be shared/library type reference code for people. This is a great idea, please consider posting them as Articles rather than posts. Posts are typically for questions. I also like to keep a set over on github, personal choice.

And add New Article. 


Looking forward to seeing your posts!



Regular Contributor
Posts: 181

Re: Building email address

[ Edited ]

I had never heard of or seen that...thanks for the suggestion.


just tried this:


You have not yet achieved the experience level on the community to create your own article. Keep coming back and posting discussion topics though, and you'll earn it!


oh, well...

Ask a Question
Discussion stats
  • 2 replies
  • 1 like
  • 2 in conversation