Need Help for getting file name from FTP



JES, JES2, JCL utilities, IDCAMS, Compile & Run JCLs, PROCs etc...

Need Help for getting file name from FTP

Postby sultanabdulkadhar » Tue Mar 09, 2010 11:36 pm

I need to pick the file from FTP. Normally we submit a job and pick the file. Here, the filename is available with date.

like xxxxx_20100309.txt, the date which i mentioned will vary on daily basis. i need a generic FTP step to get the file name without bothering date or dynamic update in FTP step in JCL where we consider the date

today xxxxx_20100309.txt
tomorrow xxxxx_20100409.txt like this
sultanabdulkadhar
 
Posts: 19
Joined: Tue Jul 07, 2009 9:33 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Need Help for getting file name from FTP. the file name

Postby Robert Sample » Tue Mar 09, 2010 11:43 pm

You basically have 3 options:
1. Work with your scheduling group to put something together since most scheduling systems handle this already.
2. Since FTP is not a scripting language and has no tools for working with file names OR dates, if your scheduling group cannot help you then you can create the FTP commands via a program (or utility) and pass them into the FTP step.
3. You can go back to whoever the file is coming from and telling them you cannot handle dates in the file name and have them remove it.

You could transfer into a Unix System Services directory by using the FTP command MGET * to grab all files and figure out later which one is the one you need, but sooner or later the mount point will fill up and have to be cleaned out. And this still leaves you have to code up something to find the right file for the given date.
Robert Sample
Global moderator
 
Posts: 3719
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times

Re: Need Help for getting file name from FTP. the file name

Postby sultanabdulkadhar » Tue Mar 09, 2010 11:50 pm

Hi Robert,

Thanks for the quick reply. i tired with first and 3rd option what you mentioned. i need to look at the second option. looks like it will work out. i will try and keep posted the update here..

Thanks again
sultanabdulkadhar
 
Posts: 19
Joined: Tue Jul 07, 2009 9:33 pm
Has thanked: 0 time
Been thanked: 0 time


Return to JCL

 


  • Related topics
    Replies
    Views
    Last post