Topic
  • 13 replies
  • Latest Post - ‏2013-04-01T17:30:03Z by ivyho
SystemAdmin
SystemAdmin
1660 Posts

Pinned topic generate java binding object from COBOL copybook in RAD

‏2007-06-19T17:01:21Z |
Till now i was using WSADIE 5.1 in generating java binding objects from COBOL copybook through Business integration perspective. I want to know which version of RAD had this facility and which options to choose for generation(like Business integration in WSAD IE). As in RAD 6.0.0 i am not seeing any option for the same.

Appreciate for quick response.

Thanks,
Manoj
Updated on 2013-04-01T17:30:03Z at 2013-04-01T17:30:03Z by ivyho
  • SystemAdmin
    SystemAdmin
    1660 Posts

    Re: generate java binding object from COBOL copybook in RAD

    ‏2007-06-20T15:04:37Z  
    manoj.kumar.choudhury@citigroup.com wrote:
    > Till now i was using WSADIE 5.1 in generating java binding objects from COBOL copybook through Business integration perspective. I want to know which version of RAD had this facility and which options to choose for generation(like Business integration in WSAD IE). As in RAD 6.0.0 i am not seeing any option for the same.
    >
    > Appreciate for quick response.
    >
    > Thanks,
    > Manoj

    You need WebSphere Integration Developer for the Business Integration
    perspective.
  • SystemAdmin
    SystemAdmin
    1660 Posts

    Re: generate java binding object from COBOL copybook in RAD

    ‏2007-06-20T15:41:55Z  
    The J2C tools which have this capability in RAD 6.0.0 is an optional
    install feature. Use the software updates from menu to install this
    feature.

    Harold Gartner
    IBM Canada Laboratory
  • SystemAdmin
    SystemAdmin
    1660 Posts

    Re: generate java binding object from COBOL copybook in RAD

    ‏2007-06-20T15:43:09Z  
    manoj.kumar.choudhury@citigroup.com wrote:
    > Till now i was using WSADIE 5.1 in generating java binding objects from COBOL copybook through Business integration perspective. I want to know which version of RAD had this facility and which options to choose for generation(like Business integration in WSAD IE). As in RAD 6.0.0 i am not seeing any option for the same.
    >
    > Appreciate for quick response.
    >
    > Thanks,
    > Manoj

    You need WebSphere Integration Developer for the Business Integration
    perspective.
    So, how can i generate java classes in RAD and which version of RAD supports this?
  • SystemAdmin
    SystemAdmin
    1660 Posts

    Re: generate java binding object from COBOL copybook in RAD

    ‏2007-06-22T17:22:58Z  
    The J2C tools which have this capability in RAD 6.0.0 is an optional
    install feature. Use the software updates from menu to install this
    feature.

    Harold Gartner
    IBM Canada Laboratory
    I got the J2C option after installing the feature.Thanks. I have a new problem right now while generating java binding classes in RAD. I have imported resource adapter(cicseci5102.rar) and set correct properties like z/OS platform, EBCDIC decimal sign etc. The problem is, the format of java class is different from the one created in WSAD IE 5.1. Am i doing some wrong that results in a different format. Also the cobol file(.ccp) used in WSAD is not working in RAD. I have to add headers in beginning like IDENTIFICATION DIVISION,PROGRAM-ID,DATA DIVISION etc. Can you please tell how to genarate java binding objects in RAD with same format with WSAD IE.

    Thanks,
    Manoj
  • SystemAdmin
    SystemAdmin
    1660 Posts

    Re: generate java binding object from COBOL copybook in RAD

    ‏2007-06-25T16:56:07Z  
    I got the J2C option after installing the feature.Thanks. I have a new problem right now while generating java binding classes in RAD. I have imported resource adapter(cicseci5102.rar) and set correct properties like z/OS platform, EBCDIC decimal sign etc. The problem is, the format of java class is different from the one created in WSAD IE 5.1. Am i doing some wrong that results in a different format. Also the cobol file(.ccp) used in WSAD is not working in RAD. I have to add headers in beginning like IDENTIFICATION DIVISION,PROGRAM-ID,DATA DIVISION etc. Can you please tell how to genarate java binding objects in RAD with same format with WSAD IE.

    Thanks,
    Manoj
    For you COBOL file you need to specify to the importer what you source
    contains. Go to:

    Window --> Preferences --> Importer --> COBOL

    then on the 'More COBOL options' tab specify the 'File extension support'.

    The bean generated should match the bean created by WSAD-IE, provided
    you specify the same 'Generation Style' you used in WSAD-IE on the
    'Saving Properties' page.

    Note that there is no longer any WSIF support in these classes, so can
    you describe how you see the generated bean being different that the one
    generated in WSAD-IE? All of the getters and setters for the fields in
    you COBOL file should have the same names.

    Harold Gartner
    IBM Canada Laboratory
  • SystemAdmin
    SystemAdmin
    1660 Posts

    Re: generate java binding object from COBOL copybook in RAD

    ‏2007-06-25T19:53:23Z  
    For you COBOL file you need to specify to the importer what you source
    contains. Go to:

    Window --> Preferences --> Importer --> COBOL

    then on the 'More COBOL options' tab specify the 'File extension support'.

    The bean generated should match the bean created by WSAD-IE, provided
    you specify the same 'Generation Style' you used in WSAD-IE on the
    'Saving Properties' page.

    Note that there is no longer any WSIF support in these classes, so can
    you describe how you see the generated bean being different that the one
    generated in WSAD-IE? All of the getters and setters for the fields in
    you COBOL file should have the same names.

    Harold Gartner
    IBM Canada Laboratory
    here are the differences with generated beans with RAD and WSADIE
    1. In WSAD, two java classes are generated, one is the bean and 2nd one is FormatHandler class. But in RAD only one bean class is generated with all the implementations. I guess thats the way it is in RAD.

    2. The setters and getters count and naming convention are same in both, but as a whole the structures are different. in WSAD the bean class extends WSIFFormatPartImpl, but in RAD the bean implements javax.resource.cci.Record,javax.resource.cci.Streamable,com.ibm.etools.marshall.RecordBytes. So i have to extend the same doing changes to make it workable as it has fireElementEvents() method. also com.ibm.etools.marshall.RecordBytes is giving runtime error.so i have to remove it and it works.

    3. the .ccp files used in WSAD IE to generate beans doesn't work in RAD. Have to add the attributes IDENTIFICATION DIVISION.,PROGRAM-ID.,ENVIRONMENT DIVISION.
    DATA DIVISION.,WORKING-STORAGE SECTION. in beginning of .ccp to be able to generate java classes. are these fields has to be mentioned while using RAD?

    So running in RAD requires few changes like:
    -change all .ccp files by adding the attributes
    -Change the bean class by extending WSIFFormatPartImpl there in wsatlib.jar
    -FormatHandler class will no more be used, so code has to be changed by removing the references.
  • SystemAdmin
    SystemAdmin
    1660 Posts

    Re: generate java binding object from COBOL copybook in RAD

    ‏2007-06-26T17:11:48Z  
    here are the differences with generated beans with RAD and WSADIE
    1. In WSAD, two java classes are generated, one is the bean and 2nd one is FormatHandler class. But in RAD only one bean class is generated with all the implementations. I guess thats the way it is in RAD.

    2. The setters and getters count and naming convention are same in both, but as a whole the structures are different. in WSAD the bean class extends WSIFFormatPartImpl, but in RAD the bean implements javax.resource.cci.Record,javax.resource.cci.Streamable,com.ibm.etools.marshall.RecordBytes. So i have to extend the same doing changes to make it workable as it has fireElementEvents() method. also com.ibm.etools.marshall.RecordBytes is giving runtime error.so i have to remove it and it works.

    3. the .ccp files used in WSAD IE to generate beans doesn't work in RAD. Have to add the attributes IDENTIFICATION DIVISION.,PROGRAM-ID.,ENVIRONMENT DIVISION.
    DATA DIVISION.,WORKING-STORAGE SECTION. in beginning of .ccp to be able to generate java classes. are these fields has to be mentioned while using RAD?

    So running in RAD requires few changes like:
    -change all .ccp files by adding the attributes
    -Change the bean class by extending WSIFFormatPartImpl there in wsatlib.jar
    -FormatHandler class will no more be used, so code has to be changed by removing the references.
    1. The structure is now different because WSIF is no longer used as a
    runtime. There is only one class now.

    2. Can you explain the runtime error you are getting for the
    com.ibm.etools.marshall.RecordBytes interface? It is part of base WAS
    contained in the marshall.jar file.

    3. You don't need to add any code to you copybooks (.ccp files). You
    need to specify to the importer what a given file extension contains. Go
    to:
    Window --> Preferences --> Importer --> COBOL
    then on the 'More COBOL options' tab specify the 'File extension support'.
    The default for a .ccp extension is that file file contains a complete
    program.

    You shouldn't be using WSIF at all. From a programming perspective the
    api on the bean you should have been programming to has not changed at
    all. There is no need to 'fireElementEvents()' as the data is
    immediately marshalled when you do a get or set on the record.

    Harold Gartner
    IBM Canada Laboratory
  • SystemAdmin
    SystemAdmin
    1660 Posts

    Re: generate java binding object from COBOL copybook in RAD

    ‏2007-06-26T17:17:05Z  
    1. The structure is now different because WSIF is no longer used as a
    runtime. There is only one class now.

    2. Can you explain the runtime error you are getting for the
    com.ibm.etools.marshall.RecordBytes interface? It is part of base WAS
    contained in the marshall.jar file.

    3. You don't need to add any code to you copybooks (.ccp files). You
    need to specify to the importer what a given file extension contains. Go
    to:
    Window --> Preferences --> Importer --> COBOL
    then on the 'More COBOL options' tab specify the 'File extension support'.
    The default for a .ccp extension is that file file contains a complete
    program.

    You shouldn't be using WSIF at all. From a programming perspective the
    api on the bean you should have been programming to has not changed at
    all. There is no need to 'fireElementEvents()' as the data is
    immediately marshalled when you do a get or set on the record.

    Harold Gartner
    IBM Canada Laboratory
    One more thing I forgot to mention, you can migrate all of you existing
    WSAD-IE artifacts without having to re-import your COBOL files by doing
    a New --> J2C --> Migration --> J2C Service Migration.

    Harold Gartner
    IBM Canada Laboratory
  • SystemAdmin
    SystemAdmin
    1660 Posts

    Re: generate java binding object from COBOL copybook in RAD

    ‏2007-06-26T19:57:32Z  
    Thanks Harold, things are working gradually as we move further. Right now no need to call fireElementEvents(), as the data is marshalled when i do a get or set on the record. So no need to extend the interface WSIFFormatPartImpl.

    the runtime error for interface com.ibm.etools.marshall.RecordBytes is:

    Error 500: Error occured during request processing: Error while defining class: <my class implementing this interface> This error indicates that the class: com.ibm.etools.marshall.RecordBytes could not be located while defining the class: <my class implementing this interface> This is often caused by having the class at a higher point in the classloader hierarchy Dumping the current context classloader hierarchy: ==> indicates defining classloader *** indicates classloader where the missing class could have been found ==>[0] com.ibm.ws.classloader.CompoundClassLoader@182eaaa5 Local ClassPath:
    ---Original exception--- java.lang.NoClassDefFoundError: com/ibm/etools/marshall/RecordBytes at java.lang.ClassLoader.defineClass0(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java(Compiled Code)) at .....

    And your point 3: says no need to change the .ccp file.
    I went to the option Window --> Preferences --> Importer --> COBOL-->more COBOL options. under File extension support there are 4 entries. 3 of them are .cbl,.ccp,.cob(Full program) and 1 with .cpy(Data structures only). Is there anything i need to change here?
    if i dont add the headers getting error below(few lines..):

    IWAA0647E: Syntax errors found. Please check the validity of the source file and try again. Check the log files for information on the syntax errors.
    1. IGYDS1000-E A "IDENTIFICATION DIVISION" header was not found in this program. It was assumed present.
    2. IGYDS1003-E A "PROGRAM-ID" paragraph was not found. Program-name "CBLNAM01" was assumed.
    3. IGYDS1022-E A data-name or file-name definition was found outside of the "DATA DIVISION". Scanning was resumed at the next area "A" item or the start of the next entry.
    ...
    ...

    Thanks a lot!
  • SystemAdmin
    SystemAdmin
    1660 Posts

    Re: generate java binding object from COBOL copybook in RAD

    ‏2007-06-27T16:45:58Z  
    Thanks Harold, things are working gradually as we move further. Right now no need to call fireElementEvents(), as the data is marshalled when i do a get or set on the record. So no need to extend the interface WSIFFormatPartImpl.

    the runtime error for interface com.ibm.etools.marshall.RecordBytes is:

    Error 500: Error occured during request processing: Error while defining class: <my class implementing this interface> This error indicates that the class: com.ibm.etools.marshall.RecordBytes could not be located while defining the class: <my class implementing this interface> This is often caused by having the class at a higher point in the classloader hierarchy Dumping the current context classloader hierarchy: ==> indicates defining classloader *** indicates classloader where the missing class could have been found ==>[0] com.ibm.ws.classloader.CompoundClassLoader@182eaaa5 Local ClassPath:
    ---Original exception--- java.lang.NoClassDefFoundError: com/ibm/etools/marshall/RecordBytes at java.lang.ClassLoader.defineClass0(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java(Compiled Code)) at .....

    And your point 3: says no need to change the .ccp file.
    I went to the option Window --> Preferences --> Importer --> COBOL-->more COBOL options. under File extension support there are 4 entries. 3 of them are .cbl,.ccp,.cob(Full program) and 1 with .cpy(Data structures only). Is there anything i need to change here?
    if i dont add the headers getting error below(few lines..):

    IWAA0647E: Syntax errors found. Please check the validity of the source file and try again. Check the log files for information on the syntax errors.
    1. IGYDS1000-E A "IDENTIFICATION DIVISION" header was not found in this program. It was assumed present.
    2. IGYDS1003-E A "PROGRAM-ID" paragraph was not found. Program-name "CBLNAM01" was assumed.
    3. IGYDS1022-E A data-name or file-name definition was found outside of the "DATA DIVISION". Scanning was resumed at the next area "A" item or the start of the next entry.
    ...
    ...

    Thanks a lot!
    In what type of environment are you running your code in order to get
    this class loading error? I've never seen it before.

    In the COBOL options tab, change '.ccp' from 'Full program' to 'Data
    structures only' and your COBOL file will import correctly. The
    importer is now based on the COBOL compiler and by default it expects a
    file with a '.ccp' extension to contain a full program.

    Harold Gartner
    IBM Canada Laboratory
  • SystemAdmin
    SystemAdmin
    1660 Posts

    Re: generate java binding object from COBOL copybook in RAD

    ‏2007-06-28T14:12:29Z  
    In what type of environment are you running your code in order to get
    this class loading error? I've never seen it before.

    In the COBOL options tab, change '.ccp' from 'Full program' to 'Data
    structures only' and your COBOL file will import correctly. The
    importer is now based on the COBOL compiler and by default it expects a
    file with a '.ccp' extension to contain a full program.

    Harold Gartner
    IBM Canada Laboratory
    Afer changing the File extension support to 'Data structures only' resolved the problem, no need to modify .ccp files anymore.

    The runtime NoClassDefFoundError exception is coming for interface RecordBytes eventhough the marshall.jar is added in the build path(from RAD6.0, runtimes/base v6 folder). i am using RAD 6.0.1 version with JRE v6.
    One more point is, when i remove the interface com.ibm.etools.marshall.RecordBytes from the java binding class from implementing, then it works fine. But removing the inerface is not a good idea.
  • SystemAdmin
    SystemAdmin
    1660 Posts

    Re: generate java binding object from COBOL copybook in RAD

    ‏2008-10-05T05:08:25Z  
    The J2C tools which have this capability in RAD 6.0.0 is an optional
    install feature. Use the software updates from menu to install this
    feature.

    Harold Gartner
    IBM Canada Laboratory
    hi Harold,
    I have RAD 6.0.1, I need to generate a javabean (setter getter methods) from a cobol copybook. I did the procedure to enable the J2C wizard, using procedure I found on the IBM developer works website, see below. It did not work, I still do not see the J2C wizard, I clicked on File > New > Other; I do not see the J2C ; any help would be most appreciated, thanks.

    procedure I found on the IBM developer works website:
    1. From the menu bar, click Window > Preferences.
    2. On the left side of the Preferences window, expand Workbench.
    3. Click Capabilities. The Capabilities pane is displayed. If you would like to receive a prompt when a feature is first used that requires an enabled capability, select the check box for Prompt when enabling capabilities.
    4. Expand the Enterprise Java™ folder.
    5. Select the Enterprise Java check box. The necessary J2C capability is now enabled. Alternatively, you can select the Enterprise Java capability folder to enable all of the capabilities that folder contains. To set the list of enabled capabilities back to its state at product install time, click Restore Defaults.
    6. To save your changes, click Apply, and then clickOK.
  • ivyho
    ivyho
    3 Posts

    Re: generate java binding object from COBOL copybook in RAD

    ‏2013-04-01T17:30:03Z  
    1. The structure is now different because WSIF is no longer used as a
    runtime. There is only one class now.

    2. Can you explain the runtime error you are getting for the
    com.ibm.etools.marshall.RecordBytes interface? It is part of base WAS
    contained in the marshall.jar file.

    3. You don't need to add any code to you copybooks (.ccp files). You
    need to specify to the importer what a given file extension contains. Go
    to:
    Window --> Preferences --> Importer --> COBOL
    then on the 'More COBOL options' tab specify the 'File extension support'.
    The default for a .ccp extension is that file file contains a complete
    program.

    You shouldn't be using WSIF at all. From a programming perspective the
    api on the bean you should have been programming to has not changed at
    all. There is no need to 'fireElementEvents()' as the data is
    immediately marshalled when you do a get or set on the record.

    Harold Gartner
    IBM Canada Laboratory
    Some more details why the 'fireElementEvents()' method is not longer necessary. (credit to Harold).

    In WSAD-IE there was a regular Java bean with field for each property which was attached to a format handler (which contained the byte array). The method would push any values set on the bean into the format handler byte array. In RAD the bean (ie. data binding) writes directly to the byte array.

    That is why in RAD, it simplifies and the 'fireElementEvents()' method is no longer needed.