Selecting file to import at runtime

When data importing, sometimes we need to import a CSV file. To make the code flexible it is best to make the filename a variable and allow the user to select the file they want to import. This can be done in a class or a job using the Dialog control.

A code example is as follows:

Dialog Dialog;
DialogField filename;
Dialog = new Dialog(“Select File”);
filename = Dialog.addField(extendedTypeStr(filenameopen), “@SYS53125”);
Io = new CommaIO(filename.value(), “r”);
data =;
while(Io.status() == IO_Status::Ok)
data =;

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s