BookmarkSubscribeRSS Feed
saslove
Quartz | Level 8

I have an ID list 

 

%let study1_ids="ab","xy","we","st","ut","po","vc","gh"; (study 1)

 

Now, for another study (let's say study 2) with a different set of IDS, I need to go over each ID list (which is entirely different from the above list- but for each id, I need to assign each id above.

 

For ex

abc (study 2) = ab (study 1)

d3e (study 2) = xy (study 1)

 

Thoughts? 

1 REPLY 1
ballardw
Super User

@saslove wrote:

I have an ID list 

 

%let study1_ids="ab","xy","we","st","ut","po","vc","gh"; (study 1)

 

Now, for another study (let's say study 2) with a different set of IDS, I need to go over each ID list (which is entirely different from the above list- but for each id, I need to assign each id above.

 

For ex

abc (study 2) = ab (study 1)

d3e (study 2) = xy (study 1)

 

Thoughts? 


Question the need for quotes and commas in that study1_ids.

 

This makes no sense in SAS: what are ABC, AB, d3e or xy. If they are values of a variable then what is the name of the variable?

abc (study 2) = ab (study 1)

d3e (study 2) = xy (study 1)

Provide a few concrete examples with values from both "lists" and what the result should be.

 

This sort of sounds like you probably should have the values involved in data sets and then SQL to match things.

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
  • 521 views
  • 0 likes
  • 2 in conversation