Menu

#1 support for cobol occurs with length field

closed
None
5
2017-11-01
2010-01-19
Anonymous
No

hello,
if a host exports data with a cobol copybook, not all columns are filled and the counter is set. Each record can have its own length. The maximum occuring columns is well defined with occurs nn.
JRecord only will read those data as a stream and fills all columns of a record with this data ignoring the length field.
So the next record will be appended when the first one doesn't fill out the complete structure.
Regards and thanx so far
Frank

Discussion

  • Bruce Martin

    Bruce Martin - 2010-01-20

    Adding support for Occurs Depending needs to be added to JRecord/cb2xml.
    Not sure when I will be able to do it though

    However provided
    1) The variable length Array is a the end of the Record
    2) You can make some changes on the Mainframe

    You will not need this enhancement.

    On the mainframe, It stores the length of each record in the file. This length is then dropped when transmitted to the PC/Unix system. I put some notes on transporting & reading VB files here http://jrecord.sourceforge.net/MainframeVBnotes.html

    hopefully it is of some use

    Bruce

     
  • Bruce Martin

    Bruce Martin - 2010-01-20

    If you need any help with Mainframe side, let me know.

    Bruce

     
  • Bruce Martin

    Bruce Martin - 2015-11-10

    Occurs depending is supported now

     
  • Bruce Martin

    Bruce Martin - 2015-11-10
    • status: open --> pending
    • Group: --> Next_Release_(example)
     
  • Anonymous

    Anonymous - 2016-03-17

    I have copy book with below details. I need to find the occurs length using JRecord..
    DR-NAME-ADDR(1) OCCUR 4 TIMES.
    Please Help us to resolve this issue.

     
  • Bruce Martin

    Bruce Martin - 2016-03-17

    I will look in to it, but why do you need to find it with JRecord ???, you can see it in the copybook

     
  • Anonymous

    Anonymous - 2016-05-13

    Is there any way to access the full field path in the copy book.

    Copy book

    01 WS-Add
          05 WS-B
                10 WS-C PIC(8)
    

    Here Using Jrecord can I able to get the field like this, WS-ADD.WS-B.WS-C
    I have a requirement to get the complete path of the field.

     

    Last edit: Bruce Martin 2016-05-13
  • Bruce Martin

    Bruce Martin - 2016-05-13

    Yes you can get it from the FieldDetail (provided you are comming directly from the Cobol).
    There is a getGroup() of the FieldDetail class (but not the IFieldDetail interface, all IFieldDetails will be
    the FieldDetail class).
    Basically either of the following should work (I have not test either though, there could be some errors)

    e.g.

        LayoutDetail schema = ioBuilder.getLayout();
        FieldDetail myField = schema.getField("My-Field");
        String group = myField.getGroup().substring(1) + "." + myField.getName();
    
          ....
    
        System.out.println(group + " = " + line.getFieldValue(myField).asString();
    

    alternatively you can do

        IFieldValue fv =  line.getFieldValue("My-Field");
        System.out.println(((FieldDetail) fv.getField()).getGroup().substring(1) + " = " + fv.asString();
    
     
  • Bruce Martin

    Bruce Martin - 2017-11-01
    • status: pending --> closed
     

Anonymous
Anonymous

Add attachments
Cancel