LOTS of questions ......

What is the CCSID of the file? The Domino jobs run as CCSID 37 (EBCDIC
English).
If you want the data translated you must be sure the PCASCII file is
defined as a PSASCII file.
Is the file CCSID 819?
Did you transfer the file to the system in binary or text mode?

CVS is a little tricky but this is a test I used for text files.....

Dim returnVal As Integer

Dim fileNum As Integer
fileNum% = Freefile()
Open "/ww414/notes/ebcdicfile.txt" For Output As fileNum%

Dim fileNum2 As Integer
fileNum2% = Freefile()
Open "/ww414/notes/asciifile1.txt" For Output As fileNum2%

Print #fileNum%, "First line " ; "This is the first line."
Print #fileNum%, "Second line:"; "This is the second line"
Print #fileNum%, ""
Print #fileNum%, "Fourth line:"; "This is the fourth line. Please
note, the third line is empty."
Print #fileNum%, "This is the end of the file."
Print #fileNum%, ""
Close fileNum%

Print "USE shell function to call copy file to another code page"
returnVal = Shell("DEL OBJLNK('/ww414/notes/asciifile1.txt')")
returnVal = Shell ("CPY OBJ('/ww414/notes/ebcdicfile.txt')
TOOBJ('/ww414/notes/asciifile1.txt') SYMLNK(*NO) TOCODEPAGE(819)")

Walter Scanlan
Senior Software Engineer
Office: 507-286-6088
Cell: 507-990-4539




From:
"Carl Pitcher" <cpitcher@xxxxxxxxxxxxxxx>
To:
<domino400@xxxxxxxxxxxx>
Date:
01/28/2010 01:05 PM
Subject:
lotusscript agent importing csv file from iSeries IFS to create documents
in 8.5.1



The file is in the Data directory on the Domino server on iSeries. The
agent is set up for testing as On event/Action menu selection but when
running the agent in Notes, I get the message "Unable to open file" on the
Open statement. I've tried all kinds of variations of the path/file name
but
no luck.



Can anyone suggest what I may be doing wrong?



Here's the first part of the script:



Option Public



Sub Initialize

Dim session As New notessession

Dim db As notesdatabase

Dim doc As notesdocument

Dim fileNum As Integer, cells As Integer

Dim fileName As String

Dim InputStr As String, delimiter As String

Dim FieldArray As Variant

Dim rtitem As Variant



fileNum% = Freefile()

fileName$ = "/DOMINO/TDCDOMINO/DATA/XINVHDR.CSV" ' Location of file

delimiter = "," ' Delimiter of file

cells = 27 ' Number of cells + 1





Open fileName$ For Input As fileNum%

Do While Not Eof(fileNum%)

Line Input #1, InputStr$

FieldArray = parseall(InputStr$, delimiter, cells)

response% = CreateDocument(FieldArray)

Loop

Close fileNum% 'close the csv file

Kill filenum% 'delete the csv file

End Sub



Function CreateDocument(FieldArray As Variant) As Integer

_______________________________________________
This is the Lotus Domino on the iSeries / AS400 (Domino400) mailing list
To post a message email: Domino400@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/domino400
or email: Domino400-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/domino400.




As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.