This code works fine if I run it in the Progress Editor. If I save this as a .p file and click on right button "RUN", it gives me an error that database doesn't exist. I understand that maybe I should insert some code to connect to a database. Does anybody know what statement I should use? DEF STREAM st1. OUTPUT STREAM st1 TO c:\temp\teste.csv. FOR EACH bdName.table NO-LOCK: PUT STREAM st1 UNFORMATTED bdName.Table.attr ";" SKIP. END. OUTPUT STREAM st1 CLOSE. Continue reading...