View previous topic :: View next topic
|
Author |
Message |
avinash sengar
New User
Joined: 13 May 2010 Posts: 16 Location: hyderabad
|
|
|
|
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 |
|
|
David Robinson
Active User
Joined: 21 Dec 2011 Posts: 199 Location: UK
|
|
|
|
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 |
|
|
avinash sengar
New User
Joined: 13 May 2010 Posts: 16 Location: hyderabad
|
|
|
|
Is there any utitliy available to read the file after LS command or do i need to write cobol for it |
|
Back to top |
|
|
David Robinson
Active User
Joined: 21 Dec 2011 Posts: 199 Location: UK
|
|
|
|
You will need to write something but it does not have to be Cobol. |
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3048 Location: NYC,USA
|
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
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 |
|
|
|