Two tales with 100 unique observations, how much observations after set? How much observation after merge?
well you don't tell very much.
a set statement should give you 100.
a merge statement will give you the number of obs that meet the by statement in you data merge.
@Zhenmin wrote:
Two tales with 100 unique observations, how much observations after set? How much observation after merge?
Actually there is insufficient information to answer this question without 1) the exact code used and 2) the data involved for the merge.
Consider the following code:
data junk; x=5; run; data example; set junk junk junk; run;
The data set Example has 3 records because the data set name Junk is duplicated on the set the statement even though the set Junk only has one record.
Or
data example; set junk ; do i= 1 to 5; output; end; run;
Has 5 records because the OUTPUT statement executes 5 times for each record in Junk.
Additionally other code in a data step could add or remove records.
Merge without a BY would have 100 records. But if there is a BY statement you could have anywhere from 100 to 200 depending on the content of the data assuming there are no record filters or anything to create additional records.
Thank you all and have a nice weekend!
Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!
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.
Ready to level-up your skills? Choose your own adventure.