It is good to comment on the macro code, to better understand how it works... Use options mprint mlogic to better understand what is going on when the macro is executed... First, you have to trim trailing spaces from the test string : CALL SYMPUT ("NAMEVAR",trim(target)); The dataset crawler remains empty because there is nothing written to the dataset... An output statement before the stop statement would write a line to the crawler dataset... data crawler; do b=&b; set source point=b; y=index(line,"&NAMEVAR"); end; output; stop; run; The datastep generated by the macro also is generated at every loop .... when executing one after the other, the same dataset is recreated at every datastep boundary.. so you would only see the last result ... When for example using the counters in the dataset name : data crawler&b&d; a dataset is generated for every iteration.. showing the results....
... View more