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

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!

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
  • 737 views
  • 0 likes
  • 2 in conversation