Mainframe FTP - wild card files?



Ask queries about other IBM Tools like Tivoli, COBTEST, Fault Analyzer, z/OS File Manager, Workload Simulator, APA, SCLM, Merge & Migration Tools etc...

Mainframe FTP - wild card files?

Postby vespa » Mon Jul 27, 2009 10:35 pm

We need to pick up several files with the same prefix and transfer the files from the server to mainframe via mainframe FTP.
I reviewed the FTP manual and do not see an option to wild card the files? Is there a command to handle this? Thanks.

Files in C:\file_folders

file1.txt
file2.txt
file3.txt
file4.txt
.......

/Step001    EXEC PGM=FTP                                 
//           PARM='server name (TIMEOUT 120, EXIT=8'         
//SYSPRINT DD   SYSOUT=*                                   
//OUTPUT   DD   SYSOUT=*                                   
//DDOUT1   DD   DSN=XXXXX,DISP=OLD                           
//SYSIN   DD *
user name                                             
password                                                     
get c:\file_folders\file*.txt +
   //DD:DDOUT1
quit     
/*
vespa
 
Posts: 19
Joined: Thu Jul 23, 2009 5:30 am
Has thanked: 0 time
Been thanked: 0 time

Re: Mainframe FTP - wild card files?

 

Re: Mainframe FTP - wild card files?

Postby MrSpock » Mon Jul 27, 2009 10:44 pm

User avatar
MrSpock
Global moderator
 
Posts: 810
Joined: Wed Jun 06, 2007 9:37 pm
Location: Raleigh NC USA
Has thanked: 0 time
Been thanked: 2 times

Re: Mainframe FTP - wild card files?

Postby MrSpock » Mon Jul 27, 2009 10:48 pm

My preference for your situation, is to first use DIR or LS to retrieve a directory listing of all of the target remote file names. Then, build individual GET statements for each filename listed. You have to be careful using the wildcard-type commands since they will be executed on the remote server, and can cause memory shortages if the remoter server has a lot of FTP activity running on it. And, of course, you have to have an pre-existing agreement for the file naming standards used for both ends of the transfer.
User avatar
MrSpock
Global moderator
 
Posts: 810
Joined: Wed Jun 06, 2007 9:37 pm
Location: Raleigh NC USA
Has thanked: 0 time
Been thanked: 2 times

Re: Mainframe FTP - wild card files?

Postby vespa » Tue Jul 28, 2009 2:11 am

MrSpock, thanks for your reply. As this will be an automate daily process and the total number of files in the folder is varied on a daily basis,
will it work if I use the MGET and change the mainframe dataset to disp=MOD instead of disp=OLD?

/Step001    EXEC PGM=FTP                                 
//           PARM='server name (TIMEOUT 120, EXIT=8'         
//SYSPRINT DD   SYSOUT=*                                   
//OUTPUT   DD   SYSOUT=*                                   
//DDOUT1   DD   DSN=XXXXX,DISP=MOD                         
//SYSIN   DD *
user name                                             
password                                                     
MGET c:\file_folders\file.txt +
   //DD:DDOUT1
quit     
/*
vespa
 
Posts: 19
Joined: Thu Jul 23, 2009 5:30 am
Has thanked: 0 time
Been thanked: 0 time

Re: Mainframe FTP - wild card files?

Postby MrSpock » Tue Jul 28, 2009 5:13 am

Please review the documentation on the various FTP commands. The DDNAME support is only available for the PUT and GET commands. Like I said, for MGET and MPUT you and the other site need to agree on file names since they can't be renamed in transit. If you REALLY want to use MGET, then I'd suggest that your local dataset be a PDS, with each file retrieved via MGET as a unique member name.
User avatar
MrSpock
Global moderator
 
Posts: 810
Joined: Wed Jun 06, 2007 9:37 pm
Location: Raleigh NC USA
Has thanked: 0 time
Been thanked: 2 times


Return to Other IBM Tools

 


  • Related topics
    Replies
    Views
    Last post