BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
jwhite
Quartz | Level 8

(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

1 ACCEPTED SOLUTION

Accepted Solutions
LinusH
Tourmaline | Level 20

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

3 REPLIES 3
LinusH
Tourmaline | Level 20

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
jwhite
Quartz | Level 8

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

jwhite
Quartz | Level 8

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!

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

How to connect to databases in SAS Viya

Need to connect to databases in SAS Viya? SAS’ David Ghan shows you two methods – via SAS/ACCESS LIBNAME and SAS Data Connector SASLIBS – in this video.

Find more tutorials on the SAS Users YouTube channel.

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