Hi, I am trying out jRecord the first time and I am having problems. I used the jRecordGen to generate a reader for a fixed_width mainframe COBOL (cp037) file. When I run the code, it throws this exception:
[Fatal Error] fcustdat_COBOL_copybook_proper.txt:1:8: Content is not allowed in prolog.
~~> 0 net.sf.JRecord.Common.RecordException: Content is not allowed in prolog.
It appears it does not like the COBOL copybook, eventhough I generated the java code with this copybook and it has created the schema properly. It seems to be failing at the start.
I am really looking forward to using jRecord as a viable solution to read mainframe files. I would be grateful if you can tell me what I am doing wrong.
Attaching the code, file, copybook and exceptions. I tried copybook with 01 level starting at position 1 as well as position 8.
Thanks for your kind help
Thanks
Anonymous
I think ** cb2xml.jar **is missing from your class path. This jar does the Cobol Conversion.
I will change JRecord so that it gives better messages!!!
Also you have a second problem with the data file. It looks some of the record have been truncated.
What I think might of happened is you have a VB file onthe Mainframe and have dropped the RDW (record length) when transfering it to the PC.
Options include:
If using JRecord there are options for Generic Processing:
Thanks for the prompt response. At first I used the cb2xml jar from jRecord distro 0.9 R6 but I had generated the java code using the jRecord_CodeGen. It seems that the distros are different. I then used the jRecord.jar and cb2xml.jar from the code gen distro. It worked for Datar020!!!!
I want to try one more fixed width file and then a complicated VB file.
Thanks again.