Syntax Conventions

The SAS FedSQL Language Reference uses the Backus-Naur Form (BNF). Specifically, it uses the same syntax notation that is used by Jim Melton in SQL:1999 Understanding Relational Language Components.
The main difference between traditional SAS syntax and the syntax that is used in the SAS FedSQL language reference documentation is in how optional syntax arguments are displayed. In the traditional SAS syntax, angle brackets (< >) are used to denote optional syntax. In the FedSQL syntax, square brackets ([ ]) are used to denote optional syntax and angle brackets are used to denote non-terminal components.
The following symbols are used in the FedSQL syntax.
::=
This symbol can be interpreted as “consists of” or “is defined as”.
< >
Angle brackets identify a non-terminal component , that is a syntax component that can be further resolved into lower level syntax grammar.
[ ]
Square brackets identify optional arguments. Any argument that is not enclosed in square brackets is a required argument. Do not type the square brackets unless they are preceded by a backward slash (\), which denotes that they are literal.
{ }
Braces provide a method to distinguish required multi-word arguments. Do not type the braces unless they are preceded by a backward slash (\) which denotes that they are literal.
|
A vertical bar indicates that you can choose one value from a group. Values separated by bars are mutually exclusive.
An ellipsis indicates that the argument or group of arguments that follow the ellipsis can be repeated any number of times. If the ellipsis and the following arguments are enclosed in square brackets, they are optional.
\
A backward slash indicates that next character is a literal.
The following examples illustrate the syntax conventions that are described in this section. These examples contain selected syntax elements, not the complete syntax.
1CREATE  TABLE 2 {table | _NULL_}
   3 [\{OPTIONS SAS-table-option=value [… SAS-table-option=value]\}]
   (4 <column–definition> 5 [, ...<column-definition> | <table-constraint>])
   6| 7AS query-expression
;
<column-definition>::=
   column data-type [<column–constraint>] [DEFAULT value]
   [HAVING [FORMAT format] [INFORMAT informat] [LABEL='label']]
1 CREATE TABLE is in uppercase bold because it is the name of the statement.
2 table is italics because it is an argument that you can supply.
3 The braces are preceded by a backward slash indicating that the braces are literal.
4 <column–definition> is in angle brackets because it is a non-terminal argument that is further resolved into lower level syntax grammar.
5 The square brackets and ellipsis around the second instance of <column-definition> indicates that it is optional and you can repeat this argument any number of times separated by commas.
6 You can supply a <column-definition> or AS query-expression but not both.
7 AS is in uppercase roman because it is a literal argument.
Last updated: February 23, 2017