BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Raj21
Calcite | Level 5

I have two data sets.  One of which is a master data set with 965 observations and then i want to take the second data set which is 95 values and take every value and add it to each observation in the first data set.  Could someone point me in the correct direction to a command that can do this.  It should become 91675 observations by doing this, and then i can just weed out duplications with a if-then delete statement. 

1 ACCEPTED SOLUTION

Accepted Solutions
TomKari
Onyx | Level 15

How close is

 

proc sql noprint;

create table combined as

select * from table a, table b;

quit;

View solution in original post

3 REPLIES 3
Raj21
Calcite | Level 5

A little more information for this one. 

 

I would want these observations (master data set)

 

EquipmentTypeIDCommodityCodeASolverIncludeCompartmentID
C45CDNONPRO 28-30Yes<No_Compartment_Specified>
C45CDNONPRO 34-38Yes<No_Compartment_Specified>
C45CDNONPRO 38-42Yes<No_Compartment_Specified>
C45CDNONPRO 45-50Yes<No_Compartment_Specified>

 

To have these observations added to each one of the aboves observations. 

 

CommodityCodeB
*DFT
3RD-PARTY
CHEMICALS
DRY
DRY CHEMICAL
DRY EE
DRY ES
DRY FAK
DRY FOOD
DRY GENERAL
DRY HAZMAT
DRY NORIDEFD
DRY PET FOOD
DRY SCENTED
EE 28-30
EE 34-38
EE 38-42

 

Then I would just look for when commodityA and commodityB are the same and delete those observations and i would be set, so this would become 17 X 4 = 68 observations. 

TomKari
Onyx | Level 15

How close is

 

proc sql noprint;

create table combined as

select * from table a, table b;

quit;

Raj21
Calcite | Level 5

Pretty sure that worked perfect!  Thank you!

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
  • 3 replies
  • 952 views
  • 0 likes
  • 2 in conversation