Topic
  • 2 replies
  • Latest Post - ‏2013-05-10T01:40:13Z by cobol2java
cobol2java
cobol2java
6 Posts

Pinned topic what is preserve case of names -generation style ?

‏2013-05-10T01:16:16Z |

I  am newbie to this.  in rational Application Developer cics\data binding wizard.

When I generate java code from cobol copy book.

What is preserve case of names in the generation style?

 

  • ivyho
    ivyho
    4 Posts
    ACCEPTED ANSWER

    Re: what is preserve case of names -generation style ?

    ‏2013-05-10T01:38:23Z  

    Hi

    Preserve case of names' matches VisualAge for Java generation options: direct, no notification, no inner class, no shorten names, and with primitive type arrays.
     

    It will try to preserve the name. e.g. if you copy book has a field -  Customer

    The java method getCustomer and setCustomer.

    also there will be a customer field generated

     

    public String getCustomer() {
            String customer = null;
            customer = MarshallStringUtils.unmarshallFixedLengthStringFromBuffer(
                    buffer_, 0, "IBM-037", 20);
            return (customer);
        }
     

     

     

    public void setCustomer(String customer) {
            if (customer != null) {
                if (customer.length() > 20)
                    throw new IllegalArgumentException(MarshallResource.instance()
                            .getString(MarshallResource.IWAA0124E, customer, "20",
                                    "customer"));
                MarshallStringUtils.marshallFixedLengthStringIntoBuffer(customer,
                        buffer_, 0, "IBM-037", 20,
                        MarshallStringUtils.STRING_JUSTIFICATION_LEFT, " ");
            }
        }

     

    One thing you need to be careful is : you should make sure the cobol field name does not begin with a numeric character e.g. 99customer

    This will cause issue for the java field 99customer will have syntax error.

     

  • ivyho
    ivyho
    4 Posts

    Re: what is preserve case of names -generation style ?

    ‏2013-05-10T01:38:23Z  

    Hi

    Preserve case of names' matches VisualAge for Java generation options: direct, no notification, no inner class, no shorten names, and with primitive type arrays.
     

    It will try to preserve the name. e.g. if you copy book has a field -  Customer

    The java method getCustomer and setCustomer.

    also there will be a customer field generated

     

    public String getCustomer() {
            String customer = null;
            customer = MarshallStringUtils.unmarshallFixedLengthStringFromBuffer(
                    buffer_, 0, "IBM-037", 20);
            return (customer);
        }
     

     

     

    public void setCustomer(String customer) {
            if (customer != null) {
                if (customer.length() > 20)
                    throw new IllegalArgumentException(MarshallResource.instance()
                            .getString(MarshallResource.IWAA0124E, customer, "20",
                                    "customer"));
                MarshallStringUtils.marshallFixedLengthStringIntoBuffer(customer,
                        buffer_, 0, "IBM-037", 20,
                        MarshallStringUtils.STRING_JUSTIFICATION_LEFT, " ");
            }
        }

     

    One thing you need to be careful is : you should make sure the cobol field name does not begin with a numeric character e.g. 99customer

    This will cause issue for the java field 99customer will have syntax error.

     

  • cobol2java
    cobol2java
    6 Posts

    Re: what is preserve case of names -generation style ?

    ‏2013-05-10T01:40:13Z  
    • ivyho
    • ‏2013-05-10T01:38:23Z

    Hi

    Preserve case of names' matches VisualAge for Java generation options: direct, no notification, no inner class, no shorten names, and with primitive type arrays.
     

    It will try to preserve the name. e.g. if you copy book has a field -  Customer

    The java method getCustomer and setCustomer.

    also there will be a customer field generated

     

    public String getCustomer() {
            String customer = null;
            customer = MarshallStringUtils.unmarshallFixedLengthStringFromBuffer(
                    buffer_, 0, "IBM-037", 20);
            return (customer);
        }
     

     

     

    public void setCustomer(String customer) {
            if (customer != null) {
                if (customer.length() > 20)
                    throw new IllegalArgumentException(MarshallResource.instance()
                            .getString(MarshallResource.IWAA0124E, customer, "20",
                                    "customer"));
                MarshallStringUtils.marshallFixedLengthStringIntoBuffer(customer,
                        buffer_, 0, "IBM-037", 20,
                        MarshallStringUtils.STRING_JUSTIFICATION_LEFT, " ");
            }
        }

     

    One thing you need to be careful is : you should make sure the cobol field name does not begin with a numeric character e.g. 99customer

    This will cause issue for the java field 99customer will have syntax error.

     

    oh , it is you again ivyho,

    thank you so much.