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

FTP multiple files dynamically through JCL


IBM Mainframe Forums -> TSO/ISPF
Post new topic   Reply to topic
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
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: 199
Location: UK

PostPosted: Wed Apr 16, 2014 1:18 pm
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
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: 199
Location: UK

PostPosted: Wed Apr 16, 2014 4:41 pm
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

Global Moderator


Joined: 21 Sep 2010
Posts: 3048
Location: NYC,USA

PostPosted: Thu Apr 17, 2014 12:52 am
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.

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: 8696
Location: Dubuque, Iowa, USA

PostPosted: Thu Apr 17, 2014 4:07 am
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> TSO/ISPF

 


Similar Topics
Topic Forum Replies
No new posts INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts Write line by line from two files DFSORT/ICETOOL 7
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts Multiple table unload using INZUTILB DB2 2
Search our Forums:

Back to Top