DATA Step, Macro, Functions and more

coalesce trimming leading zeros

Reply
Super Contributor
Posts: 359

coalesce trimming leading zeros

Am I using this function wrong. I have 2 string values, the leading zero is stripped by coalesce.

data one;
x = '01';
y = ' ';
z = coalesce(y, x);
run;

put z=; shows:
z=1

It appears this only works in SQL. Interesting that it works at all in a data step, but yields incorrect results.


Message was edited by: Flip OK nevermind. I should be using COALESCEC()


Message was edited by: Flip
Ask a Question
Discussion stats
  • 0 replies
  • 125 views
  • 0 likes
  • 1 in conversation