data normalization

Accepted Solution Solved
Reply
New Contributor
Posts: 3
Accepted Solution

data normalization

Hi all,

I have the following dataset and i'm needing to normalize it and obtain the other result

     email                                   codes

sample@sample.com~L7L~8S5~94Q~8S7~9JD~GFK~451~IBR~I7K
sample2@sample2.com~L7L~GJ6~94Q~8S7~9JD~451

of course, this is just a sample, the original file without normalization is much more extensive.

i'm running Enterprise Guide 4.2

emailcode
sample@sample.comL7L
sample@sample.com8S5
sample@sample.com94Q
sample@sample.com8S7
sample@sample.com9JD
sample@sample.comGFK
sample@sample.com451
sample@sample.comIBR
sample@sample.comI7K
sample2@sample2.comL7L
sample2@sample2.comGJ6
sample2@sample2.com94Q
sample2@sample2.com8S7
sample2@sample2.com9JD
sample2@sample2.com451

thank you all


Accepted Solutions
Solution
‎03-19-2013 01:34 PM
Super User
Posts: 17,963

Re: data normalization

I think you'll need a program task, using a data step.

I don't have SAS to test it at the moment, but something like the following should work:

data want;

set have;

i=1;

do while (scan(code, i, "~") ne "");

new_code=scan(code, i, "~");

i+1;

output;

end;

run;

View solution in original post


All Replies
Solution
‎03-19-2013 01:34 PM
Super User
Posts: 17,963

Re: data normalization

I think you'll need a program task, using a data step.

I don't have SAS to test it at the moment, but something like the following should work:

data want;

set have;

i=1;

do while (scan(code, i, "~") ne "");

new_code=scan(code, i, "~");

i+1;

output;

end;

run;

New Contributor
Posts: 3

Re: data normalization

I'll give it a try, thanks!

any other options will be well received.

New Contributor
Posts: 3

Re: data normalization

success!! thanks man

🔒 This topic is solved and locked.

Need further help from the community? Please ask a new question.

Discussion stats
  • 3 replies
  • 269 views
  • 1 like
  • 2 in conversation