- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hello
Lets say that I have data set A and every day I create another data set called B and then I want to add the rows of B to A.
I want to show 2 ways and ask which way is better ?
/*Way1*/
Data A;
SET A B;
Run;
/*Way2*/
Data tempTbl;
SET A;
Run;
Proc delete data=A;Run;
Data A;
SET tempTbl B;
Run;
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
@Ronein wrote:
Hello
Lets say that I have data set A and every day I create another data set called B and then I want to add the rows of B to A.
I want to show 2 ways and ask which way is better ?
/*Way1*/ Data A; SET A B; Run; /*Way2*/ Data tempTbl; SET A; Run; Proc delete data=A;Run; Data A; SET tempTbl B; Run;
Proc append if the data sets have the same variables with the same lengths for character variables would be the better choice.
Anything involving a data step reads each and every record. Which means your "Set A B"; runs slower and slower as A bets bigger.
Proc Append works a bit differently and will typically run much faster for this type of activity.
If the variables are not the same then the first way would be more efficient in resources.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
@Ronein wrote:
Hello
Lets say that I have data set A and every day I create another data set called B and then I want to add the rows of B to A.
I want to show 2 ways and ask which way is better ?
/*Way1*/ Data A; SET A B; Run; /*Way2*/ Data tempTbl; SET A; Run; Proc delete data=A;Run; Data A; SET tempTbl B; Run;
Proc append if the data sets have the same variables with the same lengths for character variables would be the better choice.
Anything involving a data step reads each and every record. Which means your "Set A B"; runs slower and slower as A bets bigger.
Proc Append works a bit differently and will typically run much faster for this type of activity.
If the variables are not the same then the first way would be more efficient in resources.