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
 

 

FTP - mget command help in JCL

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> All Other Mainframe Topics
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    Post subject: FTP - mget command help in JCL
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

Site Director


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

PostPosted: Sat Feb 13, 2010 3:55 am    Post subject:
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: 7990
Location: Bellevue, IA

PostPosted: Sat Feb 13, 2010 4:15 am    Post subject:
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

Moderator Team Head


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

PostPosted: Sat Feb 13, 2010 4:17 am    Post subject: Reply to: FTP - mget command help in JCL
Reply with quote

The ONLY parameter you can use with MGET is REPLACE:

http://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

Moderator Team Head


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

PostPosted: Sat Feb 13, 2010 4:20 am    Post subject: Re: FTP - mget command help in JCL
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    Post subject: FTP - mget command help in JCL
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

Moderator Team Head


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

PostPosted: Mon Feb 15, 2010 2:08 am    Post subject: Reply to: FTP - mget command help in JCL
Reply with quote

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

Site Director


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

PostPosted: Mon Feb 15, 2010 3:22 am    Post subject:
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    Post subject: Reply to: FTP - mget command help in JCL
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

Moderator Team Head


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

PostPosted: Mon Feb 15, 2010 6:35 am    Post subject: Reply to: FTP - mget command help in JCL
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    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 TSO or command line utility to genera... kishpra JCL & VSAM 3 Thu Mar 09, 2017 1:11 am
No new posts Customizing the ISPF HILITE Command Pedro TSO/ISPF 3 Fri Mar 03, 2017 11:49 pm
No new posts Fail to change physical VSAM filename... jacobdng CICS 7 Fri Jan 20, 2017 12:36 pm
No new posts What is the command to check MODE of ... rohanthengal CLIST & REXX 7 Fri Nov 18, 2016 1:48 pm
No new posts SDSF Command Avtrix CLIST & REXX 4 Fri Sep 30, 2016 11:13 am


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