SAS language

{{Short description|Programming language}}{{Infobox programming language

| name = SAS

| paradigm = Multi-paradigm: Data-driven, Procedural programming

| released = {{Start date and age|1976|df=yes}}

| designer = Anthony James Barr

| developer = SAS Institute

| operating system = Windows and macOS

| license = Proprietary commercial software

| File extensions = .sas

| website = {{URL|sas.com/en_us/software/base-sas.html}}

}}

The SAS language is a fourth-generation computer programming language used for statistical analysis, created by Anthony James Barr at North Carolina State University.{{citation|title=SAS History|publisher=SAS Institute|url=http://www.sas.com/company/about/history.html#s1=2|accessdate=April 4, 2014|archive-url=https://web.archive.org/web/20131023182559/http://www.sas.com/company/about/history.html|archive-date=2013-10-23}}Barr & Goodnight, et al. 1976:"The SAS Staff". Attribution of contributions to SAS 72 and SAS 76. Its primary applications include data mining and machine learning. The SAS language runs under compilers such as the SAS System that can be used on Microsoft Windows, Linux, UNIX and mainframe computers.{{Cite book |last1=Chambers |first1=Michele |url=https://books.google.com/books?id=sJlhBAAAQBAJ&dq=sas+language+developed&pg=PA203 |title=Advanced Analytics Methodologies: Driving Business Value with Analytics |last2=Dinsmore |first2=Thomas W. |date=2015 |publisher=Pearson Education |isbn=978-0-13-349860-8 |pages=203 |language=en}}

History

{{Main|SAS Institute#History}}

SAS was developed in the 1960s by Anthony James Barr, who built its fundamental structure, {{Cite book |last1=Agresti |first1=Alan |url=https://books.google.com/books?id=kPGJUiUCJZkC&dq=anthony+james+barr+sas&pg=PA177 |title=Strength in Numbers: The Rising of Academic Statistics Departments in the U. S. |last2=Meng |first2=Xiao-Li |date=2012-11-02 |publisher=Springer Science & Business Media |isbn=978-1-4614-3649-2 |pages=177 |language=en}} and SAS Institute CEO James Goodnight, who developed a number of features including analysis procedures.{{Cite book |last=Wahi |first=Monika |url=https://books.google.com/books?id=3tcDEAAAQBAJ&dq=sas+data+warehousing&pg=PA1 |title=Mastering SAS Programming for Data Warehousing: An advanced programming guide to designing and managing Data Warehouses using SAS |date=2020-10-16 |publisher=Packt Publishing Ltd |isbn=978-1-78953-118-3 |pages=8–10 |language=en}} The language is currently developed and sponsored by the SAS Institute, of which Goodnight is founder and CEO.{{Cite web |title=Pampering The Customers, Pampering The Employees |url=https://www.forbes.com/2007/11/08/sas-corestates-goognight-biz-cz_rl_1108sas.html |access-date=2024-04-29 |website=Forbes |language=en}}

Language

Base SAS is a fourth-generation procedural programming language designed for the statistical analysis of data.{{Cite web |title=SAS Help Center |url=https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.3/imlsstat/imlsstat_statintro_sect005.htm#:~:text=SAS%20is%20a%20procedural%20programming%20language. |access-date=2024-04-29 |website=documentation.sas.com}} It is Turing-complete and domain specific, with many of the attributes of a command language. As an interpreted language, it is generally parsed, compiled, and executed step by step.{{Cite book |last=Carpenter |first=Art |url=https://books.google.com/books?id=F5_7DAAAQBAJ&q=what+is+sas+macro+language |title=Carpenter's Complete Guide to the SAS Macro Language, Third Edition |date=2016-08-25 |publisher=SAS Institute |isbn=978-1-62960-237-0 |pages=1–11 |language=en}} The SAS system was originally a single instruction, single data (SISD) engine, but single instruction, multiple data (SIMD) and multiple instruction, multiple data (MIMD) functionality was later added.{{Cite book |last=Bequet |first=Henry |url=https://books.google.com/books?id=ng9mDwAAQBAJ&q=sas |title=Deep Learning for Numerical Applications with SAS |date=2018-07-20 |publisher=SAS Institute |isbn=978-1-63526-677-1 |pages=4–5 |language=en}} Most base SAS code can be ported between versions, but some are functions and parameters are specific to certain operating systems and interfaces.{{Cite book |last=Hughes |first=Troy Martin |url=https://books.google.com/books?id=ZkznDAAAQBAJ&dq=sas+language+developed&pg=PR12 |title=SAS Data Analytic Development: Dimensions of Software Quality |date=2016-08-24 |publisher=John Wiley & Sons |isbn=978-1-119-25570-3 |pages=xiii |language=en}}

All SAS programs are written within the SAS language, although some packages use menu-driven graphical user interfaces on the front-end.{{Cite book |last1=Delwiche |first1=Lora D. |url=https://books.google.com/books?id=lfa2DwAAQBAJ&dq=what+is+sas+macro+language&pg=PT21 |title=The Little SAS Book: A Primer, Sixth Edition |last2=Slaughter |first2=Susan J. |date=2019-10-11 |publisher=SAS Institute |isbn=978-1-64295-343-5 |language=en}} Various SAS editors use color coding to identify components like step boundaries, keywords and constants.{{Cite book |last1=Elliott |first1=Alan C. |url=https://books.google.com/books?id=ijFlCgAAQBAJ&q=sas+language+developed |title=SAS Essentials: Mastering SAS for Data Analytics |last2=Woodward |first2=Wayne A. |date=2015-08-18 |publisher=John Wiley & Sons |isbn=978-1-119-04218-1 |pages=12 |language=en}} It can read in data from common spreadsheets and databases and output the results of statistical analyses in tables, graphs, and as RTF, HTML and PDF documents.{{Cite book |last=Ohri |first=Ajay |url=https://books.google.com/books?id=nZanDwAAQBAJ&q=sas+language+developed |title=SAS for R Users: A Book for Data Scientists |date=2019-08-05 |publisher=John Wiley & Sons |isbn=978-1-119-25642-7 |pages=151–157 |language=en}}

= Syntax =

The language consists of two main types of blocks: DATA blocks and PROC blocks.{{Cite book |last1=Bass |first1=N. Jyoti |url=https://books.google.com/books?id=o9nVu8Xsd6kC&dq=what+is+sas+macro+language&pg=PP1 |title=Base Sas Programming Black Book, 2007 Ed |last2=Solutions |first2=K. Madhavi Lata & Kogent |date=2007 |publisher=Dreamtech Press |isbn=978-81-7722-769-7 |pages=3–8 |language=en}} DATA blocks can be used to read and manipulate input data, and create data sets. PROC blocks are used to perform analyses and operations on these data sets, sort data, and output results in the form of descriptive statistics, tables, results, charts and plots.{{Cite book |last1=Chambers |first1=Michele |url=https://books.google.com/books?id=sJlhBAAAQBAJ&dq=sas+language+developed&pg=PA203 |title=Advanced Analytics Methodologies: Driving Business Value with Analytics |last2=Dinsmore |first2=Thomas W. |date=2015 |publisher=Pearson Education |isbn=978-0-13-349860-8 |pages=203 |language=en}}{{Cite book |last=Ohri |first=Ajay |url=https://books.google.com/books?id=nZanDwAAQBAJ&q=sas+language+developed |title=SAS for R Users: A Book for Data Scientists |date=2019-08-05 |publisher=John Wiley & Sons |isbn=978-1-119-25642-7 |pages=51–58 |language=en}} PROC SQL can be used to work with SQL syntax within SAS.{{Cite book |last=Anderson |first=Raymond A. |url=https://books.google.com/books?id=04lNEAAAQBAJ&dq=john+sall+barr+created&pg=PA565 |title=Credit Intelligence and Modelling: Many Paths Through the Forest of Credit Rating and Scoring |date=2022 |publisher=Oxford University Press |isbn=978-0-19-284419-4 |pages=565 |language=en}}

Users can input both numeric and character data into base SAS. SAS statements must begin with a reserved keyword and end with {{Code|;|SAS}}{{Cite book |last1=Bass |first1=N. Jyoti |url=https://books.google.com/books?id=o9nVu8Xsd6kC&dq=what+is+sas+macro+language&pg=PP1 |title=Base Sas Programming Black Book, 2007 Ed |last2=Solutions |first2=K. Madhavi Lata & Kogent |date=2007 |publisher=Dreamtech Press |isbn=978-81-7722-769-7 |pages=43–44 |language=en}} but the language is otherwise flexible in terms of formatting and most statements are case insensitive.{{Cite book |last1=Delwiche |first1=Lora D. |url=https://books.google.com/books?id=lfa2DwAAQBAJ&dq=what+is+sas+macro+language&pg=PT21 |title=The Little SAS Book: A Primer, Sixth Edition |last2=Slaughter |first2=Susan J. |date=2019-10-11 |publisher=SAS Institute |isbn=978-1-64295-343-5 |language=en}} SAS statements can continue across multiple lines and do not require indenting, although indents can improve readability. Comments are delimited by {{Code|/*|SAS}} and {{Code|*/|SAS}}.{{Cite book |last=Ohri |first=Ajay |url=https://books.google.com/books?id=nZanDwAAQBAJ&q=sas+language+developed |title=SAS for R Users: A Book for Data Scientists |date=2019-08-05 |publisher=John Wiley & Sons |isbn=978-1-119-25642-7 |pages=4–6 |language=en}}

A standard SAS program typically entails the definition of data, the creation of a data set, and the performance of procedures such as analysis on that data set. SAS scripts have the .sas extension.

A simple example of SAS code is the following

  • COMMENT;

Data TEMP;

input X Y Z;

datalines;

1 2 3

5 6 7

;

run;

PROC PRINT DATA = TEMP;

RUN;

= SAS macro language =

The SAS macro language is made available within base SAS software to reduce the amount of code, and create code generators for building more versatile and flexible programs.{{Cite web |title=Introduction to SAS Macro Language |url=https://stats.oarc.ucla.edu/sas/seminars/sas-macros-introduction/ |access-date=2024-04-29 |website=stats.oarc.ucla.edu}} The macro language can be used for functionalities as simple as symbolic substitution and as complex as dynamic programming. SAS macro is considered to be a rich language,{{Cite web |last=Stalla |first=Alessio |date=2022-04-20 |title=Challenges in Parsing Legacy Languages: The Case of SAS Macros |url=https://tomassetti.me/challenges-in-parsing-legacy-languages-sas-macros/ |access-date=2024-04-29 |website=Strumenta |language=en-US}} although its overall syntax is very similar to that of base SAS. The names of macro variables in SAS are usually preceded by {{Code|&|SAS}}, while macro program statements are usually preceded by {{Code|%|SAS}}.

Software

{{Main|SAS (software)}}

SAS Institute develops a number of tools and software suites, also called SAS, which are used for creating programs in the language. These suites include JMP, SAS Viya, SAS Enterprise Guide and SAS Enterprise Miner. In 2002, World Programming also developed software that allows the execution of most SAS scripts.

Uses

The SAS language is used as a standard in many industries, and was ranked #22 on the TIOBE index in February 2024.{{Cite web |title=TIOBE Index |url=https://www.tiobe.com/tiobe-index/ |url-status=live |archive-url=https://web.archive.org/web/20240223214138/https://www.tiobe.com/tiobe-index/ |archive-date=2024-02-23 |access-date=2024-04-30 |website=TIOBE |language=en-US}} It is especially widely used for machine learning, data mining, and data warehousing in the finance, insurance, manufacturing, health care and pharmaceutical industries. It has a high level of documentation and community support, which has contributed to its uptake.{{Cite book |last=Dean |first=Jared |url=https://books.google.com/books?id=Js2LAwAAQBAJ&q=sas |title=Big Data, Data Mining, and Machine Learning: Value Creation for Business Leaders and Practitioners |date=2014-05-07 |publisher=John Wiley & Sons |isbn=978-1-118-92070-1 |pages=50–51 |language=en}}

= Machine learning =

SAS is used for preparing input data, and building and optimizing machine learning algorithms.{{Cite book |last1=Kolosova |first1=Tanya |url=https://books.google.com/books?id=3sb2DwAAQBAJ&q=sas&pg=PR7 |title=Supervised Machine Learning: Optimization Framework and Applications with SAS and R |last2=Berestizhevsky |first2=Samuel |date=2020-09-21 |publisher=CRC Press |isbn=978-1-000-17681-0 |pages=7–8 |language=en}} Various models, such as artificial neural networks (ANN), convolutional neural networks and deep learning models, are developed and trained in SAS.{{Cite book |last=Bequet |first=Henry |url=https://books.google.com/books?id=ng9mDwAAQBAJ&q=sas |title=Deep Learning for Numerical Applications with SAS |date=2018-07-20 |publisher=SAS Institute |isbn=978-1-63526-677-1 |pages=8–14 |language=en}} These are applied to areas such as computer vision and fraud detection.{{Cite book |last=Blanchard |first=Robert |url=https://books.google.com/books?id=hr_rDwAAQBAJ&dq=deep+learning+computer+vision+sas&pg=PP1 |title=Deep Learning for Computer Vision with SAS: An Introduction |date=2020-06-12 |publisher=SAS Institute |isbn=978-1-64295-917-8 |pages=26 |language=en}} SAS has also been noted for its applications in the area of decision intelligence.{{Cite web |title=Forrester Reprint |url=https://reprints2.forrester.com/#/assets/2/202/RES178488/report |access-date=2024-04-30 |website=reprints2.forrester.com}}

= Data mining and warehousing =

While SAS was originally developed for data analysis, it became an important language for data storage. SAS is one of the primary languages used for data mining in business intelligence and statistics.{{Cite book |last1=Shmueli |first1=Galit |url=https://books.google.com/books?id=Z7G2DwAAQBAJ&q=data+mining+for+business |title=Data Mining for Business Analytics: Concepts, Techniques and Applications in Python |last2=Bruce |first2=Peter C. |last3=Gedeck |first3=Peter |last4=Patel |first4=Nitin R. |date=2019-10-14 |publisher=John Wiley & Sons |isbn=978-1-119-54985-7 |language=en}} According to Gartner's Magic Quadrant and Forrester Research, the SAS Institute is one of the largest vendors of data mining software.

See also

Notes

{{Reflist}}

References

{{Refbegin}}

  • {{cite web | title = Overview of the SAS Language | publisher = Department of Animal Science, McGill University | url = http://animsci.agrenv.mcgill.ca/StatisticalMethodsII/sas/index.html | accessdate = 5 October 2013 }}
  • {{Citation | last1=Barr | first1=A. J. | last2=Goodnight | first2=J. H. | last3= Sall | first3=J. P. | last4=Helwig | first4=J. T. | title=A User's Guide to SAS 76 | publisher=SAS Institute, Inc. | place=Raleigh, North Carolina | year=1976 | isbn=0-917382-01-3 }}

{{Refend}}