Activity for JRecord

  • Bruce Martin Bruce Martin posted a comment on discussion Help

    I have not been able to replicate the issue, I have made changes that I think will fix the issue and uploaded to Git Hub. (https://github.com/bmTas/JRecord) let me know and I will uploaded the latest jars

  • herbert wu herbert wu posted a comment on discussion Help

    Hi Bruce, You are right. IO_STANDARD_UNICODE_TEXT_FILE fixed the issue. I verified with JVM switch -Dfile.encoding=UTF-8 and has same result. On my Windows machinem the default encoding is Cp1252. Thanks a lot for the help!!

  • Bruce Martin Bruce Martin posted a comment on discussion Help

    I will look at the issue and fix. I think I know what the issue is and will issue a fix. But try using IO_STANDARD_UNICODE_TEXT_FILE instead of IO_TEXT_LINE that should solve the issue. In JRecord there are ways to read a Text file As bytes (IO_BIN_TEXT forces this). As Characters then convert to bytes (IO_STANDARD_UNICODE_TEXT_FILE forces this) Constants.IO_TEXT_LINE will choose which ever it thinks is appropriate (basically the encoding). For the most part they work the same, IO_BIN_TEXT solves...

  • Bruce Martin Bruce Martin modified a comment on discussion Help

    The AbstractLineReader throws below error on parsing a given text dataset file when running the SpringBoot application in standalone mode(java -jar spring_boot_app.jar) on windows platform. java.lang.NegativeArraySizeException: -7240 at net.sf.JRecord.ByteIO.BaseByteTextReader.read(BaseByteTextReader.java:174) at net.sf.JRecord.IO.LineReaderWrapper.readImplementation(LineReaderWrapper.java:96) at net.sf.JRecord.IO.AbstractLineReader.read(AbstractLineReader.java:176) This is the reader constructor:...

  • Bruce Martin Bruce Martin modified a comment on discussion Help

    The AbstractLineReader throws below error on parsing a given text dataset file when running the SpringBoot application in standalone mode(java -jar spring_boot_app.jar) on windows platform. java.lang.NegativeArraySizeException: -7240 at net.sf.JRecord.ByteIO.BaseByteTextReader.read(BaseByteTextReader.java:174) at net.sf.JRecord.IO.LineReaderWrapper.readImplementation(LineReaderWrapper.java:96) at net.sf.JRecord.IO.AbstractLineReader.read(AbstractLineReader.java:176) This is the reader constructor:...

  • Bruce Martin Bruce Martin modified a comment on discussion Help

    The AbstractLineReader throws below error on parsing a given text dataset file when running the SpringBoot application in standalone mode(java -jar spring_boot_app.jar) on windows platform. java.lang.NegativeArraySizeException: -7240 at net.sf.JRecord.ByteIO.BaseByteTextReader.read(BaseByteTextReader.java:174) at net.sf.JRecord.IO.LineReaderWrapper.readImplementation(LineReaderWrapper.java:96) at net.sf.JRecord.IO.AbstractLineReader.read(AbstractLineReader.java:176) This is the reader constructor:...

  • herbert wu herbert wu modified a comment on discussion Help

    The AbstractLineReader throws below error on parsing a given text dataset file when running the SpringBoot application in standalone mode(java -jar spring_boot_app.jar) on windows platform. java.lang.NegativeArraySizeException: -7240 at net.sf.JRecord.ByteIO.BaseByteTextReader.read(BaseByteTextReader.java:174) at net.sf.JRecord.IO.LineReaderWrapper.readImplementation(LineReaderWrapper.java:96) at net.sf.JRecord.IO.AbstractLineReader.read(AbstractLineReader.java:176) This is the reader constructor:...

  • herbert wu herbert wu posted a comment on discussion Help

    The AbstractLineReader throws below error on parsing a given text dataset file when running the SpringBoot application in standalone mode(java -jar spring_boot_app.jar) on windows platform. java.lang.NegativeArraySizeException: -7240 at net.sf.JRecord.ByteIO.BaseByteTextReader.read(BaseByteTextReader.java:174) at net.sf.JRecord.IO.LineReaderWrapper.readImplementation(LineReaderWrapper.java:96) at net.sf.JRecord.IO.AbstractLineReader.read(AbstractLineReader.java:176) This is the reader constructor:...

  • AndySun1129 AndySun1129 posted a comment on discussion Help

    Thanks a lot, It's help for me!

  • Bruce Martin Bruce Martin posted a comment on discussion Help

    This was the code I was used to process the file: private String dataFile = "/Volumes/BruceMacSSD/Work/UserData/Andy/QA/QA_DEPENDING_DATA.dat"; private String copybookName = "/Volumes/BruceMacSSD/Work/UserData/Andy/QA/QA_DEPENDING_CBL.cpy"; /** * Example of LineReader classes */ public ReadQaDependingCbl() { super(); AbstractLine line; int lineNum = 0; try { ICobolIOBuilder iob = JRecordInterface1.COBOL .newIOBuilder(copybookName) .setCopybookFileFormat(Cb2xmlConstants.USE_STANDARD_COLUMNS) .setFont("cp037")...

  • AndySun1129 AndySun1129 posted a comment on discussion Help

    Thank you so much for your recent update to JRecord! The new Reader class works perfectly for handling multi-byte character sets in continuous files. My test files are now reading correctly with the character encoding support. I'm now testing with a more complex COBOL copybook that contains two DEPENDING ON clauses, but I'm encountering an issue where only the first DEPENDING ON field is being read correctly. The second one doesn't seem to be processed properly. Could you please advise if this is...

  • AndySun1129 AndySun1129 posted a comment on discussion Help

    Absolutely! Please feel free to use them in your tests. Thanks for the great work on JRecord!

  • Bruce Martin Bruce Martin posted a comment on discussion Help

    I have updated JRecord on Github: https://github.com/bmTas/JRecord To handle multi-byte character sets with in Continuous files. (There is a new Reader class Is it OK if I use files / copybooks you supplied in my automated test ???

  • Bruce Martin Bruce Martin modified a comment on discussion Help

    IO_BIN_TEXT is for reading single byte Text files (ASCII, Ebcdic etc). I would suggest trying running with a font (encoding) of Conversion.getDefaultSingleByteCharacterset(). There is a problem in the continuos reader with a multi byte encoding's like utf-8 (if there are multi-byte characters). I will fix this problem. i.e. ICobolIOBuilder iob = JRecordInterface1.COBOL .newIOBuilder(copybookName) .setCopybookFileFormat(Cb2xmlConstants.USE_STANDARD_COLUMNS) .setFont(Conversion.getDefaultSingleByteCharacterset())...

  • Bruce Martin Bruce Martin modified a comment on discussion Help

    IO_BIN_TEXT is for reading single byte Text files (ASCII, Ebcdic etc). I would suggest trying running with a font (encoding) of cp1252. I do not think the continuos reader will work with a multi byte encoding like utf-8 (if there are multi-byte characters). i.e. ICobolIOBuilder iob = JRecordInterface1.COBOL .newIOBuilder(copybookName) .setCopybookFileFormat(Cb2xmlConstants.USE_STANDARD_COLUMNS) .setFont("cp1252") // .setFont("utf8") .setFileOrganization(IFileStructureConstants.IO_CONTINOUS_NO_LINE_MARKER)...

  • Bruce Martin Bruce Martin posted a comment on discussion Help

    IO_BIN_TEXT is for reading single byte Text files (ASCII, Ebcdic etc). I would suggest trying running with a font (encoding) of both cp1252 and utf8 i.e. ICobolIOBuilder iob = JRecordInterface1.COBOL .newIOBuilder(copybookName) .setCopybookFileFormat(Cb2xmlConstants.USE_STANDARD_COLUMNS) .setFont("cp1252") // .setFont("utf8") .setFileOrganization(IFileStructureConstants.IO_CONTINOUS_NO_LINE_MARKER) .setSplitCopybook(CopybookLoader.SPLIT_NONE) With the file you provided I found cp1252 works but utf-8...

  • AndySun1129 AndySun1129 posted a comment on discussion Help

    Thank you for your prompt response and guidance. I tried using IO_BIN_TEXT as suggested, but it seems to read the data based on line breaks. Since my file contains three records without any line separators, only the first record is being read. Could you please advise on how to properly read such files where records are contiguous without line breaks? Additionally, I attempted to use the CodeGen approach you mentioned to generate Java code from the COBOL copybook. However, I couldn’t locate the necessary...

  • Bruce Martin Bruce Martin posted a comment on discussion Help

    Looking at the file it is a standard Text file so you can use IFileStructureConstants.IO_BIN_TEXT i.e. ioBuilder = JRecordInterface1.COBOL.newIOBuilder(DESKTOP + "VBCPY.CPY").setFont("UTF-8") .setDialect(ICopybookDialects.FMT_MAINFRAME) .setFileOrganization(Constants.IO_BIN_TEXT); On a slightly different note In CodeGen can also use the .analyseDataFileSetAttributes() and CodeGen will try and work out file attributes (from the Cobol Copybook and Data file): import java.io.IOException; import javax.xml.stream.FactoryConfigurationError;...

  • AndySun1129 AndySun1129 modified a comment on discussion Help

    By the way, The test code is the same as the one I sent earlier.

  • AndySun1129 AndySun1129 modified a comment on discussion Help

  • AndySun1129 AndySun1129 modified a comment on discussion Help

    Thank you very much for your detailed explanation and the suggestions regarding the OCCURS DEPENDING ON error. It was very helpful in understanding the possible root causes. Following your advice, I am attaching the test files for your reference. During my debugging process, I noticed a specific point that might be crucial: the variable tmpLine seems to not be receiving any value during the read operation. This appears to happen before the code even attempts to calculate the ODO field's size, which...

  • AndySun1129 AndySun1129 posted a comment on discussion Help

    test files

  • AndySun1129 AndySun1129 posted a comment on discussion Help

    Thank you very much for your detailed explanation and the suggestions regarding the OCCURS DEPENDING ON error. It was very helpful in understanding the possible root causes. Following your advice, I am attaching the test files for your reference. During my debugging process, I noticed a specific point that might be crucial: the variable tmpLine seems to not be receiving any value during the read operation. This appears to happen before the code even attempts to calculate the ODO field's size, which...

  • Bruce Martin Bruce Martin posted a comment on discussion Help

    The error has occured because it is trying the calculate an occurs depending size and it has retrieved spaces. Possible causes include (this what I can think of) 1) A record length has been miscalculated and jrecord is looking in the wrong spot. 2) There is a redefines in the Copybook and the occurs depending is not beeing used The problem with files like this all it takes is some one to edit the file on the mainframe and add an extra space on the end of the record (line) and this is the result....

  • AndySun1129 AndySun1129 posted a comment on discussion Help

    Thank you for your prompt and detailed response. I appreciate the clear explanations and code examples. Regarding your explanation about single-record files, I understand that they should not require record selection rules since there's only one record type. I tried implementing the approach you suggested using: ICobolIOBuilder ioBuilder; AbstractLineReader reader; try { ioBuilder = JRecordInterface1.COBOL.newIOBuilder(DESKTOP + "VBCPY.CPY").setFont("UTF-8") .setDialect(ICopybookDialects.FMT_MAINFRAME)...

  • Bruce Martin Bruce Martin posted a comment on discussion Help

    General disclaimer - I would try and get the RDW sent if possible. Most file transfer programs have an option to transfer the RDW. Using the RDW will be more reliable. For a single record file, just using new ContinuousLineReader() like you are doing should work for a Single Record Type file (it will try and calculate record length using any Occurs depending definitions. You can also use .setFileOrganization(IFileStructureConstants.IO_CONTINOUS_NO_LINE_MARKER) in the IO definition ICobolIOBuilder...

  • AndySun1129 AndySun1129 posted a comment on discussion Help

    Hi Bruce, First and foremost, I would like to express my sincere gratitude for developing and sharing JRecord. It has been an incredibly useful tool in my work, and I truly appreciate the effort you have put into creating such a robust solution. I am want to seek your assistance regarding an issue I encountered while I am using JRecord 0.93.3 to read a VB file (with "depending on occurs"). The problem arises when I set the FileOrganization to IO_FIXED_LENGTH. In this case, every read method seems...

  • Bruce Martin Bruce Martin posted a comment on ticket #26

    I have uploaded the latest jars to https://sourceforge.net/projects/jrecord/files/jrecord/Version_0.93.4\ The latest source is available on Github: https://github.com/bmTas/JRecord I will upload a full source/jars file after I have tested it

  • JRecord JRecord released /jrecord/Version_0.93.4/JRecord_0.93.4_Readme.md

  • JRecord JRecord released /jrecord/Version_0.93.4/JRecord_0.93.4_Jars.zip

  • Anonymous posted a comment on ticket #26

    Thank you so much Bruce for providing the SBOM. I have passed it along to the AppSec team. I also noticed that the library uploaded here on Source forge is 0.93.2 while the SBOM was created with the newer version which is 0.93.4. Could you also upload 0.93.4 version here? I will get to know from the AppSec team shortly and I will update the status here so you can attach the SBOM in the repository itself.

  • Bruce Martin Bruce Martin modified a comment on ticket #26

    I have added cyclonedx to my personel maven build, it produced the attached sbom. Is this what you want ??? If it is I will move t into Github

  • Bruce Martin Bruce Martin posted a comment on ticket #26

    I have added cyclonedx to my personel maven build, it produced the attached sbom. Is this what you want ???

  • Anonymous posted a comment on ticket #26

    Thank you Bruce!

  • Bruce Martin Bruce Martin posted a comment on ticket #26

    I will look in to it

  • Anonymous created ticket #26

    SBOM required to use JRecord and CB2XML library

  • Martin Scheibe Martin Scheibe modified a comment on discussion Open Discussion

    Hello, (First and foremost, i like to thank Bruce Martin for his dedication, work and support. I think he helped a lot of people.) Im trying to build a custom .bin file using the JRecord libary. The file im trying to write has 3 kinds of lines (AbstractLines) each with a different layoutDetail. I can get one layoutDetail from a copybook (in .CPY format) but the other two layouts i have to custom build. So far i got code for the copybook layoutDetail, what seems to work as intended. LayoutDetail layoutDetail...

  • Bruce Martin Bruce Martin modified a comment on discussion Help

    Since we are dealing with an occurs depending you can 1) lookup the max array size (XYZ-COUNTER in this case) to work out the valid index's 2) Use the isFieldInRecord() method to check if it is a valid field. IFieldValue fieldValue = line.getFieldValue("XYZ-ABC-ID (1)"); if (fieldValue.isFieldInRecord() ) { process(fieldValue.asString()); } I will look at these 2 options: 1) Throwing an exception when accessing invalid array index 2) Returning 0/null. Should of realised this earlier

  • herbert wu herbert wu posted a comment on discussion Help

    Wow, looks like working! I will check more with users. Thanks!!!

  • Bruce Martin Bruce Martin posted a comment on discussion Help

    Since we are dealing with an occurs depending you can 1) lookup the max array size (XYZ-COUNTER in this case) to work out the valid index's 2) Use the isFieldInRecord() method to check if it is a valid field. IFieldValue fieldValue = line.getFieldValue("XYZ-ABC-ID (1)"); if (fieldValue.isFieldInRecord() ) { process(fieldValue.asString()); } I will look at yhese 2 options: 1) Throwing an exception when accessing invalid array index 2) Returning 0/null. Should of realised this earlier

  • herbert wu herbert wu posted a comment on discussion Help

    Attached is the mock copybook with same structure. Looks like data position shifted after "XYZ-COUNTER." line in reading. Data file has privacy issue, let me see what i can do.....

  • Bruce Martin Bruce Martin posted a comment on discussion Help

    Are there any 88 levels (Redefines) or multiple 01 levels ?? Are there any comp/comp-3 fields ??? Appart from that I would need to see the copybook and data to see what is going on.

  • Bruce Martin Bruce Martin modified a comment on discussion Help

    Hi Bruce, Thank you so much for your help. Sorry for the late reply. I upgraded to V-0.93.2 using CodeGen code and still have the same (B) problem in my original post in which XYZ-ABC-ID (1) field contains data(should be empty). Here are what I did: (1) Code Gen :::java CodeGenInterface.TEMPLATES.newTempateBuilder(copybookFile) .setDataFile(datasetFile) // .setCopybookSplitOption(CopybookSplit.SPLIT_01_LEVEL) .analyseDataFileSetAttributes() // .createRecordDecider() .setTemplate(StandardTemplates.STANDARD)...

  • Bruce Martin Bruce Martin modified a comment on discussion Help

    Hi Bruce, Thank you so much for your help. Sorry for the late reply. I upgraded to V-0.93.2 using CodeGen code and still have the same (B) problem in my original post in which XYZ-ABC-ID (1) field contains data(should be empty). Here are what I did: (1) Code Gen CodeGenInterface.TEMPLATES.newTempateBuilder(copybookFile) ~~~java .setDataFile(datasetFile) // .setCopybookSplitOption(CopybookSplit.SPLIT_01_LEVEL) .analyseDataFileSetAttributes() // .createRecordDecider() .setTemplate(StandardTemplates.STANDARD)...

  • herbert wu herbert wu posted a comment on discussion Help

    Hi Bruce, Thank you so much for your help. Sorry for the late reply. I upgraded to V-0.93.2 using CodeGen code and still have the same (B) problem in my original post in which XYZ-ABC-ID (1) field contains data(should be empty). Here are what I did: (1) Code Gen CodeGenInterface.TEMPLATES.newTempateBuilder(copybookFile) .setDataFile(datasetFile) // .setCopybookSplitOption(CopybookSplit.SPLIT_01_LEVEL) .analyseDataFileSetAttributes() // .createRecordDecider() .setTemplate(StandardTemplates.STANDARD)...

  • Bruce Martin Bruce Martin modified a comment on discussion Help

    With out seeing the Data file/Code I can not tell. You could try using either RecordEditor (or CodeGen) to generate JRecord Code from the copybook/data file see https://sourceforge.net/p/jrecord/wiki/Generate%20Code%20for%20Binary%20Cobol%20file/ Both RecordEditor & CodeGen will read a sample data file and try and work out the file structure. Iwill try and write a wiki about using a sample data file in CodeGen. This wiki talks about file structures on the mainframe: https://sourceforge.net/p/jrecord/wiki/File%20Organisation/...

  • Bruce Martin Bruce Martin posted a comment on discussion Help

    With out seeing the Data file/Code I can not tell. You could try using either RecordEditor (or CodeGen) to generate JRecord Code from the copybook/data file see https://sourceforge.net/p/jrecord/wiki/Generate%20Code%20for%20Binary%20Cobol%20file/ Both RecordEditor & CodeGen will read a sample data file and try and work out the file structure. Iwill try and write a wiki about using a sample data file in CodeGen. This wiki talks about file structures on the mainframe: https://sourceforge.net/p/jre...

  • Bruce Martin Bruce Martin modified a comment on discussion Help

    Hello, I am using JRecord 0.81.4 to read a Cobol file, and errored out on XYZ-COUNTER field with message: java.lang.NumberFormatException: For input string: "N" 05 XYZ-COUNTER PIC 9(02). 00002903 05 XYZ-INFO OCCURS 12 TIMES DEPENDING ON 00002910 XYZ-COUNTER. 10 XYZ-ABC-ID PIC X(06). 00003000 (A) Same above error with Java code: ICobolIOBuilder ioBldr = JRecordInterface1.COBOL .newIOBuilder(copybookFile) .setFileOrganization(Constants.IO_FIXED_LENGTH_RECORDS); return ioBldr.newReader(datasetFile);...

  • Bruce Martin Bruce Martin modified a comment on discussion Help

    Hello, I am using JRecord 0.81.4 to read a Cobol file, and errored out on XYZ-COUNTER field with message: java.lang.NumberFormatException: For input string: "N" 05 XYZ-COUNTER PIC 9(02). 00002903 05 XYZ-INFO OCCURS 12 TIMES DEPENDING ON 00002910 XYZ-COUNTER. 10 XYZ-ABC-ID PIC X(06). 00003000 (A) Same above error with Java code: ICobolIOBuilder ioBldr = JRecordInterface1.COBOL .newIOBuilder(copybookFile) .setFileOrganization(Constants.IO_FIXED_LENGTH_RECORDS); return ioBldr.newReader(datasetFile);...

  • Bruce Martin Bruce Martin modified a comment on discussion Help

    Hello, I am using JRecord 0.81.4 to read a Cobol file, and errored out on XYZ-COUNTER field with message: java.lang.NumberFormatException: For input string: "N" 05 XYZ-COUNTER PIC 9(02). 00002903 05 XYZ-INFO OCCURS 12 TIMES DEPENDING ON 00002910 XYZ-COUNTER. 10 XYZ-ABC-ID PIC X(06). 00003000 (A) Same above error with Java code: ICobolIOBuilder ioBldr = JRecordInterface1.COBOL .newIOBuilder(copybookFile) .setFileOrganization(Constants.IO_FIXED_LENGTH_RECORDS); return ioBldr.newReader(datasetFile);...

  • Bruce Martin Bruce Martin modified a comment on discussion Help

    Hello, I am using JRecord 0.81.4 to read a Cobol file, and errored out on XYZ-COUNTER field with message: java.lang.NumberFormatException: For input string: "N" 05 XYZ-COUNTER PIC 9(02). 00002903 05 XYZ-INFO OCCURS 12 TIMES DEPENDING ON 00002910 XYZ-COUNTER. 10 XYZ-ABC-ID PIC X(06). 00003000 (A) Same above error with Java code: ICobolIOBuilder ioBldr = JRecordInterface1.COBOL .newIOBuilder(copybookFile) .setFileOrganization(Constants.IO_FIXED_LENGTH_RECORDS); return ioBldr.newReader(datasetFile);...

  • Bruce Martin Bruce Martin modified a comment on discussion Help

    Hello, I am using JRecord 0.81.4 to read a Cobol file, and errored out on XYZ-COUNTER field with message: java.lang.NumberFormatException: For input string: "N" 05 XYZ-COUNTER PIC 9(02). 00002903 05 XYZ-INFO OCCURS 12 TIMES DEPENDING ON 00002910 XYZ-COUNTER. 10 XYZ-ABC-ID PIC X(06). 00003000 (A) Same above error with Java code: ICobolIOBuilder ioBldr = JRecordInterface1.COBOL .newIOBuilder(copybookFile) .setFileOrganization(Constants.IO_FIXED_LENGTH_RECORDS); return ioBldr.newReader(datasetFile);...

  • Bruce Martin Bruce Martin modified a comment on discussion Help

    Hello, I am using JRecord 0.81.4 to read a Cobol file, and errored out on XYZ-COUNTER field with message: java.lang.NumberFormatException: For input string: "N" 05 XYZ-COUNTER PIC 9(02). 00002903 05 XYZ-INFO OCCURS 12 TIMES DEPENDING ON 00002910 XYZ-COUNTER. 10 XYZ-ABC-ID PIC X(06). 00003000 (A) Same above error with Java code: ICobolIOBuilder ioBldr = JRecordInterface1.COBOL .newIOBuilder(copybookFile) .setFileOrganization(Constants.IO_FIXED_LENGTH_RECORDS); return ioBldr.newReader(datasetFile);...

  • herbert wu herbert wu posted a comment on discussion Help

    Hello, I am using JRecord 0.81.4 to read a Cobol file, and errored out on XYZ-COUNTER field with message: java.lang.NumberFormatException: For input string: "N" 05 XYZ-COUNTER PIC 9(02). 00002903 05 XYZ-INFO OCCURS 12 TIMES DEPENDING ON 00002910 XYZ-COUNTER. 10 XYZ-ABC-ID PIC X(06). 00003000 (A) Same above error with Java code: ICobolIOBuilder ioBldr = JRecordInterface1.COBOL .newIOBuilder(copybookFile) .setFileOrganization(Constants.IO_FIXED_LENGTH_RECORDS); return ioBldr.newReader(datasetFile);...

  • Lio Cubs Lio Cubs posted a comment on discussion Help

    Yes! It's working! I renamed the old jars to ".jar.old" but apparently they were still loaded by Gradle dependency management. Once I removed the old jars from the library it worked like a charm! Thank you so much for your commitment and support!

  • Bruce Martin Bruce Martin posted a comment on discussion Help

    Are tou sure, I just tested with String value = "1234.56"; cobolLine.getFieldValue("SUM-AMOUNT").set(value); System.out.println(cobolLine.getFullLine()); cobolLine.getFieldValue("SUM-AMOUNT").set(0); System.out.println(cobolLine.getFullLine()); cobolLine.getFieldValue("SUM-AMOUNT").set("-" +value); System.out.println(cobolLine.getFullLine()); mote: I have re-uploaded JRecord_2025_feb_13.zip this time including slf4j jars which are needed.

  • JRecord JRecord updated /jrecord/Version_0.93.2/JRecord_2025_feb_13.zip

  • Lio Cubs Lio Cubs posted a comment on discussion Help

    I used the jars from this feb_13 zip file, but unfortunately it seems that the PIC S9(13).99 fields are not yet supported as their 0 values are still saved as "0.00"... I haven't changed anything in the code other than remove the workaround related parts...

  • Bruce Martin Bruce Martin posted a comment on discussion Help

    I have updated Github with the source and the new Jars can be downloaded from https://sourceforge.net/projects/jrecord/files/jrecord/Version_0.93.2/ download JRecord_2025_feb_13.zip

  • JRecord JRecord released /jrecord/Version_0.93.2/JRecord_2025_feb_13.zip

  • Lio Cubs Lio Cubs posted a comment on discussion Help

    Amazing work! I wish I knew a bit deeper into JRecord code so I can contribute myself, it seems quite complicated. Apparently the reason for the error was cobolLine.getFieldValue(0, 59) as the FILLER is no longer on index 59 after I added the pt1/dot/pt2 fields. I changed it to field name and all good. Your help and support is much appreciated Bruce, well done and thank you! I'll keep an eye for the new release.

  • Bruce Martin Bruce Martin posted a comment on discussion Help

    I have changed JRecord to support fields like 03 SUM-AMOUNT PIC S9(13).99 SIGN IS LEADING SEPARATE CHARACTER. I will write test to cober the changed and update Github tomorrow if all goes well

  • Bruce Martin Bruce Martin posted a comment on discussion Help

    I could not duplicate the problem with the current JRecord. You could do val pt1 = if (pos < 0) value else value.substring(0, pos) I am writing a suggest way of the code.

  • Lio Cubs Lio Cubs posted a comment on discussion Help

    Thank you, great work! I tried to go with the second work around (editing the copybook), as I have more than 20 of these fields, so creating a 'Calc' class for each one seems too much... I believe I'm not implementing it correctly. I changed the copybook: 03 SUM-AMOUNT PIC S9(13).99 SIGN IS LEADING SEPARATE CHARACTER. 03 redefines SUM-AMOUNT. 05 SUM-AMOUNT-pt1 PIC S9(13) SIGN IS LEADING SEPARATE CHARACTER. 05 SUM-AMOUNT-dot PIC X VALUE '.'. 05 SUM-AMOUNT-pt2 PIC V99. 03 FILLER PIC X(129) VALUE SPACES....

  • Bruce Martin Bruce Martin posted a comment on discussion Help

    0 values are stored as 0.00 instead of their full definition e.g. +0000000000000.00 almost certainly will not work. I have a work around { Calc calc = new Calc(); String value = "1234.56"; cobolLine.getFieldValue("SUM-AMOUNT").setHex(calc.getHexValue(value)); } private static class Calc { ICobolIOBuilder iobCalc; AbstractLine line; Calc() throws IOException { iobCalc = JRecordInterface1.COBOL .newIOBuilder(new ReadCobolCopybook().setCopybookName("Calc").addFreeFormatCobolText("" + " 03 Calc.\n" +...

  • Lio Cubs Lio Cubs modified a comment on discussion Help

    Hi Bruce, First of all thank you so much for your quick reply, this helped a lot. Actually I had to keep "\r\n".toByteArray() for pRecordSep as without it the EOL was still LF (the CRLF_STRING for eolIndicator didn't cut it). Also, after setting initToSpaces=false I had to manually set the last FILLER to spaces: cobolLine.getFieldValue(0, 59).set(" ".repeat(129)) Good thing that the last FILLER is actually accessible (as the first one is not, and I gather it wasn't meant to be accessible anyhow)...

  • Lio Cubs Lio Cubs modified a comment on discussion Help

    Hi Bruce, First of all thank you so much for your quick reply, this helped a lot. Actually I had to keep "\r\n".toByteArray() for pRecordSep as without it the EOL was still LF (the CRLF_STRING for eolIndicator didn't cut it). Also, after setting initToSpaces=false I had to manually set the last FILLER to spaces: cobolLine.getFieldValue(0, 59).set(" ".repeat(129)) Good thing that the last FILLER is actually accessible (as the first one is not, and I gather it wasn't meant to be accessible anyhow)...

  • Lio Cubs Lio Cubs modified a comment on discussion Help

    Hi Bruce, First of all thank you so much for your quick reply, this helped a lot. Actually I had to keep "\r\n".toByteArray() for pRecordSep as without it the EOL was still LF (the CRLF_STRING for eolIndicator didn't cut it). Also, after setting initToSpaces=false I had to manually set the last FILLER to spaces: cobolLine.getFieldValue(0, 59).set(" ".repeat(129)) Good thing that the last FILLER is actually accessible (as the first one is not, and I gather it wasn't meant to be accessible anyhow)...

  • Lio Cubs Lio Cubs posted a comment on discussion Help

    Hi Bruce, First of all thank you so much for your quick reply, this helped a lot. Actually I had to keep "\r\n".toByteArray() for pRecordSep as without it the EOL was still LF (the CRLF_STRING for eolIndicator didn't cut it). Also, after setting initToSpaces=false I had to manually set the last FILLER to spaces: cobolLine.getFieldValue(0, 59).set(" ".repeat(129)) Good thing that the last FILLER is actually accessible (as the first one is not, and I gather it wasn't meant to be accessible anyhow)...

  • Bruce Martin Bruce Martin modified a comment on discussion Help

    If I modify the layout, why won't it use the CRLF I defined as the EOL indicator? The problem is you are not actually using the new customLayout the easiest option is to create a IO-Builder from the layout. i.e ISchemaIOBuilder customIOBuilder = JRecordInterface1.SCHEMA.newIOBuilder(customLayout); The first FILLER has LOW-VALUES for initialization, but it is stored with spaces (0x20), how can I fix that? There are 2 solutions: Set the initToSpaces flag to false when creating the customLayout When...

  • Bruce Martin Bruce Martin posted a comment on discussion Help

    If I modify the layout, why won't it use the CRLF I defined as the EOL indicator? The problem is you are not actually using the new customLayout the easiest option is to create a IO-Builder from the layout. i.e ISchemaIOBuilder customIOBuilder = JRecordInterface1.SCHEMA.newIOBuilder(customLayout); The first FILLER has LOW-VALUES for initialization, but it is stored with spaces (0x20), how can I fix that? There are 2 solutions: Set the initToSpaces flag to false when creating the customLayout When...

  • Lio Cubs Lio Cubs modified a comment on discussion Help

    Hi Bruce, I am trying to create a mainframe file which is a binary txt file (line-sequential, not FB/VB), to be formatted the same as an example file I received. Example file: https://gist.github.com/user-attachments/assets/840d790d-4c5b-4a02-9b37-2303afede23b My file: https://gist.github.com/user-attachments/assets/8d27625f-f6c0-410d-805b-dc150c862fcd There are three issues I can't seem to overcome: Running vi -b example-file.txt I can see that the EOL is ^M (CRLF), on my file it ends with LF (binary...

  • Lio Cubs Lio Cubs posted a comment on discussion Help

    Hi Bruce, I am trying to create a mainframe file which is a binary txt file (line-sequential, not FB/VB), to be formatted the same as an example file I received. Example file: https://gist.github.com/user-attachments/assets/840d790d-4c5b-4a02-9b37-2303afede23b My file: https://gist.github.com/user-attachments/assets/8d27625f-f6c0-410d-805b-dc150c862fcd There are three issues I can't seem to overcome: Running vi -b example-file.txt I can see that the EOL is ^M (CRLF), on my file it ends with LF (binary...

  • JRecord JRecord released /0.93.3/cb2xml.jar

  • JRecord JRecord released /0.93.3/JRecord.jar

  • JRecord JRecord released /0.93.3/README.md

  • JRecord JRecord released /0.93.3/Convert to Single module project source code.zip

  • JRecord JRecord released /0.93.3/Convert to Single module project source code.tar.gz

  • Bruce Martin Bruce Martin posted a comment on ticket #25

    Trying to avoid adding a notice. I would think that is ok (I am not a lawyer). cb2xml/JRecord are not in Maven central. I amin the process of: Merging / JRecord_Common and JRecord in to a single maven project Setting up so it can be used with JitPack (https://jitpack.io) Creating GitHub packages (maven can download provided you have maven setting set correctly

  • Anonymous posted a comment on ticket #25

    Hey Bruce, Wanted to understand how the licensing works on this library. We are planning to use this as a maven dependency to convert EBCDIC data to readable format and then generate files from that input. I dont believe it comes uder "Combined Works" section of the https://www.gnu.org/licenses/lgpl-3.0.en.html section 4. But wanted to see if I am correct.

  • JRecord JRecord released /0.93.1/cb2xml.jar

  • JRecord JRecord updated /0.93.1/JRecord.jar

  • JRecord JRecord updated /0.93.1/README.md

  • JRecord JRecord released /0.93.1/0.93.1 Updating Utilities source code.zip

  • JRecord JRecord released /0.93.1/0.93.1 Updating Utilities source code.tar.gz

  • JRecord JRecord released /0.93.1/JRecord.jar

  • JRecord JRecord released /0.93.1/README.md

  • JRecord JRecord released /0.93.1/0.93.1 Utility update source code.zip

  • JRecord JRecord released /0.93.1/0.93.1 Utility update source code.tar.gz

  • Anonymous posted a comment on ticket #25

    So I split my copy book into two parts for various record types and used the folliwng: ICobolIOBuilder ioBldr = JRecordInterface1.COBOL .newMultiCopybookIOBuilder("test") .setFileOrganization(Constants.IO_FIXED_LENGTH_RECORDS) .setFont("CP1047") .addCopyBook(("rec-type1.cbl")) .setSplitCopybook(CopybookLoader.SPLIT_NONE) .addCopyBook("rec-type4.cbl") .setSplitCopybook(CopybookLoader.SPLIT_NONE); I think I got it to work

  • Anonymous posted a comment on ticket #25

    The file probably has a record-length longer than 325 in 325-file description. You can directly set the Record-Length using the setRecordLength. This has to be done in seperate statement : Icb2xmlIOBuilder ioBldr = JRecordInterface1.CB2XML .newIOBuilder("copybook_new.cbl.xml") .setFont("cp037") .setFileOrganization(Constants.IO_FIXED_LENGTH) .setSplitCopybook(CopybookLoader.SPLIT_01_LEVEL); ioBldr.setRecordLength(330); You now have to find out/work out the actual record length. Options Check Source...

  • Bruce Martin Bruce Martin posted a comment on ticket #21

    yes

  • Anonymous posted a comment on ticket #21

    Hi Bruce, will this also take the packed decimal conversion into account?

  • Anonymous posted a comment on ticket #25

    Thanks for looking into the issue, The incomeing file is of binary type and has ebcdic encoding on it, thats why I am using CP037, after chnging it to Constants.IO_UNICODE_TEXT I get the exception : This is a binary Layout (Schema) but you have selected a Character file Organisation, you must use you must Byte based Organisation Which makes sense to me. This is how my xml looks like: <item level="01" name="RECORD-TYPE1" position="1" storage-length="325" display-length="364" display-position="1">...

  • Bruce Martin Bruce Martin modified ticket #25

    Unable to read Variable length File

  • Bruce Martin Bruce Martin modified ticket #25

    Unable to read Variable length File

  • Bruce Martin Bruce Martin posted a comment on ticket #25

    Try using Constants.IO_STANDARD_TEXT_FILE or Constants.IO_UNICODE_TEXT. I will update the comments Also yow will need to remove .setFont("cp037") - cp037 is ebcdic Note: * Constants.IO_VB - Mainframe VB file each line starts with a record-length * Constants.IO_FIXED_LENGTH - each line is exactly the same length, no end of line characters * Constants.IO_STANDARD_TEXT_FILE -standard ascii text file * Constants.IO_UNICODE_TEXT - for UTF8/16/32 (especially multi byte characters are present

  • Anonymous created ticket #25

    Unable to read Variable length File

  • JRecord JRecord released /jrecord_CodeGen/Version_0.93.2/JRecord_CodeGen_0.93.2.zip

  • JRecord JRecord released /jrecord_CodeGen/Version_0.93.2/ReadMe_CodeGen_0.93.2.md

1 >