I am using a SAS macro to execute a function whereby one of the input parameters is from a SAS data table and the second parameter (date) is hardcoded, like this-
data _null_;
set RTick.Co_list;
call execute('%trade_participation(01012013,'|| scrip10 ||');');
run ;
The macro looks as follows-
%macro trade_participation(date,scrip10);
data Trade_data (drop = time Record_ind segment series trade_no symbol trd_prc trd_q trade_time
buy_order_no buy_client_flg buy_algo_ind sell_order_no sell_client_flg sell_algo_ind);
set Rttrade.Cash_trades_&date;
if symbol = "&scrip10";
if Record_ind = "RM";
if segment = "CASH";
if series = "EQ";
time = trade_time/65536;
time = time/3600;
timeseqno = int((time-9)*60)+1;
if timeseqno > 15;
if (buy_client_flg = 2)&((buy_algo_ind = 0)|(buy_algo_ind = 2)) = 1 then buy_HFT = 1;
if (sell_client_flg = 2)&((sell_algo_ind = 0)|(sell_algo_ind = 2)) = 1 then sell_HFT = 1;
trade_val = trd_prc*trd_q/100;
run;
/* more SAS code to do a bunch of other tasks to do on the subsetted
file Trade_data */
%mend;
The problem I am facing right now is that some of the input values in the Co_list file (scrip10 variable) have special characters, such as 'bbbbbbM&M' or 'BAJAJ-AUTO'. As soon as these pass through the macro, it fails - 'Apparent symbolic reference M not resolved.' (for the first example -bbbbbbM&M')
Can anyone suggest a workaround?