Skip to content

GH Issue 1800: Fix %labkeyMakeFilter operators and argument quoting - #97

Open
labkey-adam wants to merge 1 commit into
1.xfrom
fb_sas_macro_quoting_1800
Open

labkey-adam wants to merge 1 commit into
1.xfrom
fb_sas_macro_quoting_1800

Conversation

@labkey-adam

@labkey-adam labkey-adam commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Rationale

This PR fixes %labkeyMakeFilter, which aborts on every operator that takes a value, so SAS users can't filter at all (GH Issue 1800), and stops it from mangling or macro-resolving argument values. The old macro stripped quotes from values, split quoted values on spaces and commas, and resolved & and % in them, so a crafted Export > Script > SAS link could inject SAS code. None of this has been run in SAS; Duke CHSI (SAS 9.4 TS1M8) could verify a snapshot before 1.1.0 is published.

Related Pull Requests

Changes

  • %labkeyMakeFilter saves its arguments unresolved and parses them in the generated data step, accepting every operator in either quote style
  • Quoted filter values keep their quotes, spaces, and commas, and single-quoted arguments are never macro-resolved
  • %labkeySelectRows checks whether optional arguments were supplied without evaluating them
  • Changelog entry for 1.1.0

Value-taking operators no longer abort, quoted values keep their quotes, spaces, and commas, and single-quoted arguments are never macro-resolved. Untested against a live SAS installation.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant