Flat file management - TR8.97

Gergely_Pongracz

Well Known Member
Hi List,

I have a strange problem...
In earlier (Xe, B9, E8.10) versions I used some business functions to manage flat files written in C using stdio calls e.g. fprintf, fscanf, etc.
These functions simply do not work on TR8.97 and 8.98. They are compiled all right but every time processing reaches a stdio call the program crashes.
I substituted the calls with the appropriate jde calls and some of the functions work, but with jdeFscanf (more of them) I get another new error:
Code is compiled all right, runs without crashing reads the first line correctly but does not move to the second line. I had no luck with either the scanf or the gets type functions. Seems as if the functions recognized CRLF as EOF.
The file I want to read is a simple text file (non-Unicode) and I want to convert line-by-line to Unicode JDE strings for processing.

Any Ideas? Either for stdio or for CRLF issue?

Regards
Gergely

Current problem is on B9 TR8.97 on Win/Oracle but seems to occur on every 8.97/9.98 installation on Win and Linux
 
Hi Peter,
Most of the things I tried were written in my own business functions... using jdeFopen, fscanf, jdeFscanf, jdeFscanfConvertV1, jdeFgets...
I also tested with standard bsfn B76B0220 with the same result - stopping at the end of first line.
Regards
Gergely
 
Gergely,

This may be a long shot and I'm not sure that it is even applicable, but have you got an appropriate record entered via the P93081 app for Flat File Encoding. The manual is not real clear on this, but it does say:

[ QUOTE ]
Because JD Edwards EnterpriseOne software uses Unicode and not all third-party software does, there is a preprocessing and postprocessing intercept of all flat files. During the intercept, the software converts the flat file into the Unicode character set or back into the original character set. You can assign the conversion character set applied to a flat file—based on the user or role, the program ID, the program version, and the environment—by adding and activating a flat file encoding record.

[/ QUOTE ]

You did mention that you got errors. What exactly were the errors?
 
Gergely,

Would the later Tools Releases require UNICODE Syntax, within the C-Functions? I don't know that the syntax is the problem, but you might compare some of the syntax you have been using against the more-current syntax to the API Standards for functions.

Just a hunch (because I hit something similar a few years ago)

Another suggestion... why aren't you using the 'Native' flat-file functions to Open/Create, write/append and close them there flat-files?

The fact that your custom functions are, most likely, by-passing the Unicode Translation (and the P93081 setup) - seems a bit discomforting.

(db)
 
Peter, Daniel,
Thank you for your ideas. I will certainly look around P93081...
I am aware of unicode things and use unicode syntax and unicode conversions in my BSFNs.
Reading with stdio functions and using jde API's for conversion to Unicode worked fine in several B9, E810, E811 installations before TR8.97. Now there are jde API's that are supposed to do the same in one step e.g. jdeFscanfConvertV1 - the ones converting require a code page as input.
Peter: The error is that it does not work... The solutions I tried read until the end of the first line and don't read the second line.
Daniel: What do you mean by 'Native'? I tried stdio functions, JDE API's and a standard JDE BSFN.
Regards
Gergely
 
Gergely,

Do you have, or can you get a debug log? Is there anything in it wich would suggest what is happening.

The standard business functions that I use for reading text files only read one line at a time, and you have to run the business function again for the next line. You get an error when the end of the file is reached.
 
Hi Peter,
I had a debug log, but it is partially useless...
These API's are not logged with any relevant information.
In case of the stdio calls log just stopped - quite natural in the case of a crash.
Which business functions do you use?
Regards
Gergely
 
Gergely,

Sorry for the late reply, I have been on rec leave.

I use the following functions for flat/text/csv file I/O:

Input:
FetchNextLineFromFlatFile (B76B0220)

Output:
OpenFlatFile (B34A1010)
WriteOneLine (B34A1010)
CloseFlatFile (B34A1010)
There is also this one which I have not used.
AppendLineToFlatFile (B76B0220)
 
Back
Top