Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

How to Override System Defaults in File names for FTP MGET

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> All Other Mainframe Topics
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    Post subject: How to Override System Defaults in File names for FTP MGET
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

Moderator Team Head


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

PostPosted: Wed Dec 26, 2007 8:58 pm    Post subject: Re: How to Override System Defaults in File names for FTP MG
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

Moderator Team Head


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

PostPosted: Wed Dec 26, 2007 9:14 pm    Post subject: Reply to: How to Override System Defaults in File names for
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    Post subject: Reply to: How to Override System Defaults in File names for
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    IBMMAINFRAMES.com Support Forums -> All Other Mainframe Topics All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Changing of LRECL of a file abdulrafi DFSORT/ICETOOL 2 Fri Mar 24, 2017 3:25 pm
No new posts splitting a file abdulrafi DFSORT/ICETOOL 4 Fri Mar 24, 2017 11:51 am
No new posts Receive a file using PCOMM macro Harald.v.K IBM Tools 0 Thu Mar 23, 2017 6:50 pm
No new posts Export flat file data into excel sheet murali.andaluri DFSORT/ICETOOL 2 Mon Mar 20, 2017 5:39 pm
No new posts Formatting VB File Learncoholic DFSORT/ICETOOL 3 Mon Mar 20, 2017 12:29 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us