As the last 4 pages of discussion has been trying to tell you -- we need information from you to do that. Sure, I can ignore your script, and have nothing to go on at all...
You've got examples good enough for you to plug in the filename and go. If you want us to do that, we need to know it. You don't know where the file actually is anyway and I can't tell you, because my crystal ball has been stuck in maintenance for years.
Once you do, it's a simple matter of copy-pasting it into one of the things given to you in this thread, vi myprogram ; chmod +x myprogram ; ./myprogram.
If you know that sftp will, then of course it will: They use the exact same protocol. They talk to the same daemon.
Do you know that sftp will work? This might be a wild goose chase -- we have no idea what your mainframe is. It might be something strange, by the sound of it. Have you tried from a terminal, for instance?
We don't know what your UNIX is, for that matter! Both would let us write more complete/working examples.
If you know for a fact that sftp will work, then we're nearly done. You can just put it into one of the examples given and do it.
---------- Post updated at 04:46 PM ---------- Previous update was at 04:28 PM ----------
Here is as complete an example as can be written without knowing what your systems are. It might not be quite right, but I get the feeling I might be heading home sooner than I can find out what you haven't told us yet.
1) Create a file. If you have vi, 'vi filename'. If you have nano, 'nano filename'. If you have emacs, 'emacs filename'. If you have pico, 'pico filename'. And so forth. We don't know your system or text editor yet.
2) The file should look like this:
#!/bin/sh
# Replace /path/to/remote/file with whatever your remote file actually is.
sftp username@host <<EOF
get /path/to/remote/file
EOF
3) Set it executable: chmod +x ./myprogram
4)Run it: ./myprogram
5) Tell us if it didn't work: In detail, not "IT DIDNT WORK".