BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Patrick
Opal | Level 21

The names in your table work.edu don't comply with SAS naming conventions. SAS(R) 9.3 Language Reference: Concepts, Second Edition

With"validvarname=any" you still can define such variable names in your tables but you need to quote them as literals everywhere in your code in the form: '0-2'n

I have also made the experience that some of the SAS Enterprise Guide wizards don't quote such variable names so with such names you can end up that wizard generated code doesn't work.

It is best to always use variable names which comply with the SAS naming standards. If you're using the EG import wizard then select the option (tick-box) which automatically converts non-complying variable names to complying ones during imports.

If you have already a data set from somewhere else then I would suggest you rename the variables. For your example you could use syntax as below.

proc datasets lib=work nolist;

  modify edu;

    rename

      '0-2'n    =_0_2

      '13-15'n  =_13_15

    ;

    label

      _0_2    = '0-2'

      _13_15  = '13-15'

    ;

  run;

  contents data=edu;

  run;

quit;

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
How to connect to databases in SAS Viya

Need to connect to databases in SAS Viya? SAS’ David Ghan shows you two methods – via SAS/ACCESS LIBNAME and SAS Data Connector SASLIBS – in this video.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 15 replies
  • 1916 views
  • 0 likes
  • 5 in conversation