DATA Step, Macro, Functions and more

Mainframe and SAS

Super Contributor
Posts: 713

Mainframe and SAS

In order to allow sas to use blanks and special characters in the variable name without causing errors, the follwoing piece of code is used.

for instance &&group&I resolves to Cozar 24 FE, and then in subsequent step Vgroup&1 is transformed to a variable. In PC SAS it throws an error due to spacing issue.This is not the case when SAS is run on Mainframe.
If I have to run this on PC sas this is giving me an error.How to resolve this?
Regular Contributor
Posts: 241

Re: Mainframe and SAS

I'd first check the validvarname option setting. You can simply call proc options or submit the following line:

   %put validvarname=%sysfunc(getoption(validvarname));

Super Contributor
Posts: 394

Re: Mainframe and SAS

Make sure you're using the VALIDVARNAME=ANY option.

"Note: If you use any characters other than the ones that are valid when the VALIDVARNAME system option is set to V7 (letters of the Latin alphabet, numerals, or underscores), then you must express the variable name as a name literal and you must set VALIDVARNAME=ANY."

See Rules for SAS Variable Names.
Super User
Posts: 10,787

Re: Mainframe and SAS

In addition to Tim@SAS.

options validvarname=any;

is only suited for sas/base and sas/stat

Ask a Question
Discussion stats
  • 3 replies
  • 4 in conversation