Let's take a look at this program and
examine some of the rules we just discussed about SaaS syntax.
Now, this program is not spaced well, you'll notice we have multiple
statements on a single line, the indention of certain statements is inconsistent.
But let's try it and see if it runs successfully.
I'll click the Run button.
Take a look at the log and notice there are no warnings or errors.
The program seemed to run with no problem.
Well, let's return back to the code and
see if we can improve the spacing to make the program more legible.
This is so easy in SaaS Studio.
All we need to do is click the Format Code button.
And you'll notice that the program is spaced in a way that we can
see each of the individual steps, and the statements within steps are indented.
It's much easier to read.
So let's make a few modifications to the code,
I'll add a comment before the data statement.
After typing the text of the comment, I'll highlight it and press Ctrl Slash.
And automatically that text is surrounded with the comment symbols.
And in our editor, we can see it turns green, again,
a visual indication that it is a comment.
Now although, we haven't talked about the syntax yet,
notice we have a statement here that is subsetting our data for AvgMPG > 35.
And we have a corresponding title that indicates that that's how we have subset
the data.
I'd like to comment out those two statements, so they don't run.
I can do that simply by putting an asterisk in front of both statements.
Everything between the asterisk and
the semicolon will be ignored when the code runs.
So now I'll submit the program and notice,
we don't have a title in the report, because we commented the title statement.
And average MPG looks like it has values less than 35,
so our subsetting statement did not run either.
Using consistent program spacing and
comments are a great way to make your programs easy to understand.