I think what gets you confused is the 'variable name' and 'variable type' in the Hash definition. The quoted notion such as 'student_skey' in e.definekey('student_skey'); has nothing to do with the 'variable type', it merely addresses the 'variable name', where the variable can be either Char or Num, defined by incoming table or PDV. See following example, data _null_; if _n_=1 then do; if 0 then set sashelp.class; declare hash h(dataset: 'sashelp.class'); /* h.definekey('age');*/ new_age='age'; h.definekey(new_age); h.definedata('name'); h.definedone(); end; rc=h.output(dataset:'help'); run; So quoted or not merely saying whether it is a 'string' or a variable. If it is a 'string', then 'string' itself is the variable name, if not quoted (variable), the content of the variable is the variable name. Haikuo
... View more