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

FTP - mget command help in JCL


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

New User


Joined: 09 Apr 2007
Posts: 25
Location: Chennai,India

PostPosted: Sat Feb 13, 2010 3:50 am
Reply with quote

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

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Sat Feb 13, 2010 3:55 am
Reply with quote

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

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Sat Feb 13, 2010 4:15 am
Reply with quote

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

Global Moderator


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

PostPosted: Sat Feb 13, 2010 4:17 am
Reply with quote

The ONLY parameter you can use with MGET is REPLACE:

publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/F1A1B980/5.41?SHELF=F1A1BKA0&DT=20080602140814
Back to top
View user's profile Send private message
superk

Global Moderator


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

PostPosted: Sat Feb 13, 2010 4:20 am
Reply with quote

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

New User


Joined: 09 Apr 2007
Posts: 25
Location: Chennai,India

PostPosted: Mon Feb 15, 2010 1:11 am
Reply with quote

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

Global Moderator


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

PostPosted: Mon Feb 15, 2010 2:08 am
Reply with quote

Yes.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Mon Feb 15, 2010 3:22 am
Reply with quote

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

New User


Joined: 09 Apr 2007
Posts: 25
Location: Chennai,India

PostPosted: Mon Feb 15, 2010 6:08 am
Reply with quote

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

Global Moderator


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

PostPosted: Mon Feb 15, 2010 6:35 am
Reply with quote

LS subcommand--Obtain a list of file names:

Quote:

ls name (Disk

Disk - Stores the results of the LS subcommand in the user_id.FTP.LSOUTPUT data set. The results are not displayed on the screen.
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 RACF - Rebuild SETROPTS command which... All Other Mainframe Topics 3
No new posts Routing command Address SDSF to other... TSO/ISPF 2
No new posts DTL - how to define key with stacked ... TSO/ISPF 3
No new posts LTJ command CA Products 4
No new posts Query on edit primary command CLIST & REXX 5
Search our Forums:

Back to Top