BookmarkSubscribeRSS Feed
Rayenair
Calcite | Level 5

Hello,

I need to develop a code in SAS for my Phd. Since I have never worked with this program intensively, I'm facing some problems.

The main idea is that I write a code for a migration module that updates a current model of a synthetic data population for a country.

By doing so, I will often use the random number generator to assign the chance of an indivudal to migrate or not (in the future).

I'm using two data files:

  • Imported Excel file with migration rates
  • File of the synthetic data population

The problem is that the migration chance is located in another data file (imported excel file).

Now I want to duplicate the migration collumns to my synthetic dataset.

How do I do this?

Thanks!

2 REPLIES 2
art297
Opal | Level 21

You have to provide some example rows and columns of the two datasets in order for anyone to show you the best way to accomplish what you want.  e.g., there must be some field, in both datasets, that relate migration rates to particular records.

Patrick
Opal | Level 21

Agree with Art.

As a general answer:

You will have to join the data (the tables) over some variable which is common to both tables.

Assuming you're using SAS Enterprise Guide, the "Query Builder" will help you to set up this join.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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