Hi, thank you for the suggestion. Tried the code, but got an error "kolomname exists". Therefor modified the code and tried several combinations. Enclosed the final code (one of the 75), which is running now for a few days without any issues. The use of templates ensures the consistend location of the columns. In case of shifting columns this code won't work, because it assume's that Column 1 is always on the first position etc. I am aware that there are opportunities for better efficient coding. On the otherside, it's in a transperant and readible way. LIBNAME TMP00001 "E:\SAS94\Lev1\Data\SASVisualAnalytics\ETPmanualUpload";
*POLAND;
data ETP_UPL_PL_PLASTICS_2019;
set TMP00001.'etp_upl_pl_PLASTICS_2019'n;
if 'Volume (in Ton)'n > 0;
run;
proc transpose data=ETP_UPL_PL_PLASTICS_2019(obs=0) out=vars;
var _all_;
run;
filename PTPL2019 temp;
data _null_;
file PTPL2019;
set vars;
put 'Rename "' _name_ '"n=Col' _n_ ';';
run;
proc datasets;
modify ETP_UPL_PL_PLASTICS_2019;
%inc PTPL2019;
run;
quit;
data ETP_UPL_PL_PLASTICS_2019 (drop=Col1 Col2 Col3 Col4 Col5 Col6 Col7 col8 Col9 Col10 Col11 Col12);
set ETP_UPL_PL_PLASTICS_2019;
format Upload_Date date9.;
Upload_Date = Col1;
Country_ISO = 'PL';
Month_No = input(Col3, best.);
Year = input(Col4, best.);
Customer_Name_Local = put(Col5, $55.);
Customer_type = put(substr(Col6,1,1),$25.);
Plastic_Grade_Name = input(Col7, $50.);
Plastic_Group_Grade = input(Col8, $50.);
Volume_Ton = input(Col9, best.);
EXW_SalesPrice_Ton = input(Col10, best.);
Sales_Area = input(Col11, $10.);
'EU/EXP/VAR'n = input(Col12, $15.);
run;
... View more