Skip to content

Is it possible to add SAS SQL dialect to repo sql-formatter?Β #1623

@ShuguangSun

Description

@ShuguangSun

Hello,

I've noticed that the sql-formatter-org/sql-formatter provides SQL formatting capabilities for VS Code. Currently, I work around this by manually copying SAS SQL code out, formatting it, and pasting it back. But it may not fully address the unique syntax of SAS SQL

SAS SQL has several distinctive features that differ from standard SQL:

  1. SAS-specific clauses like UNION CORR (a SAS extension not found in other SQL dialects)
  2. Macro variable syntax: The & character functions as a macro variable indicator (not a logical operator), often used with a trailing dot like &abc.
  3. ** INTO : syntax** for storing query results into macro variables (e.g., SELECT col INTO :var FROM table)
  4. SAS-specific functions that are commonly used in SAS SQL queries (e.g., PUT(), INPUT(), CATX())

These SAS-specific elements might not be properly recognized or formatted by generic SQL formatters.

Would it be possible to add a dedicated SAS SQL dialect to sql-formatter?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions