I'm thinking any way a person can do SQL - The new RUNSQL from IBM could
be used, or a QMQRY that is specific to the task.
The thing to do is like this - have a line in the model FTP script that
reads like this (the (r is for if it needs to replace at the target)
put ***filename*** (r
Then you'd make a copy of the model into QTEMP, maybe. The SQL statement
would be something like
update qtemp/copyofftp set ftptext = replace(ftptext, '***filename***,
'realfilename') where ftptext like '%***filename***%'
Now another approach - I've written the entire script from a program,
plugging in the values as needed.
I'm not guaranteeing the order of parameters in the replace function, by
the way - doing it by memory.
This applies to the various methods presented, in other words, any way
you can run an UPDATE SQL statement. That'd be Paul's idea or Scott's
QShell recommendation, which has its db2 command, as I recall.
Scott's FTP API still has the advantage of being able to monitor each
step - a script tries to run everything, even when errors occur, such as
being unable to log in.
On 3/9/2013 1:27 PM, Eric Lehti wrote:
Do you mean using STRQMQRY compiled with a parameter variable
(containing replacement file name) where its SQL updates source member
line that has the put statement?
The source line would PUT a different file each time.
I like that. I also appreciate your comment about doing it with RPG.
One idea is to use a place-marker for the file name, then do an SQL
REPLACE on that line - or do it in RPG native.