BookmarkSubscribeRSS Feed
echoli
Obsidian | Level 7

Hi All,

 

Is there a way to combine two tables but with different format in SAS?

For example:

I have two tables Variable_1 and Variable_2, ABC columns are character format, DEF columns are PVALUE format, I want  to make a table as shown below, is that possible?

I use:

data want;

set Variable_1 Variable_2;

run;

But can't output the same table as below.

 

Variable_1

A

B

C

 

Child

Young

Teen

Variable_2

D

E

F

 

0.3

0.4

0.5

 

Thanks,

C

2 REPLIES 2
ballardw
Super User

Any column in a SAS dataset must be of the same type. It may be possible to generate a report that looks like that.

 We would need a bit more information about how the rows of the two data sets are related and preferably some example data to manipulate.

 

TomKari
Onyx | Level 15

Well, yes it can be done...

 

 

Variable_1

A

B

C

 

Child

Young

Teen

 

 

 

Variable_2

D

E

F

 

0.3

0.4

0.5

 

 

but I suspect you're about to say "but that's not what I want", because it doesn't make a great deal of sense. If you tell us what's wrong with this, we'll get closer to what you need.

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