Hi everyone,
Now that the issue is resolved and it appears the rows were actually importing fine I just wanted to come back to John's reply on the encoding and share some thoughts:
Based upon the Help file as John suggests it could lead one to believe there was a possible encoding issue due to the ASCII reference, which implies a 7-bit code. Not knowing that the records were actually being imported successfully could also make the issue misleading. I would suggest, though, that the Help for the ImportFile() method is not entirely correct. First, the reference to ASCII is misleading as the importing of characters in the 128 to 255 code range (really just interested in accented/ printable characters here) from an "ANSI encoded" file work just fine. I put quotes around those two words because there's lots of debate as to whether ANSI is a standard, an encoding, both, extended ASCII etc. and so I won't blab on any further on that topic.
However, to change it to ANSI would not be entirely accurate either as ImportFile() will work fine with a file encoded with UTF-8 (albeit as long as there are no accented characters because, while no errors occur, accented characters will show up as giberish, but it still imports). Also, importing a file that is encoded as UTF-8 with BOM will work just fine as well and import accented characters properly. It's interesting that this method doesn't choke on a file that is UTF-8 (without BOM) whereas other methods do fail like FileRead() and FileReadEx() when the file is opened with EncodingUTF8!. At a minimum I wish all methods worked the same way as the ImportFile() method - meaning have more flexibility with encoding types as opposed to just failing - versus having to do something like I suggested here: https://community.appeon.com/index.php/qna/q-a/searching-text-in-blob-column-contains-word-document
The primary point of all the above being that the guidance in the Help on the ImportFile() method stating that the file must be ASCII is misleading...unless they mean something other than what I'm familiar with when using the term ASCII...and so the Help should probably be re-worded. That said, the wording in the Help file on the ImportFile() method referencing ASCII is almost word for word as far back as PB 5, and maybe earlier I can't recall, and so maybe it just hasn't been updated as other encodings have come along.
Would also love to see Appeon change how PowerBuilder deals with text files as far as EncodingANSI! being the default and how it responds to a UTF-8 with or without BOM encoding in a file.
Finally, this 18 year old article on character sets, while referencing some technologies that are out-dated or no longer around, still provides a great perspective and backgrounder on character sets. The original author is now chairman of the board of Stack Overflow. https://www.joelonsoftware.com/2003/10/08/the-absolute-minimum-every-software-developer-absolutely-positively-must-know-about-unicode-and-character-sets-no-excuses/
Thanks for your indulgence, just my thoughts...regards,
Mark
check your code for the use of integers.
Thanks for your answer, the problem is that. I mistakenly had an Integer variable for the result of the ImportFile, I changed the variable to type Long and the ImportFile statement in the DataStore worked correctly.
Regards