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

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