View previous topic :: View next topic
|
Author |
Message |
mjshaheed
New User
Joined: 09 Apr 2007 Posts: 25 Location: Chennai,India
|
|
|
|
Hi All,
I am trying to FTP multiple files from a remote server into Mainframe using the following step in JCL.
The following step lists(ls command) the 2 files with wildcard *.ABCD3.* but the mget is not working. It's throwing me a filename error(as below).
EZA2550W Name length error for filename BAAA.PBBBBBBB.O0979283.ABCD3.K
EZA2550W Name length error for filename BAAA.PBBBBBBB.O1079050.ABCD3.V
The Dataset 'HAMESH.DATA.FILES.D0211210' is is already present.
Code: |
//FTPDATA EXEC PGM=FTP,PARM=('SYS1'),REGION=2M
//SYSPRINT DD SYSOUT=*
//INPUT DD *
open 10.11.1.115
username password
cd /home/files/
ls *.ABCD3.*
lcd 'HAMESH.DATA.FILES'
locsite lrecl=500 blksize=0 recfm=fb wraprecord
ascii
mget *.ABCD3.* D0211210 (APPEND
quit
/*
|
What i am basically trying to achieve is concatenate those two files and write it into HAMESH.DATA.FILES.D0211210.
Can anybody tell me what should be done to get those two files concatenated and written into the dataset?
Thanks,
shah |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
You might consider copying both files and then concatenating them into the first process on the mainframe.
I don't believe mget supports what you want to do. |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
FTP does not support concatenation -- as Dick says, MGET only copies a series of files from the server to the client, one at a time. |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
mjshaheed wrote: |
Can anybody tell me what should be done to get those two files concatenated and written into the dataset? |
Use two GET statements, one for each unique remote file. GET to the same target DD name, and make sure that dataset is specified in the JCL with DISP=MOD. |
|
Back to top |
|
|
mjshaheed
New User
Joined: 09 Apr 2007 Posts: 25 Location: Chennai,India
|
|
|
|
Thanks for all your comments and suggestions.
I think i should have given more details on my requirements.
Here is what happens on a daily basis -
Everyday my client posts some files on the Server that i need to download into mainframe. The number of files varies everyday.
Only if i have a way to know how many files she has posted on the server on a particular day, will i know how many 'get's i need to use,right? |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
Yes. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
If all of the files contain the "same" data, why not combine the data on the remote and upload the combined file?
Why not list the fiesfrom the remote server (hopefully, they are all in the same directory) and generate the statements to accomplish the individual file transfers? |
|
Back to top |
|
|
mjshaheed
New User
Joined: 09 Apr 2007 Posts: 25 Location: Chennai,India
|
|
|
|
Is there a way to store the output of the 'ls' commad into a dataset?
If Yes, can anyone tell me how it can be done?
Thanks,
Shahul |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
Back to top |
|
|
|