Domino Lotusscript Scheduled Agent Tranfer File from AS400 to another

I have been trying to transfer a .csv file from IFS on AS400A to AS400B without success.  Using lotusscript scheduled agent that runs when new mail arrives.  Every step executes correctly until I run the "Shell command".  

1)  Can shell command work from a scheduled agent?  For it works when performed manually.

2)  Is the Save Restore command correct?

3)  The error I receive from domino console is (53) File not found at line 34  Line 34 is the "Shell(cmd)"  line

4)  The file is in the /home/ftp folder, which I see through iseries navigator.

cmd = "SAVRST RMTLOCNAME(GCM400) OBJ(" + nGetHireFolderLocation & + ")"
         taskId% = Shell(cmd)
         If taskID% = 33 then
	Print " FTP command to transfer file has been executed...."
         End if
         ' Wait 10 seconds before continuing, in order to ensure that the file transfer is finished

Open in new window

nGetHireFolderLocation returnes = "/home/ftp" =  THE FILE NAME (*.csv)
Robert TreadwellManaging DirectorAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Gary PattersonVP Technology / Senior Consultant Commented:
Are you getting an error message?  If so, what is it, exactly?

A couple of observations:

1) The OBJ() parameter expects a valid object reference, and it is generally enclosed in single quotes.  Single quotes will be required if the file name contains blanks.

2) Can't help but notice there is no "slash" character at the end of /home/ftp or the beginning of the  Sure you have this formatted right?  Might be a good idea to print out the final SAVRST command to verify that it is formatted the way you think it is.

Should end up like this:

OBJ('/home/ftp/this is my file name.csv')
Sjef BosmanGroupware ConsultantCommented:
Ehm, why do you use LotusScript to transfer a file? Ah, there is no Domino on server B...
Would it be possible to use a shared folder when creating the file copy, so you can avoid command language?
Robert TreadwellManaging DirectorAuthor Commented:
Gary Patterson,

Thank you for your assistance.  Yes the forward slash is present in my code.  I did however need to add the single quotes.  Good catch.  Line 2 (actual reference 'Line 34') is still erring.  Same error message "(53) File not found at line 34"
Introduction to R

R is considered the predominant language for data scientist and statisticians. Learn how to use R for your own data science projects.

Robert TreadwellManaging DirectorAuthor Commented:
Sjef Bosman,

Using lotusscript because I am performing other processes on incoming mail, searching for embedded object and then reading contents of *.csv and performing other task based on entries in file.  One of those task is to pass *.csv onto the other AS400 for processing by a program that already exist on that server.

I'm interested in the shared folder scenario. I'm assuming you are suggesting that I save the file directly to the shared file on other AS400B.  May you please provide a code example how to do that?  

thank you
Gary PattersonVP Technology / Senior Consultant Commented:
Is the folder on AS400B shared in some fashion?  NetServer (SMB/CIFS share), NFS, QFIleSvr.400?  If so, you should be able to use FileCopy + Kill:

FileCopy pathToLocalFile, pathToRemoteFile
Kill pathToLocalFile

For example if QFileSvr.400 is configured and AS400B is reachable, you could do something like this:

FileCopy "/home/ftp/somefile.csv", "/QFileSvr.400/AS400B/somefolder/somefile.csv"
Kill "/home/ftp/somefile.csv"

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Sjef BosmanGroupware ConsultantCommented:
That would be the idea indeed. You could maybe just save the file twice, directly from LotusScript, so you wouldn't need command language at all.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Lotus IBM

From novice to tech pro — start learning today.