Hi,
Just let you know that the drop option works in sas 9.3.
data _null_;
if 0 then set sashelp.class;
dcl hash h();
h.definekey('name');
h.definedata('name', 'age');
h.definedone();
do obs = 1 to nobs;
set sashelp.class nobs=nobs;
h.add();
end;
h.output(dataset: "work.class(drop=age)");
stop;
run
;
proc print data=class;
run
;
Obs Name
1 John
2 Alice
3 Henry
4 Joyce
5 Janet
6 Judy
7 William
8 Mary
9 James
10 Barbara
11 Carol
12 Ronald
13 Louise
14 Thomas
15 Alfred
16 Robert
17 Jane
18 Philip
19 Jeffrey
Linlin
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.