BookmarkSubscribeRSS Feed
deleted_user
Not applicable
I need to merge two tables. Here's the situation :

The base table CTS.A (has numeric variable called var)
Table which needs to be merged : CTS.B (has a character variable called var, it has both number and character values)

when i merge now, the merged data set contains null values for var from CTS.B

I want the merged data set to contain number values of var from CTS.B. The character values can eat shit and die.

Is there an easy way to do this?? without going back to modify CTS.B ??

-mosas
2 REPLIES 2
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
Suggest you lose the subjective commentary and limit your posts to pertinent / relevant discussion.

So you can use the ANYALPHA function to filter our your character variable input from CTS.B, in either a prior DATA step or a nested query (if using PROC SQL).

And, also, you will need to use the SAS INPUT function to convert the CHARACTER variable to a SAS NUMERIC type variable in order to work with either a MERGE in a DATA step or a PROC SQL JOIN.

Scott Barry
SBBWorks, Inc.

Suggested Google advanced search arguments, this topic/post:
convert character variable numeric site:sas.com

proc sql join merge files site:sas.com

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 1024 views
  • 0 likes
  • 2 in conversation