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: 183
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: 183
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: 2105
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: 8417
Location: Dubuque, Iowa, 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 How to dynamically decide which one t... javen777 JCL & VSAM 16 Wed Dec 19, 2018 8:50 am
No new posts Storing SORTOF files in a PDS ajithajt SYNCSORT 3 Thu Dec 06, 2018 12:27 pm
No new posts Single step to take backup of multipl... Vignesh Sid JCL & VSAM 1 Thu Nov 29, 2018 8:12 pm
No new posts DB2 Unload / Load Multiple tables neo4u DB2 8 Tue Nov 27, 2018 3:43 pm
This topic is locked: you cannot edit posts or make replies. DFSORT output in CSV for data spans i... hiravibk DFSORT/ICETOOL 3 Tue Nov 13, 2018 7:55 pm

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