Hi, Kim:
This does not really seem like an ODS question, but more of a DATA step INFILE/INPUT statement question.
As you noted, the macro variable &x is NOT resolved in the input buffer, so when your INPUT statement tries to read it from the buffer, SAS sees non-numeric characters where it is expecting to see numeric characters. In fact, the documentation on the SAS Macro facility states that:
"You can define and use macro variables anywhere in SAS programs, except within data lines." Since &x is a macro variable reference you cannot "technically" use it within your data lines.
If all you need to do is change con2 to the value of &x for the "beta" row (when _n_ = 1), then this would work in your existing program (as you have presented the hypothetical data):
[pre]
if firms = 'beta' and _n_ = 1 then do;
con2 = input("&x",8.0);
end;
[/pre]
If &x is in the global symbol table when the DATA step program executes, then the value for &x will be translated from character to numeric by the INPUT function (different from the INPUT statement). You will still see a warning in the LOG that there was a problem trying to read &x as a number.
I worry a bit about your usage of the term "script" and your reference to using CALL SYMPUT to set the value of X. Generally, you use CALL SYMPUT within a DATA step program to set the value of a macro variable (in the global symbol table) from some value within a DATA step program at execution time. This implies to me, somehow that the value of the macro variable &x might be changing based on the value of some variable in some -other- DATA step program.
A DATA step program has similarities to scripting languages (like JavaScript, PHP or VB), but I would not consider a DATA step program to be a script. Also, your DATA step program (where you use call symput), could itself be contained within a SAS macro program -- and if this is the case, then, the above solution might not be the best one for your ENTIRE program, including the piece with the CALL SYMPUT. If you are not familiar with SAS macro programming conventions, you might consider contacting Tech Support with the entire text of your program to make sure that you are using the Macro facility in the best way. It seems unusual (to me) that a single
variable value in "raw" datalines or a "raw" data file would change based on a macro variable.
To contact Tech Support, go to:
http://support.sas.com/ctx/supportform/index.jsp
cynthia