home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / bit / listserv / sasl / 3443 < prev    next >
Encoding:
Text File  |  1992-07-27  |  5.4 KB  |  110 lines

  1. Comments: Gated by NETNEWS@AUVM.AMERICAN.EDU
  2. Path: sparky!uunet!paladin.american.edu!auvm!COMPUSERVE.COM!76350.1604
  3. Message-ID: <920727220643_76350.1604_EHJ35-2@CompuServe.COM>
  4. Newsgroups: bit.listserv.sas-l
  5. Date:         Mon, 27 Jul 1992 18:06:43 EDT
  6. Reply-To:     Andy Norton <76350.1604@COMPUSERVE.COM>
  7. Sender:       "SAS(r) Discussion" <SAS-L@UGA.BITNET>
  8. From:         Andy Norton <76350.1604@COMPUSERVE.COM>
  9. Subject:      SQL ? and SAS...
  10. Comments: To: SAS-L <SAS-L@AWIIMC12.IMC.UNIVIE.AC.AT>
  11. Lines: 97
  12.  
  13. Date:     7/27/92
  14. Name:     Andy Norton (616) 344-2191     76350.1604@compuserve.com
  15. Rel/Pltf: 6.06 and above
  16. Re:       SQL basics (missionary tract)
  17.           Response to Daryl Sawders
  18. Address:  Trilogy Consulting, 5228 Lovers Lane, Kalamazoo MI 49002
  19.  
  20. Daryl Sawders requested basic information about PROC SQL.
  21.  
  22. I am going to join in harmony with the other SQL supporters on this
  23. net.  SQL is fundamental and revolutionary.
  24.  
  25. 1)  SQL works with _any_ SAS data sets, including traditional SAS data
  26. files, SAS/ACCESS views, SQL views, and DATA-step views.
  27.  
  28. 2)  Through some miracle, SQL is part of the base product in all
  29. releases 6.06 and above.
  30.  
  31. 3)  PROC SQL is an implementation of the SQL language, originally
  32. developed by IBM.  It is supported by over 150 Database Management
  33. Systems (DBMS's).  There is an ANSI standard, and proposals for future
  34. standards.  The SAS implementation of SQL is more powerful than many
  35. implementations (e.g. ORACLE).  SAS entered the SQL arena relatively
  36. late, and benefited from watching everyone else.  Also, the SAS
  37. implementation includes much of the proposed SQL2 standard.  There has
  38. been a tremendous amount of research and experience with SQL, which
  39. keeps SAS Institute honest (SQL facilitates direct comparison with
  40. competitors).
  41.  
  42. 4)  You can invoke the SQL processor from PROC SQL (or submit from
  43. SCL).  But you can also create SQL views.  These are virtual datasets,
  44. e.g. programs that are run on demand when you need their results.  This
  45. is a key strength of SQL:  you can build views, and never have to
  46. re-create intermediate files again.  Views are used in the same way as
  47. datasets.  That is, you can be running SQL without realizing it.
  48.  
  49. 5)  SQL is a declarative language, rather than algorithmic.  That is,
  50. you tell the computer what to do by describing your goal rather than
  51. step-by-step instructions.  This
  52.     a) makes it easier for you and others to read and modify, because
  53. you don't have to mentally translate between goals and actions,
  54.     b) can lead to more efficient processing, because SQL attempts to
  55. take any program and "optimize" it into ideal form  (On occasion, the
  56. optimizer will choose an inefficient solution, and it can be difficult
  57. to force a different solution).
  58.     c)  any method can be used to achieve the goal.  These need not be
  59. methods used by traditional SAS.   For example, the MERGE statement
  60. requires sorting both data sets.  SQL, in contrast, may store the
  61. smaller data set in a hash table and use no sorting at all.  This is
  62. transparent to the user.
  63.     d)  "client-server" processing is facilitated.  This fashionable
  64. buzzword refers to processing different parts of a query on different
  65. machines or as different tasks.  For example, if you specify a WHERE
  66. clause in a SAS SQL program that references a SAS/ACCESS to ORACLE
  67. view, the WHERE clause may be evaluated on the ORACLE side, reducing
  68. network traffic.
  69.     e)  Once you become fluent in SQL, you spend your time thinking
  70. about data structures and about the content of the problem, rather than
  71. physical implementation.  In my opinion, the usual result is a better
  72. designed program, even if you (for some reason) want to re-write it in
  73. traditional SAS code later.
  74.  
  75. 6)  SQL is especially well suited to joins ("merges" in SAS
  76. terminology), summarization, and subsetting.  It is ok for variable
  77. construction.  It is poor for lag operations (but it can be done).
  78.  
  79. 7)  The implementation of SAS SQL is getting better.  Release 6.07 is
  80. much more efficient than 6.06, and provides additional features.
  81. Release 6.08 will be even better.  Remember, this is a new product for
  82. SAS Institute -- comparisons to mature products such as the DATA step
  83. are unfair in that SQL will almost certainly improve more.
  84.  
  85. 8)  SQL is not perfect.  See the series of books "Relational Database
  86. Writings" by C.F. Date.  But it is a big step in the right direction
  87. (compared to DATA steps).  Learning SQL will help you understand
  88. whatever comes next.
  89.  
  90. 9)  SQL works better with "normalized", vertical data structures.
  91. "Normalized" means (very briefly) that variables are grouped into
  92. different tables according to their level of analysis.  SQL prefers
  93. vertical data structures because it does not support arrays.  Put each
  94. "array element" into a separate observation.
  95.      You can, however, use data with less than ideal structures.  It
  96. just takes more work on the programmer's part.
  97.  
  98. ==>  I have been a professional SAS programmer for 12 years, pretty
  99. much full-time.  I am well-experienced in traditional SAS
  100. coding techniques, but after using version 6 for two years, I find
  101. myself using PROC SQL over 80% of the time.  I know lots of people are
  102. reluctant to invest resources into the latest craze, but THIS IS
  103. BIG.  SAS Institute has been slow to promote SQL ("not invented
  104. here"?), but the word is getting out.
  105.  
  106. P.S.  I have to give credit where it is due.  Paul Kent is the SQL
  107. developer at SAS Institute and clearly one of their top stars.
  108. Thanks, Paul, for getting SAS Institute into the SQL business and
  109. making it a success.
  110.