SAS to SQL Translation Engine for Statistical Data Automation

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

There is a need to automate the translation of SAS programming language statements into SQL, as existing methods are inefficient and require significant manual intervention, especially when dealing with data manipulation and statistical analysis tasks.

Innovation Solution

The technique involves translating SAS statements and expressions into equivalent SQL statements, including import statements, assignment expressions, and array statements, by defining SQL tables and using SELECT and CREATE MULTISET TABLE statements, while handling data types and column names appropriately to produce equivalent output.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Productivity

If manual translation methods are used to convert SAS programs to SQL, then translation accuracy can be maintained, but translation efficiency and productivity are significantly reduced

Engineering Contradiction:
Improvetranslation efficiencyVSAvoidmanual intervention requirement
Core Design Contradiction:
ProductivityVSExtent of automation

Solution Approach 1:

The translation system performs self-service by automatically analyzing SAS program syntax and semantics, identifying data manipulation operations, and generating equivalent SQL statements without requiring manual intervention. The system services itself by maintaining internal mappings between SAS and SQL constructs

Inventive Principle:
Principle #25Self-service

Solution Approach 2:

An intermediary translation engine is introduced between SAS and SQL systems. This mediator parses SAS code, understands the intended data operations, and translates them into SQL equivalents, bridging the gap between the two languages while maintaining translation accuracy

Inventive Principle:
Principle #24Intermediary (Mediator)

2Productivity

If automated translation is implemented to improve productivity, then translation speed increases, but translation accuracy and reliability may deteriorate due to language incompatibilities

Engineering Contradiction:
Improveconversion speedVSAvoidtranslation accuracy
Core Design Contradiction:
ProductivityVSReliability

Solution Approach 1:

The translation process is segmented into distinct phases: syntax parsing, semantic analysis, operation identification, and SQL generation. Each segment handles specific aspects of translation, allowing the system to maintain accuracy while automating the overall process. Complex SAS programs are broken down into manageable translation units

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The system adapts translation parameters and strategies based on the specific SAS constructs encountered. Different translation rules are applied for different SAS statements (e.g., PROC SQL vs. DATA steps), allowing the automated system to maintain high accuracy across diverse programming scenarios

Inventive Principle:
Principle #35Parameter changes

3Adaptability or versatility

If comprehensive translation of all SAS constructs is attempted, then complete functionality is achieved, but system complexity increases significantly

Engineering Contradiction:
Improvetranslation coverageVSAvoidtranslation system complexity
Core Design Contradiction:
Adaptability or versatilityVSDevice complexity

Solution Approach 1:

The system implements partial translation by focusing on the most common and important SAS data manipulation constructs. Rather than attempting to translate every possible SAS feature, it targets the core operations (data import, variable assignment, array handling) that cover approximately 80% of typical SAS usage, thereby managing complexity while maintaining practical versatility

Inventive Principle:
Principle #16Partial or excessive action

Data Source

PatentUS8676785B2Translator of statistical language programs into SQL
Publication Date: 2014.03.18 TERADATA US INC
  • US8676785B2 patent drawing
  • US8676785B2 patent drawing
  • US8676785B2 patent drawing

AI summary

System and method for translating statements and expressions within statistical language programs into SQL. These statements include one or more input statements and have a plurality of data rows. These statements include one or more array statements, the array statements having a set of original variables. The method for translating statements and expressions within statistical language programs into SQL includes the step of defining a select statement including a subset of the original variables. The expressions include one or more assignment expressions, the assignment expressions including a set of original variables and a set of new variables affected by the assignment expressions.