10-06-2017 10:57 AM
I'm processing a table with DI Studio (4.901)
I have a column that is numeric (best6.) input.. I need to convert the column to character (char40).. (simple enough)
BUT, if the numeric value of the input column is less than/equal to 99.... I need to add a zero to the leading side of the value in it's character result. I have to use this result character column to join with another table.. so a value of 99 needs to be '099'
I tried to use a case statement such as :
when <= 99
then cat('0', numeric_column)
when I try to validate the code I get this error:
71 proc sql;
73 select case
74 when <= 99
ERROR 22-322: Syntax error, expecting one of the following: a name, a quoted string, a numeric constant, a datetime constant,
a missing value, BTRIM, INPUT, PUT, SUBSTRING, USER.
75 then cat (0, channel_code)
76 else channel_code
77 end from work.etls_EFITable;
I think I'm just overlooking something simple in my logic..
10-06-2017 11:11 AM
wow.. that was incredibly quick and painless.
that tried and worked excellent. I'm looking up that Z format to learn more about it.
Thanks for the help!
Need further help from the community? Please ask a new question.