So I want to make a program that loads a dataset, and optinally keep some variables. I am unable to copy the code from the server, so I am giving a small example

Code:
program load_dataset
syntax anything [, keep_list(varlist)] use "`anything'" if !missing("`keep_list'") {
[INDENT=2]keep `keep_list'[/INDENT]
}
  end
I then run the code (the global is a string with pathname)

Code:
load_dataset $sample_data, keep_list(year family income)
And then get the error:
"no variables defined" (error in option keep_list())

I suspect it is because these variables do no yet exist, which they of course won't until I load the data set. Is there something I am missing? Or do I have to solve it in some other way, for example passing the varlist as a string instead?