Sending Data From Mesa 2 to DBExpert

Feel free to copy and paste this DBExpert macro for your own use.

/* This script will automate the import text process. */

/* Call some functions from Mesa 2 and REXX */
CALL RxFuncAdd 'POSTMESACOMMAND','MESASCPT.DLL','POSTMESACOMMAND'
CALL RxFuncAdd 'SysSleep','RexxUtil','SysSleep'

/* items for both Mesa 2 and DBExpert */
fileName="E:\Mesa2SQL\Imported.txt"
delimiter = ","

/* items for DBExpert */
titlesOnFirstRow = "FALSE"
isItDelimited = "TRUE"
destination = "DataFromMesa2"
widths = ""
dateTimeFmt = ""

/* get Mesa 2 to send the data to a file */
mesaCommand="EXPORTTEXT(" || """"fileName"""" || ", " || """"delimiter"""" || ")"
rc=POSTMESACOMMAND(mesaCommand)

/* a second of sleep for the file to become unlocked */
rc=SysSleep(1)

/* get DBExpert to take the data from the file */
rc=dbeImport(fileName, titlesOnFirstRow, isItDelimited, delimiter, widths, dateFmt, destination)