IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

How to Override System Defaults in File names for FTP MGET


IBM Mainframe Forums -> All Other Mainframe Topics
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Mary Lewis

New User


Joined: 25 Dec 2007
Posts: 15
Location: Albany, NY

PostPosted: Wed Dec 26, 2007 8:33 pm
Reply with quote

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
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Wed Dec 26, 2007 8:58 pm
Reply with quote

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
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Wed Dec 26, 2007 9:14 pm
Reply with quote

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
View user's profile Send private message
Mary Lewis

New User


Joined: 25 Dec 2007
Posts: 15
Location: Albany, NY

PostPosted: Wed Dec 26, 2007 10:15 pm
Reply with quote

Thanks, Kevin. I was afraid it couldn't be done! We will look into the REXX idea.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> All Other Mainframe Topics

 


Similar Topics
Topic Forum Replies
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Sysplex System won't IPL at DR site I... All Other Mainframe Topics 2
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts Access to non cataloged VSAM file JCL & VSAM 18
Search our Forums:

Back to Top