Friday, November 03, 2006

SNTT - Saving a text file to an iSeries and processing it with LotusScript

Working with the iSeries platform has its own challenges. One of them is if you create a mail-in database that accepts attachments and you need to process them. Saving the attachment to the file system then processing it shouldn't be that big a deal, but on an iSeries it is. By default the file is saved as EBCDIC, while LotusScript expects it to be ASCII. Doing the conversion isn't really difficult, but it does take some fiddling around to figure out all the bits to flip. Here's how:
Shell("COPY OBJ('" & EBCDICFileName & "') TOOBJ('" & ASCIIFileName & "') _
TOCCSID(*PCASCII) DTAFMT(*BINARY) REPLACE(*YES)"
)

This LotusScript was converted to HTML using the ls2html routine,
provided by Julian Robichaux at nsftools.com.

,

No comments:

Post a Comment