My coauthor and I are trying to download data from a WRDS dataset using desktop Stata (17). The following code succeeds in downloading a very small sample:

Code:
local vars  "fyear,ceq,conm,ni"

local gvkeylist "'001891', '001300', '028924'"

jdbc load, exec("select `vars' from comp.funda where fyear between 2018 and 2020 and gvkey in (`gvkeylist') ")
We need to read data not just for the 3 gvkeys currently specified in gvkeylist, but for several thousand stored in a csv file key1.csv. key1.csv has one gvkey per row and is stored on the local hard drive. (It should be easy to add the surrounding single pops if necessary.) Is there a way to read the file into the local gvkeylist? Or is some other strategy required?

Thanks,
Devra