There are ways to print the names without knowing the names. Another method might use CALL VNEXT.
[pre]
396 data _null_;
397 file log dsd;
398 if _n_ eq 1 then do;
399 if 0 then set sashelp.shoes;
400 put (_all_) (=) @;
401 _file_ = compress(tranwrd(_file_,'=',','),' .');
402 _file_ = substr(_file_,1,length(_file_)-1);
403 put;
404 end;
405 set sashelp.shoes(obs=30);
406 put (_all_)(:);
407 run;
Region,Product,Subsidiary,Stores,Sales,Inventory,Returns
Africa,Boot,Addis Ababa,12,"$29,761","$191,821",$769
Africa,Men's Casual,Addis Ababa,4,"$67,242","$118,036","$2,284"
Africa,Men's Dress,Addis Ababa,7,"$76,793","$136,273","$2,433"
Africa,Sandal,Addis Ababa,10,"$62,819","$204,284","$1,861"
Africa,Slipper,Addis Ababa,14,"$68,641","$279,795","$1,771"
Africa,Sport Shoe,Addis Ababa,4,"$1,690","$16,634",$79
Africa,Women's Casual,Addis Ababa,2,"$51,541","$98,641",$940
Africa,Women's Dress,Addis Ababa,12,"$108,942","$311,017","$3,233"
Africa,Boot,Algiers,21,"$21,297","$73,737",$710
Africa,Men's Casual,Algiers,4,"$63,206","$100,982","$2,221"
[/pre]