Lesson 1: SQL as a calculator 1
# an example data null; y=.; PROC SQL; SELECT 2+3, 11*3, 2**5, cos(constant("pi")/3), exp(-1/2), log(2) FROM null ; QUIT; # an alternative, which I prefer PROC SQL inobs =1; SELECT 2+3, 11*3, 2**5, cos(constant("pi")/3), exp(-1/2), log(2) FROM sashelp.cars ; QUIT; Note: columns in SELECT should be separated by " , ". Note: SQL needs a table after FROM. A dummy dataset "null" is created to feed it. PROC SQL inobs =1; SELECT 2+3, 11*3, 2**5, cos(constant("pi")/3), exp(-1/2), log(2) FROM sashelp.cars ; QUIT; ---------------------------------------------------------- 5 33 32 0.5 0.606531 0.693147 Note: Any SAS system has SASHELP library, in which there are lots of datasets including CARS. We can use it to feed FROM with inobs=1 to read just one line from the dataset. If you skip inobs=1, you will see the consequence. outobs=1 al