data have; input Name $ var1 var; datalines; Usa 2 5 Mad . 4 bad . 4 sad 2 . pad 2 . India . 2 Mad . . bad 9 . sad . . pad . . Aus . .1 Mad . . bad 9 . sad . . pad . .1 ; proc print data=have; run; data _null_; file 'D:\king.txt'; put @5 'NEW_names'; put ' '; run; data _null_; file 'D:\king.txt' mod; if _n_=1 then do; do Usa=1 to 5; put @5 'Usa'; end; end; if _n_=1 then do; do India=1 to 5; put @5 'India'; end; end; if _n_=1 then do; do Aus=1 to 5; put @5 'Aus'; end; end; run; data d; infile 'D:\king.txt' firstobs=2; input new_names $; run; proc print data=d; run; /*concatination*/ data fin; merge have d; run; proc print data=fin; run;
... View more