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-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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