BookmarkSubscribeRSS Feed
TomHsiung
Pyrite | Level 9
options validvarname = v7;
options symbolgen;
options fullstimer;

I remember by this system statements, we have

 

Patient ID # A column name in xlsx table.

 

became this

 

Patient_ID

in SAS after importing previously.

 

But now it is not working!

2 REPLIES 2
ballardw
Super User

Did you execute the statement in the current session?

options validvarname = v7;

 

I suspect the Learners version resets many of the system options to defaults at start of the session.

 

Or show the log of what you have done to see if there is something else going on.

Such as possibly not replacing an existing data set on import.

 

Personally I have hated XLSX, and the predecessor XLS, file formats so much that I way prefer saving the file to CSV (comma separated values) and writing a data step to read the data from the resulting text file as then I control what the variable names are, the types, lengths and can add labels and formats as needed as well as data checking.

Even importing the CSV file will generate a data step code to see what was done and can be copied from the log and modified to do what is desired and not stuck with the black box of import of XLSX with no real feedback.

TomHsiung
Pyrite | Level 9

Thanks for the response.

 

Yep, I ran the options statement first, before I ran the import script.

SAS OnDemand also encountered the same issue.

 

PS: The same codes was fine previously.

sas-innovate-white.png

Missed SAS Innovate in Orlando?

Catch the best of SAS Innovate 2025 — anytime, anywhere. Stream powerful keynotes, real-world demos, and game-changing insights from the world’s leading data and AI minds.

 

Register now

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 283 views
  • 0 likes
  • 2 in conversation