Renaming a txt file within a Lotus Script Agent.

When an AS400 CLP runs, it is copying a variable number of spooled files to a directory on our IFS as Text files. Because of AS400 syntax, I had to name the files with a leading letter. ie. P12345.txt In the email agent to attach all these files and send, I need to rename the file, eliminating the leading 'P' so that the final outcome is 12345.txt. I can have any number of files to attach so the current logic is in a loop to read through all the files in my Directory. I am not a Notes Developer. I'm RPG so I'm learning by example at this point. Can anyone help me? THANKS Robin

Answer Wiki

Thanks. We'll let you know when a new response is added.

Think you will need to rename files into a new directory with one loop and then do another loop to atttach files to emails.

Dim filename As String

olddir$ = “d:old”
newdir$ = “d:new”
filename = Dir(“D:old*.txt”)
Do While filename<>””
Msgbox “File = “& Filename
Name olddir$ & filename As newdir$ & Mid(filename,2)
filename= Dir()

Discuss This Question: 1  Reply

There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.
  • Deadleaves
    Why don't you just use email direct from the AS400? Try: for a great little mail utility written by an ex IBMer. All you need to configure on the AS400 is your SMTP server and get it to point to your Domino mail server either by DNS or IP address. You configure the SMTP server either via Ops Navigator or direct from green screen via: CFGTCP opt 20 - Configure TCP Applications opt 12 - Configure SMTP opt 3 - Change SMTP attributes Main parameters to change: AUTOSTART(*YES) MAILROUTER(ip address of Domino Mail server) FIREWALL(*YES) You might need to make some changes to your Domino server documents so mail from the AS400 is forwarded on to the intended recipients. But so long as you configure the AS400 to be in the same domain as your mail server you should be ok (via CFGTCP opt 12). Included in the MMAIL utility is a command for sending spool files and more than just convert to text it can convert to PDF at the same time. We use it all over the place, particularly for overnight processing and sending of reports to users etc.
    0 pointsBadges:

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.


Share this item with your network: