SAS Data Integration Studio, DataFlux Data Management Studio, SAS/ACCESS, SAS Data Loader for Hadoop and others

DI Studio: Char to Numeric Expression

Accepted Solution Solved
Reply
Frequent Contributor
Posts: 89
Accepted Solution

DI Studio: Char to Numeric Expression

(New DI Studio Developer)

Good Morning, All.

I've got some character column in the input table that I need to output as numerics. In the output mapping, I'm attempting: INPUT([ColumnName],8.) but with no success.

I think it _might_ be because some of the input character columns have dollar values with dollar signs ('$'). So, I suppose my expression would need to pull those dollar signs out as well as it converts the character to numeric.

So...does anyone see anything wrong with my initial expression and how could I also pull out dollar signs when necessary?

Thanks!

-Jeff


Accepted Solutions
Solution
‎09-09-2014 12:20 PM
Super User
Posts: 5,431

Re: DI Studio: Char to Numeric Expression

I presume that you mean by no success that you are getting missing values?

If you have a columns that "always" has dollar signs, try to use the dollar informat.

Otherwise, try to compress() or substr() the column to get rid of unwanted chars before input() it to numeric.

Data never sleeps

View solution in original post


All Replies
Solution
‎09-09-2014 12:20 PM
Super User
Posts: 5,431

Re: DI Studio: Char to Numeric Expression

I presume that you mean by no success that you are getting missing values?

If you have a columns that "always" has dollar signs, try to use the dollar informat.

Otherwise, try to compress() or substr() the column to get rid of unwanted chars before input() it to numeric.

Data never sleeps
Frequent Contributor
Posts: 89

Re: DI Studio: Char to Numeric Expression

I'm sorry. To clarify...'no success' means that the extraction node runs successfully, but when I go to open the workfile I get the following error message:

DIStudio_error.PNG

Here's my attempt to use the INPUT():

DIStudio_input.PNG

COMPRESS(INPUT(Fall_State_Salary,8.),'$') wasn't successful either. I received an error message upon trying to open the workfile.

Thanks for your help,

-Jeff

Frequent Contributor
Posts: 89

Re: DI Studio: Char to Numeric Expression

Ok, it looks like I resolved the above error message issue, and am now able to view the workfile.

However, I am getting empty columns for those that would have dollar signs and using the COMMAw.d format is solving that issue.

So, the following expression works for my purpose: INPUT([column_name],comma8.)

I'm considering this resolved.

Thanks!

🔒 This topic is solved and locked.

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

Discussion stats
  • 3 replies
  • 1034 views
  • 0 likes
  • 2 in conversation