Re: Loading an Informix table with data created from a mainframe extract.
Posted in 1994
On Fri, 23 Dec 1994, L Deckard wrote:
> This question is in two parts:
> 01) I am using the Informix utility (LOAD) to load a flatfile (that was
>created from the mainframe then ftpped to the UNIX box) to a table. If the key
> in the flatfile does not exist in the table, I load it. If the key in the
> flatfile exist in the table, I don't load it (no problem, the table has a
> unique index, and the record is written to the error.log). OK. here's the
> problem: if the key is in the table, but not on the flatfile, that
> means it has been deleted from the master file on the mainframe and needs to
> be deleted from the table. Is there a way, via a store procedure or some slick
> 02) Currently, I am manually signing on to the IBM mainframe, via ftp
> <mainframe TSO IP address>, to download the extract file to the RISC 6000 box.
> I would like to automate this via a script file and fired off by cron
> everynight. What is the syntax of the ftp script file to do this.
>
> Your help would be greatly appreciated! Thanks, Lenny Deckard.
> email: ldeckard@databank.com
>
As for 1):
Try creating table2 with the same structure as table1.
Load table2 with the data from your flatfile. Index key2.
Run a delete query like -
delete from table1
where key1 not in
(select key2
from table2);
Then you can run your load program & drop the new table. Not too elegant,
but it should work.
As for 2):
I think people are using Expect to write automated ftp scripts that
require interactive responses to prompts. Wish I could help.
Yours,
*********************************
Nick Nobbe, Library of Congress
NLS/BPH
Off: (202) 707-0548
Fax: (202) 707-0711
mail: nnob@loc.gov
*********************************