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

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

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
  • 1157 views
  • 0 likes
  • 3 in conversation