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-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
  • 2 replies
  • 659 views
  • 0 likes
  • 3 in conversation