@jaliu wrote:
in the first line why do we list the three tables first?
To declare these as output tables. This is the required syntax within a Data step.
if we don't list them, why doesn't the output statement create the tables as they do when we use output statement elsewhere?
I believe you're referring to the OUTPUT statement in PROCS which have an OUT= option that allows you to then specify the data set name. The OUTPUT statement functions different in a data step (compared to a proc) where you are not required to specify the output data set name, but can specify the output data set name. If you have multiple data sets specified in the DATA statement but do not specify the data set in the OUTPUT statement, it is written to all datasets.
why is there no equal sign after output?
Because that is the data step syntax for a data set OUTPUT statement.
I think you may be confusing some of the OUT= options in other procs with the OUTPUT statement. Even with PROC MEANS which has an OUTPUT statement, there's an OUT= to specify the data set name.
lastly why do we need ; before output sometimes but other times don't?
Not sure this is true or correct. Please expand further with examples.
how can i can make sense of these things?
Read the documentation very, very closely.
You seem to be confusing options and statements at the moment for starters.
Please post code as text in the future, and please put a descriptive subject line. This post has nothing to do with IF/THEN DO statements so if someone now searches for help with an IF/THEN question this comes up and is not helpful.
@jaliu wrote:
in the first line why do we list the three tables first?
if we don't list them, why doesn't the output statement create the tables as they do when we use output statement elsewhere?
why is there no equal sign after output?
lastly why do we need ; before output sometimes but other times don't?
how can i can make sense of these things?