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 download multiple files from FTP server to mainframe?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> All Other Mainframe Topics
View previous topic :: :: View next topic  
Author Message
raj12vel

New User


Joined: 20 Dec 2008
Posts: 43
Location: New Jersey

PostPosted: Wed Jul 15, 2009 11:21 pm    Post subject: How to download multiple files from FTP server to mainframe?
Reply with quote

Hi All,

I have 22 files in SAS server. I want to download all the 22 files from FTP server to mainframe as a single file.

I have tried APPE and MGET comand. but not getting the actual result.

can any one help me how to append the files in mainframe from server?
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 Jul 15, 2009 11:29 pm    Post subject: Reply to: How to download multiple files from FTP server to
Reply with quote

What would I do in this case?

Run the FTP the first time and do a member list (LS) command and pull that information back into a dataset. Read that datatset, and dynamically build 22 seperate GET commands, all pointing to the one single DD for my local dataset. That DD would, of course, be specified in the allocation with DISP=MOD.

Run the FTP a second time, using the 22 dynamically built GET commands.
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 Jul 15, 2009 11:31 pm    Post subject: Reply to: How to download multiple files from FTP server to
Reply with quote

Do these filenames conform to normal MVS dataset naming conventions? If so, I have other ideas as well.
Back to top
View user's profile Send private message
raj12vel

New User


Joined: 20 Dec 2008
Posts: 43
Location: New Jersey

PostPosted: Wed Jul 15, 2009 11:35 pm    Post subject:
Reply with quote

Code:

//FTP1     EXEC PGM=FTP,                                   
//            REGION=2M,                                   
//            PARM='/(EXIT'                               
//SYSPRINT DD SYSOUT=*                                     
//SYSDEBUG DD SYSOUT=*                                     
//OUTPUT   DD SYSOUT=*                                     
//INPUT    DD *                                           
3.182.39.29                                               
userid                                                     
password                                                   
CD folder name in server                                   
GET Amx_PLCC_final.txt  +                                 
          'X1GPTLH.RCF.CLOSE08.CLI.ACCTS.JUL15' (replace   
QUIT                                                       
/*                                                         


That is my code to download a single file from server.
want to know how can we download multiple files from server to the same file name in mainframe?
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 Jul 15, 2009 11:40 pm    Post subject: Reply to: How to download multiple files from FTP server to
Reply with quote

22 GET's or 22 APPEND's. I don't see any other options that don't involve using something like PKZIP. Maybe someone else does?
Back to top
View user's profile Send private message
raj12vel

New User


Joined: 20 Dec 2008
Posts: 43
Location: New Jersey

PostPosted: Wed Jul 15, 2009 11:46 pm    Post subject:
Reply with quote

Do u know, how to give append command for this issue?
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7913
Location: Bellevue, IA

PostPosted: Thu Jul 16, 2009 12:02 am    Post subject:
Reply with quote

The APPEND FTP command is used like a PUT command -- not a GET command. AFAIK, there is no way to accomplish the requested task except the procedure Kevin outlined -- get the names, generate a sequence of GET commands, then run them through another FTP session. FTP is oriented around transfer of one (or more) files -- it wasn't designed to transfer multiple files to one file.
Back to top
View user's profile Send private message
raj12vel

New User


Joined: 20 Dec 2008
Posts: 43
Location: New Jersey

PostPosted: Thu Jul 16, 2009 12:11 am    Post subject:
Reply with quote

is that possible to use MGET command?

If so, just give me the syntax?
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7913
Location: Bellevue, IA

PostPosted: Thu Jul 16, 2009 12:20 am    Post subject:
Reply with quote

You can use the MGET command, but be aware that you will not get one file on the receiving end -- you will get one file per sending file, or 22 files per the original post.

Depending upon the default settings, you may need to use PROMPT (which toggles the prompting to download each individual file). The FTP command is MGET * to retrieve all files from the current working directory on the remote server. MGET file1 file2 file3 would retrieve from the remote server file1, then file2, then file3 -- storing them as three separate files on the local machine.
Back to top
View user's profile Send private message
raj12vel

New User


Joined: 20 Dec 2008
Posts: 43
Location: New Jersey

PostPosted: Thu Jul 16, 2009 12:24 am    Post subject:
Reply with quote

Thanks for your quick reply.

Can you please give me the code with syntax for 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: Thu Jul 16, 2009 12:34 am    Post subject: Reply to: How to download multiple files from FTP server to
Reply with quote

Robert, you're right. My bad about the APPEND command. icon_redface.gif

Unfortunately, from what the OP has shown, unless those filenames are changed to conform to normal MVS dataset naming conventions, I don't see using the MGET command.
Back to top
View user's profile Send private message
raj12vel

New User


Joined: 20 Dec 2008
Posts: 43
Location: New Jersey

PostPosted: Thu Jul 16, 2009 12:41 am    Post subject:
Reply with quote

Yes, you are right.

I have used the MGET *.txt local file name.

but got the error as ' No such file or directory.'

EZA1685W Invalid local file identifier

can you tell me what is MVS naming conventions?
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: Thu Jul 16, 2009 12:55 am    Post subject: Reply to: How to download multiple files from FTP server to
Reply with quote

This is from your example:

'X1GPTLH.RCF.CLOSE08.CLI.ACCTS.JUL15'

Multiple nodes, each seperated by a period. A node may be 1-8 alphanumeric characters, but must start with a national character (A-Z, #, or $). No blanks or underscores or other characters.
Back to top
View user's profile Send private message
raj12vel

New User


Joined: 20 Dec 2008
Posts: 43
Location: New Jersey

PostPosted: Thu Jul 16, 2009 12:57 am    Post subject:
Reply with quote

Thats what i have given as the file name rt

then why is not accepting?
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: Thu Jul 16, 2009 1:05 am    Post subject:
Reply with quote

raj12vel wrote:
I have used the MGET *.txt local file name.


I presume you meant just MGET *.txt as per the protocol standard:

5.41 MGet subcommand--Copy multiple files.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7913
Location: Bellevue, IA

PostPosted: Thu Jul 16, 2009 1:17 am    Post subject:
Reply with quote

You can't provide a local file name with the MGET command -- all operands on the MGET are remote server file names.

Should you need more assistance, could you post your FTP commands as you have them (we don't need the IP address, user id, or password) in the output of the FTP job so we can see exactly what you've got?
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: Thu Jul 16, 2009 1:26 am    Post subject: Reply to: How to download multiple files from FTP server to
Reply with quote

My job, as I originally mentioned, would look something like this:

Code:

//STEP0001 EXEC PGM=FTP,PARM='server.address (Exit=8'         
//SYSFTPD  DD   DISP=SHR,DSN=MY.FTP.DATA                     
//FILE1    DD   DSN=X1GPTLH.RCF.CLOSE08.CLI.ACCTS.JUL15,     
//         DISP=MOD                                           
//OUTPUT   DD   SYSOUT=*                                     
//INPUT    DD   *                                             
sendsite                                                     
ascii                                                         
cd ...                                                       
get Amx_PLCC_final.txt     //dd:file1                         
get second_file.txt        //dd:file1                         
...                                                           
get twenty_second_file.txt //dd:file1                         
qui                                                           
/*                                                           
//*                                                           
Back to top
View user's profile Send private message
raj12vel

New User


Joined: 20 Dec 2008
Posts: 43
Location: New Jersey

PostPosted: Thu Jul 16, 2009 1:46 am    Post subject:
Reply with quote

Can you please be more specific on the aforementioned code?

1. do i have to give the ip address in the field?
Code:
PARM='server.address (Exit=8'


2. what are the details whould i need to give in this file?
Code:
//SYSFTPD  DD   DISP=SHR,DSN=MY.FTP.DATA


3. where should i give the user id and password?
Back to top
View user's profile Send private message
raj12vel

New User


Joined: 20 Dec 2008
Posts: 43
Location: New Jersey

PostPosted: Thu Jul 16, 2009 1:55 am    Post subject:
Reply with quote

I got it.

It works fine.

thanks alot for your timed help.

please let me know if we have alternatives for this.

I would like to thank you al icon_biggrin.gif
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 High CPU consumption Job using IAM fi... aswinir JCL & VSAM 8 Thu Dec 01, 2016 8:28 pm
This topic is locked: you cannot edit posts or make replies. Urgent Mainframe Requirments (2-10 yr... Shankar779 Mainframe Jobs 0 Sun Nov 27, 2016 1:48 pm
No new posts Match or compare two files in VB Format anatol DFSORT/ICETOOL 14 Thu Nov 03, 2016 7:41 pm
This topic is locked: you cannot edit posts or make replies. Mainframe Developer requirement in Ku... capricorn Mainframe Jobs 0 Sun Oct 23, 2016 3:49 pm
This topic is locked: you cannot edit posts or make replies. How to use 2 input files in control c... Gunapala CN DFSORT/ICETOOL 23 Thu Oct 13, 2016 3:42 pm


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