BookmarkSubscribeRSS Feed
SASACC
Calcite | Level 5
Hi,

I have two datasets namely A and B.
A has 400 columns in which only column number 18 is not filled(Blank).
B has 400 columns in which only column number 18 and Key (column 1) is filled and remaining all are missing(numeric) or blank(Char) based on the data type.

Now I want new dataset as follow:

If match on key between A and B: I want all columns of A with columns number 18 having value of dataset B.

If exist in B and not A then I want all records in B.(Meaning columns1 and columns 18 filled and remaining missing or blank).

Please let me know how can I do this. Thanks.
2 REPLIES 2
data_null__
Jade | Level 19
You want to use

[pre] UPDATE A B; BY ID; [/pre]
deleted_user
Not applicable
you can use dataset merge. keep column1 and column18 from datasetB in merge step.

GL.

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

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.

SAS Training: Just a Click Away

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

Browse our catalog!

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