BookmarkSubscribeRSS Feed
Aman4SAS
Obsidian | Level 7

 

Dear All

 

I need to map 2 data set ; example is below;

data A 

 

var1

a

b

c

d

 

data B

1

2

3

4

5

6

 

Need result like

 

Data Result

a1

a2

a3

a4

a5

b1

b2

b3

b4

b5

c1

c2

c3

c4

c5

d1

d2

d3

d4

d5

 

can not use macro variable list becaz there is lots of obs in data a and b(out of limit t macro variable)

 

please suggest

 

Thanks in advance

 

 

 

2 REPLIES 2
Reeza
Super User

Use a CAT function to create the variable. 

http://support.sas.com/kb/25/270.html

 

Jagadishkatam
Amethyst | Level 16
proc sql;
create table test as select a.*,b.*, cats(a.var1,put(b.var2,best.)) as var from a as a , b as b ;
quit;
Thanks,
Jag

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