Hi, I am struggling to pass a numeric value through a sas macro. Program1 generates two macros, prodname and prodcost. Program2 filters the data by using the character value that we have stored through program1- this program is working fine. Program3 is intended to filter the data by using the numeric value that we have stores through program2- this program is not working. details of the programs are provided below. Program1 proc sql; select prodname, prodcost into: prodname, : prodcost from procsql.products; quit; %put &prodname and &prodcost; When I want to use the macro (prodname) that recalls the character value, works perfectly fine. the following program runs perfectly fine: Program2 proc sql; select prodname, prodcost from procsql.products where prodname = "&prodname"; quit; Program3 However, when I use the same program to recall the macro that holds the numeric values, it throws me an error. proc sql; select prodname, prodcost from procsql.products where prodcost > &prodcost; quit; the log shows the following error: ERROR 22-322: Syntax error, expecting one of the following: a name, a quoted string, a numeric constant, a datetime constant, a missing value, BTRIM, INPUT, PUT, SUBSTRING, USER. Any help would be appreciated.
... View more