Highlighted
Absent Member.
Absent Member.
2699 views

Duplicate Field Delcaration

Hi,

First of all, I am running out of time due to the continuous failures for no reason!!!

This time I have this:

------ Build started: Project: BusinessLogic, Configuration: Debug Any CPU ------

* Compiling "C:\Users\Jack\documents\visual studio 2012\Projects\AdvancedDatabases\BusinessLogic\Accounts\AccountServiceMaintenance.cbl"

* Compiling "C:\Users\Jack\documents\visual studio 2012\Projects\AdvancedDatabases\BusinessLogic\Accounts\AccountsReports.cbl"

* Compiling "C:\Users\Jack\documents\visual studio 2012\Projects\AdvancedDatabases\BusinessLogic\Accounts\AccountTypeMaintenenace.cbl"

* Compiling "C:\Users\Jack\documents\visual studio 2012\Projects\AdvancedDatabases\BusinessLogic\Customers\CustomersReports.cbl"

* Compiling "C:\Users\Jack\documents\visual studio 2012\Projects\AdvancedDatabases\BusinessLogic\Customers\LoginService.cbl"

* Compiling "C:\Users\Jack\documents\visual studio 2012\Projects\AdvancedDatabases\BusinessLogic\Customers\RertieveCustomer.cbl"

* Compiling "C:\Users\Jack\documents\visual studio 2012\Projects\AdvancedDatabases\BusinessLogic\Transactions\BalancesReports.cbl"

* Compiling "C:\Users\Jack\documents\visual studio 2012\Projects\AdvancedDatabases\BusinessLogic\Transactions\ExecuteTransaction.cbl"

* Generating CoreBanking.Accounts.AccountServiceMaintenance

* Generating CoreBanking.Accounts.AccountsReports

* Generating CoreBanking.Accounts.AccountTypeMaintenenace

* Generating CoreBanking.Customers.CustomersReports

* Generating BusinessLogic.Customers.LoginService

* Generating CoreBanking.Customers.RertieveCustomer

* Generating CoreBanking.Transactions.BalancesReports

* Generating CoreBanking.Transactions.ExecuteTransaction

C:\Users\Jack\AppData\Local\Temp\_cd13324_2\AccountServiceMaintenance.il (9695) : error : Duplicate field declaration: '_MF_control'

C:\Users\Jack\AppData\Local\Temp\_cd13324_2\AccountServiceMaintenance.il (9707) : error : Duplicate method declaration

C:\Users\Jack\AppData\Local\Temp\_cd13324_2\AccountServiceMaintenance.il (9716) : error : Duplicate method declaration

C:\Users\Jack\AppData\Local\Temp\_cd13324_2\AccountServiceMaintenance.il (9724) : error : Duplicate field declaration: '_MF_WSBLOCK'

C:\Users\Jack\AppData\Local\Temp\_cd13324_2\AccountServiceMaintenance.il (9727) : error : Duplicate method declaration

C:\Users\Jack\AppData\Local\Temp\_cd13324_2\AccountServiceMaintenance.il (9746) : error : Duplicate method declaration

C:\Users\Jack\AppData\Local\Temp\_cd13324_2\AccountServiceMaintenance.il (9762) : error : Duplicate method declaration

C:\Users\Jack\AppData\Local\Temp\_cd13324_2\AccountServiceMaintenance.il (9779) : error : Duplicate method declaration

C:\Users\Jack\AppData\Local\Temp\_cd13324_2\AccountServiceMaintenance.il (9791) : error : Duplicate method declaration

C:\Users\Jack\AppData\Local\Temp\_cd13324_2\AccountServiceMaintenance.il (9807) : error : Duplicate method declaration

C:\Users\Jack\AppData\Local\Temp\_cd13324_2\AccountServiceMaintenance.il (9823) : error : Duplicate method declaration

C:\Users\Jack\AppData\Local\Temp\_cd13324_2\AccountServiceMaintenance.il (9840) : error : Duplicate method declaration

C:\Users\Jack\AppData\Local\Temp\_cd13324_2\AccountServiceMaintenance.il (9856) : error : Duplicate method declaration

C:\Users\Jack\AppData\Local\Temp\_cd13324_2\AccountServiceMaintenance.il (9873) : error : Duplicate method declaration

C:\Users\Jack\AppData\Local\Temp\_cd13324_2\AccountServiceMaintenance.il (9885) : error : Duplicate method declaration

C:\Users\Jack\AppData\Local\Temp\_cd13324_2\AccountServiceMaintenance.il (9901) : error : Duplicate method declaration

C:\Users\Jack\AppData\Local\Temp\_cd13324_2\AccountServiceMaintenance.il (9917) : error : Duplicate method declaration

C:\Users\Jack\AppData\Local\Temp\_cd13324_2\AccountServiceMaintenance.il (9934) : error : Duplicate method declaration

C:\Users\Jack\AppData\Local\Temp\_cd13324_2\AccountServiceMaintenance.il (9950) : error : Duplicate method declaration

C:\Users\Jack\AppData\Local\Temp\_cd13324_2\AccountServiceMaintenance.il (9967) : error : Duplicate method declaration

C:\Users\Jack\AppData\Local\Temp\_cd13324_2\AccountServiceMaintenance.il (9983) : error : Duplicate method declaration

C:\Users\Jack\AppData\Local\Temp\_cd13324_2\AccountServiceMaintenance.il (10000) : error : Duplicate method declaration

C:\Users\Jack\AppData\Local\Temp\_cd13324_2\AccountServiceMaintenance.il (10016) : error : Duplicate method declaration

C:\Users\Jack\AppData\Local\Temp\_cd13324_2\AccountServiceMaintenance.il (10033) : error : Duplicate method declaration

C:\Users\Jack\AppData\Local\Temp\_cd13324_2\AccountServiceMaintenance.il (10049) : error : Duplicate method declaration

C:\Users\Jack\AppData\Local\Temp\_cd13324_2\AccountServiceMaintenance.il (10066) : error : Duplicate method declaration

C:\Users\Jack\AppData\Local\Temp\_cd13324_2\AccountServiceMaintenance.il (10082) : error : Duplicate method declaration

C:\Users\Jack\AppData\Local\Temp\_cd13324_2\AccountServiceMaintenance.il (10098) : error : Duplicate method declaration

C:\Users\Jack\AppData\Local\Temp\_cd13324_2\AccountServiceMaintenance.il (10109) : error : Duplicate field declaration: '_MF_LITBLOCK'

C:\Users\Jack\AppData\Local\Temp\_cd13324_2\AccountServiceMaintenance.il (10110) : error : Duplicate method declaration

C:\Users\Jack\documents\visual studio 2012\Projects\AdvancedDatabases\BusinessLogic\Transactions\ExecuteTransaction.cbl (30,1-2) : error COBCH0857 : System error - failure during ILASM phase

Done building project "BusinessLogic.cblproj" -- FAILED.

Build FAILED.

========== Build: 0 succeeded or up-to-date, 1 failed, 0 skipped ==========

I can't figure out a way to solve it!! I tried to remove the ILSMARTLINKAGE directive and it builds and succeeds but whenever I add ILSMARTLINKAGE it just fails! I did clean and build and nothing changed!

Here is AccountServiceMaintenance which is the firs program to be compiled if I remove it the infection goes to the next one like a cancer!

      

program-id. AccountServiceMaintenance as "CoreBanking.Accounts.AccountServiceMaintenance".


      

data division.

      

working-storage section.

      

      

linkage section.

      

copy 'Records\AccountServiceRecord'.

     

* Account Service Record

      

      

01  account-service-record.

      

    03  service-id      pic 9(10).

      

    03  service-name     pic X(35).

      

    03  description     pic X(150).

      

   

      

      

77  operation-code  pic X(10).

      

77  result-code     pic X(50).


      

procedure division using by value operation-code, by reference account-service-record returning result-code.

      

    copy 'DatabaseConnection'.

      

    evaluate operation-code

      

        when 'create'

      

            perform create-account-service

      

        when 'update'

      

            perform update-account-service

      

    end-evaluate.

      

    goback.

      

      

create-account-service.

      

    exec sql

      

        inesert into account_service(service_name, description) values(:service-name, :description)

      

    end-exec.

      

    exec sql

      

        commit

      

    end-exec.

      

    exec sql

      

        disconnect current

      

    end-exec.


      

update-account-service.

      

    exec sql

      

        update account_service set service_name = :service-name and description = :description

      

        where service_id = :service-id

      

    end-exec.

      

    exec sql

      

        commit

      

    end-exec.

      

    exec sql

      

        disconnect current

      

    end-exec.


      

sql-error-routine.

      

    move 'Unsuccessful Operation' to result-code.

      

   

      

end program AccountServiceMaintenance.

Please Help me out in this, I think the programs seems to be good form syntax perspective but, I don't know what's going on now!

 

Best Regrads

0 Likes
5 Replies
Highlighted
Micro Focus Expert
Micro Focus Expert

RE: Duplicate Field Delcaration

Hi Ahmet, could you possibly attach the contents of the copy files as well as the main source file, so that I can try to reproduce this issue?  It looks as though it may be a problem due to the combination of the ILSMARTLINKAGE directive and SQL syntax, but I will need to try this out.

Robert.

0 Likes
Highlighted
Absent Member.
Absent Member.

RE: Duplicate Field Delcaration

account-service-record is the file content, it was visible when I copied it -I'm using Visual COBOL 2.2

Regards

0 Likes
Highlighted
Micro Focus Expert
Micro Focus Expert

RE: Duplicate Field Delcaration

Ok, by deleting the two COPY statements, I was able to compile this (single) program with ILSMARTLINKAGE.  However, I am not seeing any error.  It occurs to me that the error is not necessarily associated with this first program, and it might be worth systematically removing one program at a time from the project until the problem goes away.  This should be a good indication that the last one removed is the one causing the problem.

Alternatively, if this doesn't lead anywhere, could you raise a support incident and attach the whole project?

0 Likes
Highlighted
Micro Focus Expert
Micro Focus Expert

RE: Duplicate Field Delcaration

Ahmet,

Please zip up your project and e-mail it to me at chris.glazier@microfocus.com so that I can take a look.

Thanks.

0 Likes
Highlighted
Micro Focus Expert
Micro Focus Expert

RE: Duplicate Field Delcaration

Sorry, I had forgotten that things have changed somewhat in the 2.2 Update 1 version of the product.  With the Update 1 version you should find that, instead of all the cryptic messages that you report, you will get a simple message: ILSMARTLINKAGE class 'xxx' has multiple definitions.

Obviously this is better, but doesn't help you a great deal.

So, when the project contains multiple programs referring to the same named linkage record (and ILSMARTLINKAGE is on), currently the compiler will give 'duplicate class' type errors, because it is attempting to generate multiple versions of the same ILSMARTLINKAGE class.

One way of avoiding this is to use the additional ILSMARTNEST directive.  This causes these ILSMARTLINKAGE classes to be generated as nested classes within the class generated for the individual procedural COBOL program, and therefore disambiguates them.

The only downside to this is that, for instance, a C# program that wants to call different COBOL programs using the same linkage records will have to construct instances of different classes for each program.

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.