AS400 attachments in agents

I’m using an agent to automagically generate an email document that attaches a .txt file that is generated nightly on the AS400 in Lotus Script using Embed_Object. I have gotten this to work for a file in C:\ but how would I address a file in a document folder on the AS400? I have tried several variations of syntax using “1.2.3.4:\qdls\sendfile.txt” without success. The agent would be totally automated and running on the server. Anyone up on this syntax?

Subject: AS400 attachments in agents

The agent works fine on my PC. I need this to run on the server because it’s scheduled. I don’t want to have to leave my PC on 24 hours a day for it to run. How do you accomplish mapping on a Domino server?

Subject: RE: AS400 attachments in agents

If you want to run the agent on server (meaning the agent will run on the iSeries), you do not need to map.Make sure that the file you are going to attach is stored in an IFS directory.

If the file is NOT stored in your Domino data directory (for example in /home/mydir), the statement for attaching the file to a rich text field will be:

Set object = rtitem.EmbedObject( EMBED_ATTACHMENT, “”, “/home/mydir/myfile.txt”)

If the file is stored in your Domino data directory, the statement will become:

Set object = rtitem.EmbedObject( EMBED_ATTACHMENT, “”, “myfile.txt”)

A FOLDER (type: FLR) on the iSeries is a special object. Put the file you want to attach in an IFS Directory (type: DIR).

Subject: RE: AS400 attachments in agents

Sounds good, only it seems like a momunental pain to get my file out there, which so far I’ve been unsuccessful at. I’m trying to take the output that runs on a schedule from our main iSeries partition to copy to the IFS using the CPYTOSTMF command. The CPYTOSTMF command doesn’t like the fact that the file is an externally described file and not a program described file. Also our Domino server is a separate partition with a different IP address. I would hate to revert to the SNDDST command when we’ve got a perfectly good Domino server (other than the disappearing agent problem I’m having). It’s been since 1998 that I worked with Lotus Notes and I was able to write an agent for the first time locally that worked within 10 minutes. It’s taken me a week and a half so far to get the server version working. I do appreciate your suggestions. It’s good to have a forum with insider know-how. Thanks!

Subject: RE: AS400 attachments in agents

OK, you never mentioned that your Line of Business app runs on a separate LPAR than your Domino server.I am not aware if you can reach a remote file using LotusScript. You may want to look at another option like writing a Java Agent using classes from the Toolbox to manipulate/access remote files and objects.

Subject: RE: AS400 attachments in agents

So the heart of the question is how do you reference an iSeries file in the LotusScript EmbedObject method. I have never attempted this, but I do know a bit about the iSeries.

You could set up the AS/400 NetServer on the iSeries, which would give people access to the server over the network. However, what you are doing is accessing a local file so I’m not sure if it would work.

To set up AS/400 NetServer follow these steps:

Open Operations Navigator

Expand the iSeries you are using in the left pane

Expand Network in the left pane

Expand Servers in the left pane

Click TCP/IP in the left pane

Right-click AS/400 Netserver in the right pane and select Configuration

A wizard will come up to walk you through setting up the Netserver. Once that is finished you will need to create shares.

Expand File Systems in the left pane

Expand Integrated File System in the left pane

Expand Root in the left pane

Domino is installed in the NOTES folder by default, but your admin could have installed it somewhere else. Find out where it was installed, then right-click that folder and select Sharing > New Share.

Now, to access the iSeries using its IP address: \192.168.1.1\yoursharename. When making this connection from Windows you will likely be prompted to log into the iSeries.

As far as how to apply this to a server-based call, I have no idea. You might be able to reference it as above, I really don’t know.

I hope that helps at least a little,

– Charles

Subject: AS400 attachments in agents

Excellent help! You wouldn’t happen to know where I could find a code snippet to point me in the right direction would you? Up to this point I haven’t had to do Java but this would be a good place to start.

Subject: AS400 attachments in agents

Assuming that your Domino server and agent run on the iSeries, try this - if the text file is in your domino data directory, just specify the name of the file “sendfile.txt”. If it’s in another directory, you have to start from root, for example: “/home/mydir/sendfile.txt”. Also make sure that QNOTES has a proper access to that file.

Subject: RE: AS400 attachments in agents

If the AS400 has an IP address, is there a way to navigate to that location using the IP address in the path? The report gets generated on the AS400 every night and I would like to avoid having to copy it, although I will if I have to. Thanks!

Subject: RE: AS400 attachments in agents

Well, you can map a drive on your PC to the IFS directory on your AS/400 where the text file is generated. Try and let us know how it goes.