BookmarkSubscribeRSS Feed
radha009
Quartz | Level 8

 

trying two merge two datasets, each dataset has 3 varables. in each dataset 2 variables are same and one is different. giving error as below 

 

proc append base=patch.other_final data=Patch.Other_Infra&i force; run;

 

NOTE: Appending PATCH.OTHER_INFRA2 to PATCH.OTHER_FINAL.
WARNING: Variable TKT0200342_Oracle_TFT was not found on BASE file. The variable will not be
added to the BASE file.
WARNING: Variable TKT0197527_STTPoint_PTP was not found on DATA file.
NOTE: FORCE is specified, so dropping/truncating will occur.
NOTE: There were 140 observations read from the data set PATCH.OTHER_INFRA2.

 

4 REPLIES 4
VDD
Ammonite | Level 13 VDD
Ammonite | Level 13

this should give you what you are asking for.

data want;

set  PATCH.OTHER_FINAL(in=ina) PATCH.OTHER_INFRA2(in=inb);

run;

Or you can merge the data.

Append is used to stack tables that are the same.

 

 

 

Astounding
PROC Star

SAS has many, many ways to combine data sets. PROC APPEND is only one of them.  If that's not working (and it won't work if you are trying to add a new variable), give a small example of what you would like the outcome to be.  Just show 2 observations for each incoming data set, and what you would like the final data set to look like.

Reeza
Super User

PROC APPEND does not support adding new variables. 

 

 

 

VDD
Ammonite | Level 13 VDD
Ammonite | Level 13

merge may be what you want to do

 

proc sort data= a out=asort;
 by var1 var2;
run;
proc sort data= b out=bsort;
 by var1 var2;
run;
data want;
 merge asort(in=ina) bsort(in=inb);
 by var1 var2;
run;

 

if you only want records found in table a you can do this

data want;
 merge asort(in=ina) bsort(in=inb);
 by var1 var2;

if ina;

run;

 

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 4 replies
  • 1500 views
  • 2 likes
  • 4 in conversation