| Transferring Multiple Files |
Back |
Vista has file upload and download processing that you can invoke by clicking the Transfer menu option, or the toolbar buttons with the up arrow (upload from PC to mainframe) and down arrow (download from mainframe to PC).
For example, to upload a single file or member I can click the Browse button at the upper left and select test.txt from my Downloads directory. Then double click the file name in the lower left box and the file name gets copied to the target host file field, which is a valid DSNAME in this case, so I'll use it. Then get to READY mode on the mainframe and click Send to upload the file.
Multiple Member Upload
So that's a single file upload. But let's say I have a directory with multiple 8 character names in it, such as shown below at the left:
You could of course transfer each of those 8 character filenames by typing a PDS name and member name in the target field, such as T.CLIST(#SAVELAB) then upload, then do the same over and over for all the files.
Or you can use an asterisk in the source field, and a PDS with an asterisk in the target field, such as:

When you press Send with asterisks, the program assumes you're transferring multiple files. Since IND$FILE on the mainframe can only transfer one file at a time, Vista simply runs the transfer window over and over for each file until done. Remember to just wait and don't push any buttons on the transfer window while the automated processing is happening.
You can also select a portion of the members, for transfer, such as:
Internally, when Vista sees you are trying to transfer multiple files (by either selection or asterisk) it doesn't start the transfers immediately. Instead, it simply creates a temporary Vista Macro named vst$A$xfer.mac in C:\Users\Tom\Documents\TomBrennanSoftware\VistaTN3270\macros and adds as many SendFile() statements as needed for the multiple transfer. For example, the 3 member transfer above produced a macro with 3 lines:
SendFile("C:\Users\Tom\Downloads\savelab-master\savelab- master\SAVELAB.PANELS\#SAVELAB","T.CLIST(#SAVELAB)","TEXT","REPLACE","TSO")
SendFile("C:\Users\Tom\Downloads\savelab-master\savelab-master\SAVELAB.PANELS\SAVELAB","T.CLIST(SAVELAB)","TEXT","REPLACE","TSO")
SendFile("C:\Users\Tom\Downloads\savelab-master\savelab-master\SAVELAB.PANELS\SAVELABD","T.CLIST(SAVELABD)","TEXT","REPLACE","TSO")
Then the Send processing simply closes the Transfer window without doing anything, and runs the temp macro. Each SendFile statement in the macro re-opens the Transfer window to do each individual transfer. This was the simplest way I could think of to implement multiple file transfer capability, while still giving the user visibility of what is happening in case something goes wrong.
Multiple File Upload
In addition to Members, you can also select multiple files for upload. In this case it helps if the source files on your PC are named as valid DSNAMES. For example, here I've selected 3 files on my PC and typed an * at the right. This triggers the multiple file upload processing:
Note that in this case I needed to type *.TEXT in the Target field because the * will be converted to just the filename portion of the source, without the extention portion. So the resulting files are:
Multiple Dataset Download
Downloading multiple datasets from the mainframe is also possible, but a bit more complex. You saw in the upload processing that the transfer window will automatically show you all files in the source directory when you select any file there, giving you a chance to select more than one. But the download transfer window shows no datasets in the source listing:
This is where the List and Members buttons can come in handy. If you get to READY mode in TSO and click the List button, a LISTCAT command is issued and the list should be filled up with a list of your datasets, such as the list below, where I found the 3 test files I want to download, and added an * to the Target field to trigger the multiple file process:

And after pressing Receive above and waiting a bit, all 3 files were downloaded to the specified directory in my test.
Multiple Member Download
Similarly, we can select a PDS in the Source list and click the Members option for a list of existing members that we can then select, such as:
And those members end up as check1.txt and check2.txt in the target PC directory.
Note that the logic for the selection with asterisks is not that well defined, so it may take a few tries before you get what you want. But hopefully it's possible to save a lot of manual effort when uploading/downloading multiple files or members via IND$FILE, which really was designed for one file at a time so this logic is a bit of a workaround.
|