Using the JSON LIBNAME engine, SAS generates variable names that exceed the 32-character limit when processing JSON keys with identical prefixes, resulting in errors similar to the following:
ERROR: The variable name ordinal_xxxxxxxxxxxxxxxxxxxxxxxx1 is illegal.
This error typically occurs during dataset creation (such as with PROC COPY) and prevents the JSON data from being successfully loaded into SAS tables.
The JSON LIBNAME engine derives SAS variable names from JSON keys.
When multiple JSON keys share identical leading characters, the engine might do the following:
In some scenarios, the resulting variable name exceeds the SAS limit of 32 characters, making it invalid and causing failures in procedures accessing the JSON libref.
SAS variable naming rules enforce a maximum length of 32 characters.
Ensure that JSON keys conform to the following: