BookmarkSubscribeRSS Feed
art297
Opal | Level 21

At some point you changed your selection criteria from

A and B to A or B

Which do you want?

 

As far as why you are getting a lot of missing values, other than the above reason, you would have to post example data.

 

Art, CEO, AnalystFinder.com

 

rj
Obsidian | Level 7 rj
Obsidian | Level 7
I want a and b but i thought maybe changing selection criteria might help in merge.Thanks!
rj
Obsidian | Level 7 rj
Obsidian | Level 7
Before merging I can see all the data in two files that I am trying to merge. But after merge I don't understand why I am not getting data in output for some of the columns.
art297
Opal | Level 21

Can't help you without seeing examples of your two datasets and, based on the examples, what you expect to end up with.

 

Art, CEO, AnalystFinder.com

 

rj
Obsidian | Level 7 rj
Obsidian | Level 7

Hi, 

 

It seems like there was a problem in raw file, even though the common key of two datasets was converted to character, the length of that variable in raw file was different and due to that merge failed.

even though the SAS codes were correct it was actually length of character variable that didn't help merge two datasets.

 

Thanks!

ballardw
Super User

If you are useing proc import to read your raw data then that is part of the issue. Proc IMPORT has to GUESS what the variable types are and by default only uses a few rows of data to make that guess. So if the values in the first data file all look numeric for the first 20 or so then Import assumes that all values are numeric, or vice versa for character.

 

Also providing a few rows of example data from from your two sets and what the desired result for that data would shorten things immensly as to what needs to be done to your data. Instructions here: https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-dat... will show how to turn an existing SAS data set into data step code that can be pasted into a forum code box using the {i} icon or attached as text to show exactly what you have and that we can test code against.

rj
Obsidian | Level 7 rj
Obsidian | Level 7

Thank you for the insight BallardW!

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

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
  • 21 replies
  • 1746 views
  • 2 likes
  • 4 in conversation