Importing comma-separated values (CSV) files with a large number of variables into SAS® Studio might cause data sets to have some variables named VARi


An issue occurs with the Import file functionality of SAS Studio, either standalone or as a node in a flow, when applied to a comma-separated values (CSV) file with the following characteristics:

As a result, the following occurs in the data set:

Here is an example scenario:

You have a text file with the semicolon separator, and the 32,767th byte spans the name of the 787th variable:

Screenshot of a text file with the semicolon separator, and the 32,767th byte spans the name of the 787th variable.

The 787th name in the imported data set is truncated to “UPCRP Ext. Charges Fis”, and successive variables are named VAR788, VAR789, and so on.

The 787th name in the imported data set is truncated to “UPCRP Ext. Charges Fis”, and successive variables are named VAR788, VAR789, and so on.

Note: The 32,767th byte of the file header corresponds to the 32,767th character of the header only when all characters are single-byte.

If the file header contains multi-byte characters (for example, accented characters), the 32,767th byte does not correspond to the 32,767th character of the header and it will be located before it.

Workaround

To circumvent this issue, save the CSV file as an Excel file (XLSX) before importing.

This issue is a limitation of the Import File functionality in SAS Studio, which will be removed in a future version.