=head1 NAME Client_A-Gateway - Perl5 program to act as a gateway between the AS/400 system at Client_A and the Client_B database. =head1 SYNOPSIS B [ B<-config_file>|B<-cf> I ] [ B<-ftp_root>|B<-fr> I ] [ B<-work_root>|B<-wr> I ] [ B<-clientb_root>|B<-sr> I ] [ B<-incoming_dir>|B<-id> I ] [ B<-incoming_archive>|B<-ia> I ] [ B<-outgoing_dir>|B<-od> I ] [ B<-outgoing_archive>|B<-oa> I ] [ B<-shop_number>|B<-sn> I ] [ B<-logging> ] [ B<-nologging> ] [ B<-log_file>|B<-lf> I ] [ B<-archive> ] [ B<-noarchive> ] [ B<-in_keep_days>|B<-ikd> I ] [ B<-out_keep_days>|B<-okd> I ] B [ options as above ] B [ options as above ] =head1 OVERVIEW The Client_A-gateway program processes incoming and outgoing data files from/to the AS/400 system at Client_A and Client_B. Client_A had already developed an interface to exchange data with their Store systems, so are using the same interface (albeit with different data) to talk to Client_B. This program emulates the behaviour expected by the AS/400 system at the Store. It can be invoked in one of 3 ways, each method involving the use of a symbolic link to the actual program. =over 4 =item Client_A-incoming Processes incoming data files, checking that the batch received has not already been received before, and that the accompanying control record matches the batch. The process I process a batch it has seen before, but only if it has more records than the original (and then it only processes the new records). On completion a confirmation record is written to the incoming ftp directory for the AS/400 to pickup. =item Client_A-outgoing Picks up data waiting to go to Client_A from Client_B, packages it in a format expected by the AS/400, puts it into the outgoing ftp directory, and then updates the control file in the outgoing ftp directory. The control file is used by the AS/400 to find out what batches are available. It is trimmed by the Client_A-archive invocation to hold no more than 7 days worth of control records. =item Client_A-archive If archiving is turned on, the Client_A-incoming and Client_A-outgoing processes will put a copy of the data file into the relevant archive directory. These archives are then removed by Client_A-archive once they become too old. This process also trims the outgoing ftp directory of outgoing data batches which are more than 7 days old, and updates the outgoing control file. =back =cut