Code: %let var1=name,age; proc sql; create table test1 as select &var1., sex from sashelp.class; quit; proc sql; create table test2 as select &var1., weight from sashelp.class; quit; proc sql; create table test3 as select &var1., height from sashelp.class; quit; data final; set test1 test2 test3; run; Output: Alfred 14 M . . Alice 13 F . . Barbara 13 F . . Carol 14 F . . Henry 14 M . . James 12 M . . Jane 12 F . . Janet 15 F . . Jeffrey 13 M . . John 12 M . . Joyce 11 F . . Judy 14 F . . Louise 12 F . . Mary 15 F . . Philip 16 M . . Robert 12 M . . Ronald 15 M . . Thomas 11 M . . William 15 M . . Alfred 14 112.5 . Alice 13 84 . Barbara 13 98 . Carol 14 102.5 . Henry 14 102.5 . James 12 83 . Jane 12 84.5 . Janet 15 112.5 . Jeffrey 13 84 . John 12 99.5 . Joyce 11 50.5 . Judy 14 90 . Louise 12 77 . Mary 15 112 . Philip 16 150 . Robert 12 128 . Ronald 15 133 . Thomas 11 85 . William 15 112 . Alfred 14 . 69 Alice 13 . 56.5 Barbara 13 . 65.3 Carol 14 . 62.8 Henry 14 . 63.5 James 12 . 57.3 Jane 12 . 59.8 Janet 15 . 62.5 Jeffrey 13 . 62.5 John 12 . 59 Joyce 11 . 51.3 Judy 14 . 64.3 Louise 12 . 56.3 Mary 15 . 66.5 Philip 16 . 72 Robert 12 . 64.8 Ronald 15 . 67 Thomas 11 . 57.5 William 15 . 66.5
... View more