ANIMAL PLANT OBS Common Animal Number OBS Common Plant Number 1 a Ant 5 1 g Grape 69 2 b Bird 2 h Hazelnut 55 3 c Cat 17 3 i Indigo . 4 d Dog 9 4 j Jicama 14 5 e Eagle 5 k Kale 5 6 f Frog 76 6 l Lentil 77
proc append base=year1 data=year2; run;
ANIMAL PLANT
OBS Common Animal OBS Common Plant
1 a Ant 1 a Apple
2 b Bird 2 b Banana
3 c Cat 3 c Coconut
4 d Dog 4 d Dewberry
5 e Eagle 5 e Eggplant
6 f Frog 6 f Figdata interleaving; set animal plant; by Common; run; proc print data=interleaving; title 'Data Set INTERLEAVING'; run;
ANIMAL1 PLANT1 OBS Common Animal1 OBS Common Plant1 1 a Ant 1 a Apple 2 a Ape 2 b Banana 3 b Bird 3 c Coconut 4 c Cat 4 c Celery 5 d Dog 5 d Dewberry 6 e Eagle 6 e Eggplant
ANIMAL2 PLANT2
OBS Common Animal2 OBS Common Plant2
1 a Ant 1 a Apple
2 c Cat 2 b Banana
3 d Dog 3 c Coconut
4 e Eagle 4 e Eggplant
5 f FigANIMAL PLANT OBS Common Animal OBS Common Plant 1 a Ant 1 a Apple 2 b Bird 2 b Banana 3 c Cat 3 c Coconut 4 d Dog 4 d Dewberry 5 e Eagle 5 e Eggplant 6 f Frog 6 g Fig
data twosets; set animal; set plant; run; proc print data=twosets; title 'Data Set TWOSETS - Equal Number of Observations'; run;
ANIMAL PLANT OBS Common Animal OBS Common Plant 1 a Ant 1 a Apple 2 b Bird 2 b Banana 3 c Cat 3 c Coconut 4 d Dog 4 d Dewberry 5 e Eagle 5 e Eggplant 6 f Frog 6 g Fig
ANIMAL1 PLANT1 OBS Common Animal OBS Common Plant 1 a Ant 1 a Apple 2 b Bird 2 b Banana 3 c Cat 3 c Coconut 4 d Dog 5 e Eagle 6 f Frog
ANIMAL1 PLANT1 OBS Common Animal OBS Common Plant 1 a Ant 1 a Apple 2 a Ape 2 b Banana 3 b Bird 3 c Coconut 4 c Cat 4 c Celery 5 d Dog 5 d Dewberry 6 e Eagle 6 e Eggplant
/* This program illustrates undesirable results. */ data merge1; merge animal1 plant1; run; proc print data=merge1; title 'Data Set MERGE1'; run;
ANIMAL2 PLANT2
OBS Common Animal OBS Common Plant
1 a Ant 1 a Apple
2 c Cat 2 b Banana
3 d Dog 3 c Coconut
4 e Eagle 4 e Eggplant
5 f FigANIMAL PLANT OBS Common Animal OBS Common Plant 1 a Ant 1 a Apple 2 b Bird 2 b Banana 3 c Cat 3 c Coconut 4 d Dog 4 d Dewberry 5 e Eagle 5 e Eggplant 6 f Frog 6 f Fig
ANIMAL1 PLANT1 OBS Common Animal1 OBS Common Plant1 1 a Ant 1 a Apple 2 a Ape 2 b Banana 3 b Bird 3 c Coconut 4 c Cat 4 c Celery 5 d Dog 5 d Dewberry 6 e Eagle 6 e Eggplant
data match1; merge animal1 plant1; by Common; run; proc print data=match1; title 'Data Set MATCH1'; run;
ANIMAL2 PLANT2
OBS Common Animal2 OBS Common Plant2
1 a Ant 1 a Apple
2 c Cat 2 b Banana
3 d Dog 3 c Coconut
4 e Eagle 4 e Eggplant
5 f
FigMASTER NEWPLANT OBS Common Animal Plant OBS Common Plant 1 a Ant Apple 1 a Apricot 2 b Bird Banana 2 b Barley 3 c Cat Coconut 3 c Cactus 4 d Dog Dewberry 4 d Date 5 e Eagle Eggplant 5 e Escarole 6 f Frog Fig 6 f Fennel
MASTER1 DUPPLANT OBS Common Animal1 Plant1 OBS Common Plant1 1 a Ant Apple 1 a Apricot 2 b Bird Banana 2 b Barley 3 b Bird Banana 3 c Cactus 4 c Cat Coconut 4 d Date 5 d Dog Dewberry 5 d Dill 6 e Eagle Eggplant 6 e Escarole 7 f Frog Fig 7 f Fennel
data update1; update master1 dupplant; by Common; run; proc print data=update1; title 'Data Set Update1'; run;
MASTER2 NONPLANT
OBS Common Animal2 Plant2 OBS Common Plant2 Mineral
1 a Ant 1 a Apricot Amethyst
2 c Cat Coconut 2 b Barley Beryl
3 d Dog Dewberry 3 c Cactus
4 e Eagle Eggplant 4 e
5 f Frog Fig 5 f Fennel
6 g Grape Garnet
data update2_file; update master2 nonplant; by Common; run; proc print data=update2_file; title 'Data Set Update2_File'; run;
data update2_file; update master2 nonplant updatemode=nomissingcheck; by Common; run; proc print data=update2_file; title 'Data Set Update2_File - UPDATEMODE Option'; run;
MASTER TRANSACTION OBS Year VarX VarY OBS Year VarX VarY 1 2004 x1 y1 1 2010 x2 2 2005 x1 y1 2 2011 x2 y2 3 2006 x1 y1 3 2012 x2 4 2007 x1 y1 4 2012 y2 5 2008 x1 y1 5 2014 x2 y2 6 2009 x1 y1 7 2010 x1 y1 8 2011 x1 y1 9 2012 x1 y1 10 2013 x1 y1