× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



     
Gade,
There are several things that can be done.  It somewhat depends on what else you
have in place.  

This is based on some of the work I have done in the past:
1) Typically, an FTP file will have the last record in the transmitted file be a
trailer record.  This usually has the date, time, and number of records.  
Generally there is a record type code or some way to determine that the record 
is a trailer record as opposed to data.  Let's say the first position of the 
record is the type code, where H=header record, D=data and T= trailer.  

 I receive file F100 via FTP every day.
 In a CL, I check to see if there are any records in F100, as well as make sure 
there is no other job allocating the file
 If there are records, I call my RPG else the CL ends (or loops with a delay, if
you prefer)
 In the RPG I read the last record to be sure it is a trailer (this not only 
helps to ensure the FTP is finished, but that ALL records got transmitted)
 Once my RPG is finished, control returns to the CL, where I call another 
program which I use to archive the member I just received (copy the data, create
a new member in my archive library of F100xx, where xx= AB, AC, AD, etc. as 
determined by the archiving program).  This allows for retrieval of previously 
sent data.
 Once the data is archived, I clear F100 so it is empty for the next iteration 
of the CL.

There are probably more elegant ways to do it, but I find this method to be 
simple, effective and easy to manintain.

There are any number of ways to run the CL, either at scheduled intervals, as an
always running background job.  You might have the sending FTP program place 
data in a dtaara or a flag file that is used to trigger the RPG rather than 
checking for the file allocation and # of records > 0.  

In one of my projects, I needed a way for the users PC to know that a 400 job 
had ended so that it could then pull data across to the PC (suffice it to say 
that our network is such that we can not push from the 400 to the PC).  Part of 
the PC job was to place a file on the 400 that contained 1 rec in it.  When the 
400 job was done, it deleted the file place by the PC.  Periodically the PC 
checked for the existence of the file; when it received an 'object not found' 
message,it would then get the actual data file and FTP it over to the PC.

jw




______________________________ Reply Separator _________________________________
Subject: Trigger after FTP
Author:  Gade_R_Reddy@consecofinance.com at Internet
Date:    06/12/2000 4:35 PM


     
Hello.
     
Our company gets a ftp file from an other company on daily basis.
     
I need to write a program which should kick off whenever the FTP process is 
done.
     
Please suggest what would be best to program so that it waits & kick off 
only if the ftp process is done.
     
Thanks.
Gade.
     
+---
| This is the RPG/400 Mailing List!
| To submit a new message, send your mail to RPG400-L@midrange.com. 
| To subscribe to this list send email to RPG400-L-SUB@midrange.com.
| To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator: david@midrange.com 
+---
+---
| This is the RPG/400 Mailing List!
| To submit a new message, send your mail to RPG400-L@midrange.com.
| To subscribe to this list send email to RPG400-L-SUB@midrange.com.
| To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator: david@midrange.com
+---

As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.