BookmarkSubscribeRSS Feed
Rsadiq1
Calcite | Level 5

Hello

 

I am a new programmer and I need help with a task. I was given data (in excel)which I imported into sas, itcontains ayb id (which I need to match).I need to append that to another file(ICUE data), to see which member_id is associated with each ayb_id. I'm not sure how to go about this

 

Thanks alot

 

 

4 REPLIES 4
art297
Opal | Level 21

It can be done in a datastep. You can find step-by-step instructions at: http://support.sas.com/documentation/cdl/en/basess/68381/HTML/default/viewer.htm#p02xs0q9ihz3k1n1jfm...

 

It can also be done, as a join, using PROC SQL

 

Art, CEO, AnalystFinder.com

Shmuel
Garnet | Level 18

@Rsadiq1 wrote: " I was given data (in excel)which I imported into sas, it contains ayb id (which I need to match).I need to append that to another file(ICUE data), to see which member_id is associated with each ayb_id."

 

You asked for appending data while actually you want to merge the two datasets by ayb_id.

If this is the case use SQL:

proc sql;
   create table want as 
   select a.*, b.*
   from ICUE as a
   full join XL as b
   on a.ayb_id = b.ayb_id;
quit;

XL is yout imported dataset from excel.

You need adapt libname.datasetname of the two tables to merge (join).

Rsadiq1
Calcite | Level 5

          Proc sql;
9           Create table match_ayb as
10          Select a.*
11          ,b.*
12          From ayb_lu.lu_ayb as a
13          left join as ayb.AYB-WELLNESS CNPS_Q1 2017
                            _
                            73
                            76
ERROR 73-322: Expecting an ON.

 

I keep getting this error, maybe I'm missing where the on should be

Shmuel
Garnet | Level 18

compare last line - you made some typos or changes.

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!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

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
  • 4 replies
  • 2056 views
  • 1 like
  • 3 in conversation