Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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: 182
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: 182
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: 1817
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: 8187
Location: East Dubuque, Illinois, USA

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 Split files upto certain limit based ... bubbu75 DFSORT/ICETOOL 5 Tue Nov 14, 2017 11:11 pm
No new posts Formatting multiple records to a sing... Vignesh Sid SYNCSORT 3 Tue Nov 07, 2017 12:22 pm
No new posts Updating multiple counts in trailer!! Vignesh Sid SYNCSORT 4 Mon Nov 06, 2017 1:04 pm
No new posts Copy selected columns from 2 input fi... Poha Eater DFSORT/ICETOOL 3 Thu Nov 02, 2017 3:43 pm
No new posts Finding difference between two PS fil... Vignesh Sid SYNCSORT 5 Mon Oct 30, 2017 1:13 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us