For a university research project I am retrieving data from WRDS via SAS and am relatively new to SAS. I am trying to retrieve data in a specific interval provided by WRDS which
This line is just wrong.
%local stock = "COP";
You are trying the define local macro variables named = and "COP". You probably meant to do this.
=
"COP"
%local stock ; %let stock = "COP";