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.

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 747 views
  • 0 likes
  • 2 in conversation