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.

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

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