These should be heady times for Jim Goodnight, founder and CEO of SAS Institute, a business analytics software and services firm. His North Carolina-based company bucked the economic downturn to make 2009 its third most profitable year on record ­– and it is currently working on cutting-edge solutions for Macy’s and also for the endangered hippos in Africa.

But Goodnight, a former statistics professor who launched SAS in 1976, noted that his biggest priority these days is his concern that America isn’t turning out enough new scientists and mathematicians to prevent the flow of jobs and critical research to Asia and elsewhere. “Twenty-first century employers are looking for workers who are proficient in science, technology, engineering and math, but in American schools these are not areas of great interest,” Goodnight said during a lecture sponsored by a longtime SAS-partner, Wharton Research Data Services. His talk was titled, “The Age of Analytics: Competing in the 21st Century.”

According to Goodnight, because of the lack of scientists and mathematicians in the U.S., some 77% of global technology companies said in a recent survey that they are looking to open research centers in China or India. Only four of the 10 firms that are leaders in obtaining U.S. patents are actually based in the U.S. “We have to address this alarming trend,” Goodnight said.

He is doing just that, taking on a complicated social issue that goes far beyond the walls of SAS and its 11,000 worldwide employees. Over the last 15 years, SAS has made improving American education the firm’s main philanthropic thrust — underwriting innovative pilot programs in its home state of North Carolina, providing thousands of high school and middle school students with laptops, and developing an online learning program free of charge for some 40,000 classrooms last year.

“Education is the economic engine for our country, and without education improvements, the United States is going to be in trouble,” Goodnight, 67, said. But, when it comes to working hard in school, many American children are “just not that into it. Science and math are hard — you have to work hard. A lot of American kids … like to play games, watch TV and send messages to each other over the Internet.”

Tracking Welfare Claims, Risk — and Hippos

One reason that an American brain drain is so worrisome to Goodnight is that it looms just as an increasing number of companies are realizing the enormous business value in the kind of technology that SAS offers: software and services that help make sense of the exponentially growing volume of data on the Internet or produced through computerized transactions.

A number of firms, he said, have demonstrated the growing power of data analysis by adding chief analytics officers or chief data officers over the past two years. At the same time, books with titles such as, The New Know: Innovation Powered by Analytics, line the shelves of bookstores’ business sections.

The growing awareness of analytics as a tool for everything from uncovering waste and fraud to interpreting consumer sentiment as expressed in online discussion boards helped power the privately held SAS to a record $2.3 billion in revenue in 2009. Sales have grown every year. Headquartered in Cary, N.C., the company not only avoided layoffs during the recent recession, but continued its expansion into 54 countries.

Indeed, the economic downturn has arguably increased business opportunities for SAS in a number of ways. For example, a growing number of cash-strapped government agencies — not to mention banks and credit card companies — are now looking to analytic software as a tool for saving millions of dollars through fraud detection.

Goodnight spotlighted one such recent program with the Los Angeles County Department of Social Services, which was losing millions of dollars every year in fraudulent child welfare claims. He said the county turned to SAS to develop a program that would mine the data from payment information and court records, and identify what Goodnight called “a social network” of cases that would be the most likely to be tied to illegal behavior. He said the program had a 40% success record in predicting fraud and an 83% success rate in anticipating bogus client claims, which saved the county $31 million.

He also noted that the economic meltdown of 2008 spotlighted the outdated methods that financial institutions were using to manage their exposure to risk. “Banks need computations and techniques to happen faster,” Goodnight said. “They really can no longer wait 18 to 24 hours to calculate the value of risk that they have.” He described some recent work with a risk manager for a financial institution in Singapore who reported that it took about 18 hours to sift through some 40,000 factors to analyze the bank’s exposure to risk. SAS developed an expanded computer capacity to reduce that analysis to just 15 minutes, which could allow traders to make critical decisions in what is close to real time.

Indeed, Goodnight suggested to the audience that there is no problem too large or too small for analytics software. He cited the work his company does for Catalina Markets, the leading provider of point-of-sale supermarket coupons. According to Goodnight, Catalina has an astonishing 600 billion rows of data about American consumers. “They create a coupon, and each one is personalized — even if two customers have the exact same stuff in their shopping basket,” Goodnight noted. In similar fashion, SAS develops programs for Macy’s that track the seasonality of millions of purchases to help the department store know how long it can charge full-price for items before consumer interest wanes and the product is ready to be marked down.

Goodnight drew laughs when he said the firm also developed a way for researchers to better track the shrinking number of hippopotamuses in Africa. Researchers “tried tracking them with collars — but these big collars around [the animals’ necks] were ruining their sex lives,” he said. The hunt was on for alternatives. “We found that by measuring hoof prints,” a tracking system could be developed.

The No-layoff Pledge

One reason that SAS is able to tackle so many different problems is that it spends a considerable amount on research and development — typically 25%, compared to an industry average of 10% for rivals, according to Goodnight.

In the depths of the recent recession, Goodnight said he became aware of growing worry among SAS employees about the possibility of job cuts. To calm their fears, he filmed a companywide webcast in January 2009 with a bold promise. “I told them we would have no layoffs for the entire year — but that I needed them to pitch in and reduce expenses, to slow down on hiring and cut it out completely if possible. Everybody did pitch in and productivity actually went up in 2009…. It was one of our top three most profitable years.”

Goodnight’s harshest words were for rival companies that announced layoffs during that time frame and saw their stock prices jump upward. “People are admitting they don’t know how to manage,” he said. “They brought in too many people, they over-hired and now they had to lay [workers] off. The market rewards them and their stock goes up. It does not make any sense.”

The 2009 no-layoff pledge, which the CEO continued through 2010, fits in with Goodnight’s broader theory that knowledge-based companies such as SAS thrive by keeping their workers happy and by retaining them. He noted that not only has SAS been on Fortune magazine’s list of the best places to work every year since the survey began in 1998, but it was named No. 1 last year; the company earns top scores in many other countries as well, from Brazil to the United Kingdom.

Goodnight said his ideas about an employee-friendly environment developed after a year spent working in Florida for the Apollo space project in the 1960s, where staffers “were treated like workers on an assembly line.” After founding SAS, Goodnight insisted that workers not only get individual offices, but also break rooms stocked with free refreshments, on-site gymnasiums and day care centers, and a team of company physicians and nurses.

The company’s turnover rate, according to Goodnight, is only 3% or 4% a year — much less than the software industry average of 17% to 25%. He said an outside consultant estimated that low turnover saves SAS as much as $100 million a year ­– money that rival companies are spending on recruitment and training of less experienced employees.

That may explain why Goodnight’s biggest worry today isn’t so much keeping SAS’s current staff, but where the next generation of programmers and statisticians will come from, given the flagging state of American education in science and math. Education has been the main focus of philanthropic activity both for SAS and for Goodnight; in 1996, he and his wife founded an independent, technology-oriented prep school, called Cary Academy, in the company’s North Carolina hometown. More broadly, SAS has been aiding schools across the country through a $75 million investment in an online learning program called Curriculum Pathways that the firm now provides free-of-charge in roughly 40,000 classrooms. The program covers the core academic disciplines.

In addition, SAS is promoting a One-to-One Laptop initiative reflecting Goodnight’s belief that students learn better when they have enhanced access to technology. “There are definitely people who need to go into liberal arts; you probably have them as managers right now,” Goodnight noted. “Our country is just too out of balance. We have too many people going into liberal arts.”

That wasn’t so true when Goodnight was in high school, and the Soviet Union’s 1957 launching of the Sputnik satellite was met with a massive U.S. investment in science and math education. Today, he maintained, the danger of falling behind China, India and other rivals in technology is just as serious, yet is being ignored. “The threat is getting bigger and bigger,” Goodnight added, “as we produce [fewer] scientists and engineers.”