BookmarkSubscribeRSS Feed
noda6003
Quartz | Level 8

I have metadata with variables and then want to append it with my final data and only keep variables which are in final data and drop the remaining. when i do proc contents on metadata and transpose then all the variables are becoming numeric and i couldnt merge it with my final data. can you please help on how to do it.

 

proc contents
	data = sashelp.class
	noprint
	out = tmp (keep = name);
run;

proc transpose data=tmp out=tmp1(drop=_name_);
	id name;
run;
1 REPLY 1
ballardw
Super User

Perhaps you should show use YOUR metadata data set and a small example of your "final data" and then what you expect for a result given those two example sets.

 

I am afraid that I can't guess what you actually want. Your example doesn't attempt to match or drop anything so it isn't clear what you mean by " keep variables which are in final data and drop the remaining" or why you think transpose is needed/wanted.

 


@noda6003 wrote:

I have metadata with variables and then want to append it with my final data and only keep variables which are in final data and drop the remaining. when i do proc contents on metadata and transpose then all the variables are becoming numeric and i couldnt merge it with my final data. can you please help on how to do it.

 

proc contents
	data = sashelp.class
	noprint
	out = tmp (keep = name);
run;

proc transpose data=tmp out=tmp1(drop=_name_);
	id name;
run;

 

 

 

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 1 reply
  • 450 views
  • 0 likes
  • 2 in conversation