DATA Step, Macro, Functions and more

Create new dataset

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 16
Accepted Solution

Create new dataset

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. 


Accepted Solutions
Solution
‎07-27-2016 02:44 PM
PROC Star
Posts: 1,091

Re: Create new dataset

How close is

 

proc sql noprint;

create table combined as

select * from table a, table b;

quit;

View solution in original post


All Replies
Occasional Contributor
Posts: 16

Re: Create new dataset

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. 

Solution
‎07-27-2016 02:44 PM
PROC Star
Posts: 1,091

Re: Create new dataset

How close is

 

proc sql noprint;

create table combined as

select * from table a, table b;

quit;

Occasional Contributor
Posts: 16

Re: Create new dataset

Pretty sure that worked perfect!  Thank you!

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 3 replies
  • 246 views
  • 0 likes
  • 2 in conversation