Take locations from Excel, fetch its type and generate new Excel with type DEFINE VARIABLE m_flepath AS CHARACTER FORMAT "x(40)" NO-UNDO . DEFINE VARIABLE m_fleout AS CHARACTER FORMAT "x(40)" NO-UNDO . DEFINE TEMP-TABLE tt_temp FIELD tt_loc AS CHARACTER . FORM m_flepath LABEL "File path " WITH FRAME a. REPEAT: m_fleout = "" . EMPTY TEMP-TABLE tt_temp . UPDATE m_flepath WITH FRAME a . m_fleout = SUBSTRING ( m_flepath , 1 , R-INDEX ( m_flepath , ".") - 1 ). m_fleout = m_fleout + "log" + ".xls" . INPUT FROM value(m_flepath) . REPEAT: CREATE tt_temp. IMPORT DELIMITER "," tt_temp. END. INPUT CLOSE. FOR EACH tt_temp WHERE trim(tt_loc) = "" NO-LOCK : DELETE tt_temp . END. /* for each */ DO ON ERROR UNDO, RETRY : OUTPUT TO value(m_fleout). FOR EACH tt_temp NO-LOCK :