View previous topic :: View next topic
|
Author |
Message |
Mary Lewis
New User
Joined: 25 Dec 2007 Posts: 15 Location: Albany, NY
|
|
|
|
I am trying to mainframe FTP (IBM FTP CS V1R7) multiple files from my agency server to the mainframe. With the GET subcommand you are able to specify a from and to file name in the FTP JCL. With the MGET you can only specify the from file names.
The users will move files into the folder to be FTP'd from. Then they will submit a generic FTP JCL to grab all files in the folder. There can be any number of files present. They are named similarily, with a 3 digit code being the only difference in file name, so I can use the wildcard (*) in the file name for the MGET. That part works fine. It GETs all the files in the folder.
The problem lies with the mainframe file name. Because I can't specify a to file name, the mainframe system default is to put the userid as the prefix to the file name. When I do a single GET I put single quotes around the mainfram file name to override the default. With the MGET, how can I override?If I do multiple GET's for each possible file name, I get bad return codes when the file is not found. I would rather do a wildcard MGET. |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
Mary Lewis wrote: |
With the GET subcommand you are able to specify a from and to file name in the FTP. |
True.
Mary Lewis wrote: |
With the MGET you can only specify the from file names. |
Again, true.
Mary Lewis wrote: |
The users will move files into the folder to be FTP'd from. Then they will submit a generic FTP job to grab all files in the folder. There can be any number of files present. They are named similarily, with a 3 digit code being the only difference in file name, so I can use the wildcard (*) in the file name for the MGET. That part works fine. It GETs all the files in the folder.
|
OK so far. FTP is working as the internet standards specify.
Mary Lewis wrote: |
The problem lies with the mainframe file name. Because I can't specify a to file name, the mainframe system default is to put the userid as the prefix to the file name. |
Yep.
Mary Lewis wrote: |
With the MGET, how can I override |
You can't, the protocol specifications don't allow for a target filename with MGET or MPUT. I'd just stick with the default where the datasets are prefixed with the userid. Or, pull a directory list first, create a DD statement and GET command for each filename listed, and then run the FTP process. |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
Mary, for what its worth, the IBM implementation of FTP supports an output listing from either the list (LS) or directory (DIR) commands. You can use this feature in a TSO/E REXX exec to create a full list of available files:
Code: |
/* REXX */
Queue "ls (Disk"
Queue "qui"
"FTP sitename 21 (Exit"
"ALLOC FI(lsoutput) DA('"Userid()".FTP.LSOUTPUT') SHR REU"
"EXECIO * DISKR lsoutput (STEM ls. FINIS"
"FREE FI(lsoutput)"
Do n = 1 To ls.0
... do something with the list entries ...
End
Exit 0
|
|
|
Back to top |
|
|
Mary Lewis
New User
Joined: 25 Dec 2007 Posts: 15 Location: Albany, NY
|
|
|
|
Thanks, Kevin. I was afraid it couldn't be done! We will look into the REXX idea. |
|
Back to top |
|
|
|