Desktop productivity for business analysts and programmers

Proc append vs data set

Accepted Solution Solved
Reply
Frequent Contributor
Posts: 82
Accepted Solution

Proc append vs data set

When I say:

data work.temp1
   set work.temp2
       work.temp3;

run;

Is it same as:
proc append base = temp2 data=temp3;
run;


Accepted Solutions
Solution
‎05-21-2014 03:51 PM
Trusted Advisor
Posts: 1,059

Re: Proc append vs data set

The order of the records WILL be preserved, but unless the variable names and types are identical in the two datasets, there can be differences in functionality that are too extensive to describe here.

If your BASE dataset is large, one advantage of PROC APPEND is that it doesn't process the BASE dataset, only the DATA dataset, which can save processing time.

I suggest hitting the documentation for PROC APPEND to ensure it will act in the way you want.

Tom

View solution in original post


All Replies
Grand Advisor
Posts: 17,406

Re: Proc append vs data set

No.

In the first you're creating a new data set, in the second your appending to the temp2, so all the data is now in temp2.

Also, what happens if you have some columns in temp3 that are not in temp2? Or variables are different lengths or formats?

Frequent Contributor
Posts: 82

Re: Proc append vs data set

Thanks. Apart from creating a new dataset, is there  any other  difference? What about the order of the records? Will they be preserved after the append?

Solution
‎05-21-2014 03:51 PM
Trusted Advisor
Posts: 1,059

Re: Proc append vs data set

The order of the records WILL be preserved, but unless the variable names and types are identical in the two datasets, there can be differences in functionality that are too extensive to describe here.

If your BASE dataset is large, one advantage of PROC APPEND is that it doesn't process the BASE dataset, only the DATA dataset, which can save processing time.

I suggest hitting the documentation for PROC APPEND to ensure it will act in the way you want.

Tom

☑ This topic is SOLVED.

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

Discussion stats
  • 3 replies
  • 302 views
  • 3 likes
  • 3 in conversation