I'm trying to understand the output statement and the PDV.
If I don't include the output statement after each assignment, the output data looks like this...
Code:
DATA WORK.HRLeaders2;
LENGTH Player $ 7;
Season=2016; Player='Trumbo'; HR=47;
Season=2017; Player='Stanton'; HR=59;
Season=2018; Player='Davis'; HR=48;
RUN;
Output:
If I include after each statement it looks like this...
Code:
DATA WORK.HRLeaders2;
LENGTH Player $ 7;
Season=2016; Player='Trumbo'; HR=47;OUTPUT;
Season=2017; Player='Stanton'; HR=59;OUTPUT;
Season=2018; Player='Davis'; HR=48;OUTPUT;
RUN;
Output:
Obs Player Season HR123
Trumbo | 2016 | 47 |
Stanton | 2017 | 59 |
Davis | 2018 | 48 |
If I include after first statement only, it looks like this...
Code:
DATA WORK.HRLeaders2;
LENGTH Player $ 7;
Season=2016; Player='Trumbo'; HR=47; OUTPUT;
Season=2017; Player='Stanton'; HR=59;
Season=2018; Player='Davis'; HR=48;
RUN;
Output:
Obs Player Season HR1
Why wouldn't it output both the first and last observation in the output data set? And are the other two observations then "lost" (created temporarily but gone because I didn't output them to a dataset)?
Thanks! I know it's a simple question, just trying to understand.