in reply to Connect:Direct?

I'm in the same boat myself. We were using Korn shell scripts to run the transfers and I've put them into a module that basically simply forms out to a Korn shell library program. Not clean, but works for now. I'm going to take a closer look at the routine someone posted below. What I'm doing (simplified):

qx/$ndm_korn_lib $file $DSN $BLOCK $RFORM $RLENGTH/;
Where $ndm_korn is the path to the Korn library, $file is the file to send, $DSN is the Mainframe dataset and $BLOCK, $RFORM and $RLENGTH are the Blocksize, Record Format and Record Length on the main frame. Not pretty at all, but it seems to work (for the moment).