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 multiple files dynamically through JCL

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> TSO/ISPF
View previous topic :: :: View next topic  
Author Message
avinash sengar

New User


Joined: 13 May 2010
Posts: 16
Location: hyderabad

PostPosted: Wed Apr 16, 2014 12:36 pm    Post subject: FTP multiple files dynamically through JCL
Reply with quote

Hi ,

I have a requirement to FTP the multiple files into mainframe Dataset from one folder through JCL

filenames can be like below:
P358Sccyymmdd.TXT 
P8347W.ccyymmdd.TXT 
CFPACccyymmdd-5010.EDI 

The problem is we dont know how many files will be there , some time it may be 10 or sometime it may be 20
Also , the file names are not fixed it may vary after time to time.
the only thing that is fixed is : the extension of file it will always be either ".TXT" or ".EDI"

Now , is there any way to FTP these files one by one from directory and process it

Please provide your help!

Thanks
Avinash
Back to top
View user's profile Send private message

David Robinson

Active User


Joined: 21 Dec 2011
Posts: 175
Location: UK

PostPosted: Wed Apr 16, 2014 1:18 pm    Post subject:
Reply with quote

Sounds like it should be simple enough. Just issue a "ls" command on the target server. Read the output with a Rexx or other utility of your choice and build the appropriate ftp get commands.
Back to top
View user's profile Send private message
avinash sengar

New User


Joined: 13 May 2010
Posts: 16
Location: hyderabad

PostPosted: Wed Apr 16, 2014 2:44 pm    Post subject:
Reply with quote

Is there any utitliy available to read the file after LS command or do i need to write cobol for it
Back to top
View user's profile Send private message
David Robinson

Active User


Joined: 21 Dec 2011
Posts: 175
Location: UK

PostPosted: Wed Apr 16, 2014 4:41 pm    Post subject:
Reply with quote

You will need to write something but it does not have to be Cobol.
Back to top
View user's profile Send private message
Rohit Umarjikar

Senior Member


Joined: 21 Sep 2010
Posts: 1610
Location: NY,USA

PostPosted: Thu Apr 17, 2014 12:52 am    Post subject:
Reply with quote

Mostly, there has to be agreement between the naming standards and they need to be constant.

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.

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/F1A1B970/5.41?SHELF=F1A1BK90&DT=20070530175427
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 Apr 17, 2014 4:07 am    Post subject:
Reply with quote

Another option would be to FTP into an OMVS directory and use the programming language of your choice (C or Perl would both be good choices if Perl is installed on your machine) to parse the directory and process the files.
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 -> TSO/ISPF 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
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. How to use 2 input files in control c... Gunapala CN DFSORT/ICETOOL 23 Thu Oct 13, 2016 3:42 pm
No new posts Adding records from two files into on... shiitiizz SYNCSORT 4 Mon Sep 19, 2016 8:41 pm
No new posts how to DYNAMICALLY write sort cond to... mohamedmubee COBOL Programming 13 Fri Aug 26, 2016 11:46 pm


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