Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Get Downloaded Filenames

Status
Not open for further replies.

GKatReliable

Programmer
Jul 2, 2002
45
US
We dial up a remote mainframe system from which we download a file with a randomly-generated filename. We have to then put this file in a folder on our network so our mainframe can pull it in. The JCL for our mainframe extract job has to have the filename hard-coded, naturally. How do I get the filename of the file we downloaded (I found $XFERFILE in the online help), especially if we get more than one file in a ZMODEM batch? My script has to figure out what file we got, and copy that to a network folder with a predetermined filename, then delete the file.
To make this even more entertaining, our remote vendor doesn't put an extension on the filename! The filename can be something like F0010899. Changes every time.

 
You will need to monitor the value of $XFERFILE to determine the name of the file. You can use:

when $XFERFILE call proc_name

and each time the value of $XFERFILE changes (even during a batch transfer), the procedure proc_name will be called and you can then do whatever necessary steps need to be performed. I would recommend saving the file names, to a string array for example. After the entire transfer has then completed, you could process the complete set of files.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top