Re: Loading an Informix table with data created from a mainframe extract.
Posted in 1994
Edward (Nick) Nobbe (nnob@loc.gov) wrote:
: On Fri, 23 Dec 1994, L Deckard wrote:
: > This question is in two parts:
: 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);
Depending on the file size, you may want to create & load a table
with just one column for "key2", then use the above subquery.
: As for 2):
: I think people are using Expect to write automated ftp scripts that
: require interactive responses to prompts. Wish I could help.
You can write a shell script and submit it thru cron. It may look
something like:
# Set env variables
ftp -v mainframe.address <<EOF! # Need to put login
get 'dataset.name' /tmp/loadfile # info in .netrc
quit # file
EOF!
ls /tmp/loadfile # Check to see if
if (($? != 0)) # there
then
print "dataset.name not here"
exit 1
fi
isql dbname - <<EOF! # Load table, etc
load from "/tmp/loadfile" insert into table
...other sql...
EOF!
# To load partial data into table use:
dbload -d dbname -c infile.specs
:
:
We use scripts like these to download info from an MVS box to an RS6000.
Hope this helps!
STEVE
____ ___ ________ ________
/_ _] /_ ]/ ______)/ ______) _/| Steve Morrow, Sr. Programmer/Analyst
/ _/ / / / (____ / /___ _/ | University of South Florida
/ _/ / / \\____ ) / _____) _/ | Internet: smorrow@dotrisc.cfr.usf.edu
/ _/___/ / ______/ / / / _/ | Voice : (813) 974-6889
(_________)(________)(___)______/ |______________________________________