Topic
  • 4 replies
  • Latest Post - ‏2013-05-10T01:10:44Z by cobol2java
cobol2java
cobol2java
6 Posts

Pinned topic How can I generate more than one j2c bean using J2C ant script in CICS/IMS databinding in RAD

‏2013-05-10T00:42:28Z |

When we go through the J2C ->CICS\IMS data binding to generate java bean from cobol book, the ant script we generate can only generate one single java data binding.

How can we generate more than one in the J2C ant script?

  • ivyho
    ivyho
    4 Posts
    ACCEPTED ANSWER

    Re: How can I generate more than one j2c bean using J2C ant script in CICS/IMS databinding in RAD

    ‏2013-05-10T00:59:26Z  

    When you use the "Save session as Ant script"  , you can browse to an existing  J2C ant script , and it will prompt you whether you want to overwrite the file or append the content.

    Select the append option, then addtional bean generation session will be saved in the same ant script.

    This is an example of the resulting ant script using the append option.

     

    The first time, when I go through the CICS\IMS data binding wizard, I will just "Save session as Ant script", it will create a brand new J2C ant script.

    The second time when I go through the wizard to generate the bean, I will use the append option on the same J2C ant script.

    Another way of doing that , is to manually duplicate the code in the ant script  if all your copy book generation and settings are similar. Then

    modify the different values. e.g the new project name, data binding class, copybook location or data area etc.

    But manually modify things could be error prone.

    This is an example of the generate ant script which can create 2 data binding files

     

     

     

     

    Attachments

  • cobol2java
    cobol2java
    6 Posts
    ACCEPTED ANSWER

    Re: How can I generate more than one j2c bean using J2C ant script in CICS/IMS databinding in RAD

    ‏2013-05-10T01:07:03Z  
    • ivyho
    • ‏2013-05-10T00:59:26Z

    When you use the "Save session as Ant script"  , you can browse to an existing  J2C ant script , and it will prompt you whether you want to overwrite the file or append the content.

    Select the append option, then addtional bean generation session will be saved in the same ant script.

    This is an example of the resulting ant script using the append option.

     

    The first time, when I go through the CICS\IMS data binding wizard, I will just "Save session as Ant script", it will create a brand new J2C ant script.

    The second time when I go through the wizard to generate the bean, I will use the append option on the same J2C ant script.

    Another way of doing that , is to manually duplicate the code in the ant script  if all your copy book generation and settings are similar. Then

    modify the different values. e.g the new project name, data binding class, copybook location or data area etc.

    But manually modify things could be error prone.

    This is an example of the generate ant script which can create 2 data binding files

     

     

     

     

    I saw that there are different project variables -

    <property name="project3" value="TestJ2CDB1"/>

    <property name="project2" value="TestJ2CDB2"/>

    If my project is the same one, can I just use one variable?

    In the createProject, will it  fail if the project already exists?

    adapter:createProject projectName="${project1}" projectType="Java" sourceFolder="/src"/>

     

    Updated on 2013-05-10T01:11:40Z at 2013-05-10T01:11:40Z by cobol2java
  • ivyho
    ivyho
    4 Posts
    ACCEPTED ANSWER

    Re: How can I generate more than one j2c bean using J2C ant script in CICS/IMS databinding in RAD

    ‏2013-05-10T01:10:03Z  

    I saw that there are different project variables -

    <property name="project3" value="TestJ2CDB1"/>

    <property name="project2" value="TestJ2CDB2"/>

    If my project is the same one, can I just use one variable?

    In the createProject, will it  fail if the project already exists?

    adapter:createProject projectName="${project1}" projectType="Java" sourceFolder="/src"/>

     

    yes, you can modify to use one property name - e.g. project2.

    But make sure that you change all the places that are referencing project3 in the ant script.

    If the project already exists, the createProject will not fail. it will first check if the project exist, if it does not exist .it will create it.

    If the project already exist, it will just return.

     

  • ivyho
    ivyho
    4 Posts

    Re: How can I generate more than one j2c bean using J2C ant script in CICS/IMS databinding in RAD

    ‏2013-05-10T00:59:26Z  

    When you use the "Save session as Ant script"  , you can browse to an existing  J2C ant script , and it will prompt you whether you want to overwrite the file or append the content.

    Select the append option, then addtional bean generation session will be saved in the same ant script.

    This is an example of the resulting ant script using the append option.

     

    The first time, when I go through the CICS\IMS data binding wizard, I will just "Save session as Ant script", it will create a brand new J2C ant script.

    The second time when I go through the wizard to generate the bean, I will use the append option on the same J2C ant script.

    Another way of doing that , is to manually duplicate the code in the ant script  if all your copy book generation and settings are similar. Then

    modify the different values. e.g the new project name, data binding class, copybook location or data area etc.

    But manually modify things could be error prone.

    This is an example of the generate ant script which can create 2 data binding files

     

     

     

     

    Attachments

  • cobol2java
    cobol2java
    6 Posts

    Re: How can I generate more than one j2c bean using J2C ant script in CICS/IMS databinding in RAD

    ‏2013-05-10T01:07:03Z  
    • ivyho
    • ‏2013-05-10T00:59:26Z

    When you use the "Save session as Ant script"  , you can browse to an existing  J2C ant script , and it will prompt you whether you want to overwrite the file or append the content.

    Select the append option, then addtional bean generation session will be saved in the same ant script.

    This is an example of the resulting ant script using the append option.

     

    The first time, when I go through the CICS\IMS data binding wizard, I will just "Save session as Ant script", it will create a brand new J2C ant script.

    The second time when I go through the wizard to generate the bean, I will use the append option on the same J2C ant script.

    Another way of doing that , is to manually duplicate the code in the ant script  if all your copy book generation and settings are similar. Then

    modify the different values. e.g the new project name, data binding class, copybook location or data area etc.

    But manually modify things could be error prone.

    This is an example of the generate ant script which can create 2 data binding files

     

     

     

     

    I saw that there are different project variables -

    <property name="project3" value="TestJ2CDB1"/>

    <property name="project2" value="TestJ2CDB2"/>

    If my project is the same one, can I just use one variable?

    In the createProject, will it  fail if the project already exists?

    adapter:createProject projectName="${project1}" projectType="Java" sourceFolder="/src"/>

     

    Updated on 2013-05-10T01:11:40Z at 2013-05-10T01:11:40Z by cobol2java
  • ivyho
    ivyho
    4 Posts

    Re: How can I generate more than one j2c bean using J2C ant script in CICS/IMS databinding in RAD

    ‏2013-05-10T01:10:03Z  

    I saw that there are different project variables -

    <property name="project3" value="TestJ2CDB1"/>

    <property name="project2" value="TestJ2CDB2"/>

    If my project is the same one, can I just use one variable?

    In the createProject, will it  fail if the project already exists?

    adapter:createProject projectName="${project1}" projectType="Java" sourceFolder="/src"/>

     

    yes, you can modify to use one property name - e.g. project2.

    But make sure that you change all the places that are referencing project3 in the ant script.

    If the project already exists, the createProject will not fail. it will first check if the project exist, if it does not exist .it will create it.

    If the project already exist, it will just return.

     

  • cobol2java
    cobol2java
    6 Posts

    Re: How can I generate more than one j2c bean using J2C ant script in CICS/IMS databinding in RAD

    ‏2013-05-10T01:10:44Z  

    I saw that there are different project variables -

    <property name="project3" value="TestJ2CDB1"/>

    <property name="project2" value="TestJ2CDB2"/>

    If my project is the same one, can I just use one variable?

    In the createProject, will it  fail if the project already exists?

    adapter:createProject projectName="${project1}" projectType="Java" sourceFolder="/src"/>

     

    Perfect, Thank you so much for your quick reply to me.

    You are awesome.