SAS Enterprise Guide

Desktop productivity for business analysts and programmers
BookmarkSubscribeRSS Feed
Mozer19
Fluorite | Level 6

I need to run a SAS program but I have an error when I executed.
I don't know about this error and never happens before, so, the error follows bellow :
/***** LOG ******/

154                                                                                                                                                                                                
155 DATA B_LDIG;
156 SET &LDIG.;
ERROR: The value 'Dígito'n is not a valid SAS name.
157 DIGITO = PUT('DÍGITO'N,Z2.);
ERROR: The name 'DÍGITO'n is not a valid SAS name.
158 RUN;

/***** CODE ******/

DATA B_LDIG;
      SET &LDIG.;
      DIGITO = PUT('DÍGITO'N,Z2.);
RUN;


I need a help because, I don't know how to convert the variable with especial character to be convert to without especial character .

1 REPLY 1
Tom
Super User Tom
Super User

To use such a variable you have to set VALIDVARNAME option to ANY.

Then you can use RENAME statement to change the name.

options validvarname=any;
DATA B_LDIG;
      SET &LDIG.;
      rename 'DÍGITO'N = DIGITO;
RUN;

How did the variable get that name to begin with?  Perhaps you can fix the issue earlier in the process. 

sas-innovate-white.png

Our biggest data and AI event of the year.

Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.

Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.

 

Register now!

Creating Custom Steps in SAS Studio

Check out this tutorial series to learn how to build your own steps in SAS Studio.

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
  • 1 reply
  • 692 views
  • 3 likes
  • 2 in conversation