Skip to main content

I've got this error when I was trying to build the library, it's at the goback keyword -verb-

       program-id. ExecuteTransaction as "CoreBanking.Transactions.ExecuteTransaction".

       data division.
       working-storage section.
       copy 'Records\\TransactionRecord'.
      
       77  operation-code              pic X(10).
       77  result-code                 pic X(50).
       77  debit-account-balance       pic S9(10)V9(03) comp-3.
       88  internal-accounti-id        values 1 thru 7.

       procedure division using by value operation-code, by reference tansaction-record returning result-code.
           copy 'DatabaseConnection'.
          
           if internal-accounti-id then
               perform debit-internal-account
           else
               perform debit-customer-account
           end-if.
          
           evaluate debit-account
               when 1 thru 7
                   perform debit-internal-account
               when other
                   perform debit-customer-account
           end-evaluate.
           goback.
      
       debit-internal-account.
           exec sql
               insert into bank_transaction(DEBIT_ACCOUNT, CREDIT_ACCOUNT, AMOUNT)
                   values(:debit-account, :credit-account, :transaction-amount)
           end-exec.
          
           exec sql
               commit
           end-exec.
          
           move 'Transaction completed' to result-code.
      
       debit-customer-account.
           exec sql
               select balance
               into :debit-account-balance
               from
               (
                  select sum(credit), sum(debit), sum(credit) - sum(debit) as balance from
                  (
                     select transaction_id as voucher,transaction_date, amount as credit, 0 as debit
                     from bank_transaction
                     where credit_account = :credit-account
                     union
                     select transaction_id,transaction_date, 0 as credit, amount as debit
                     from bank_transaction
                     where debit_account = :credit-account
                  )
               )
           end-exec.
          
           if debit-account-balance <= transaction-amount then
               exec sql
                   insert into bank_transaction(DEBIT_ACCOUNT, CREDIT_ACCOUNT, AMOUNT)
                       values(:debit-account, :credit-account, :transaction-amount)
               end-exec
              
               exec sql
                   commit
               end-exec
              
               move 'Transaction Was Successfuly Completed' to result-code
           else
               move 'Insufficient Funds!' to result-code
           end-if.
          
           exec sql
               disconnect current
           end-exec.
      
       sql-error-routine.
           move 'internal error' to result-code.
          
       end program ExecuteTransaction.

I've got this error when I was trying to build the library, it's at the goback keyword -verb-

       program-id. ExecuteTransaction as "CoreBanking.Transactions.ExecuteTransaction".

       data division.
       working-storage section.
       copy 'Records\\TransactionRecord'.
      
       77  operation-code              pic X(10).
       77  result-code                 pic X(50).
       77  debit-account-balance       pic S9(10)V9(03) comp-3.
       88  internal-accounti-id        values 1 thru 7.

       procedure division using by value operation-code, by reference tansaction-record returning result-code.
           copy 'DatabaseConnection'.
          
           if internal-accounti-id then
               perform debit-internal-account
           else
               perform debit-customer-account
           end-if.
          
           evaluate debit-account
               when 1 thru 7
                   perform debit-internal-account
               when other
                   perform debit-customer-account
           end-evaluate.
           goback.
      
       debit-internal-account.
           exec sql
               insert into bank_transaction(DEBIT_ACCOUNT, CREDIT_ACCOUNT, AMOUNT)
                   values(:debit-account, :credit-account, :transaction-amount)
           end-exec.
          
           exec sql
               commit
           end-exec.
          
           move 'Transaction completed' to result-code.
      
       debit-customer-account.
           exec sql
               select balance
               into :debit-account-balance
               from
               (
                  select sum(credit), sum(debit), sum(credit) - sum(debit) as balance from
                  (
                     select transaction_id as voucher,transaction_date, amount as credit, 0 as debit
                     from bank_transaction
                     where credit_account = :credit-account
                     union
                     select transaction_id,transaction_date, 0 as credit, amount as debit
                     from bank_transaction
                     where debit_account = :credit-account
                  )
               )
           end-exec.
          
           if debit-account-balance <= transaction-amount then
               exec sql
                   insert into bank_transaction(DEBIT_ACCOUNT, CREDIT_ACCOUNT, AMOUNT)
                       values(:debit-account, :credit-account, :transaction-amount)
               end-exec
              
               exec sql
                   commit
               end-exec
              
               move 'Transaction Was Successfuly Completed' to result-code
           else
               move 'Insufficient Funds!' to result-code
           end-if.
          
           exec sql
               disconnect current
           end-exec.
      
       sql-error-routine.
           move 'internal error' to result-code.
          
       end program ExecuteTransaction.

Hi Ahmet,

Is this error related to the other posting that you have made about the duplicate names being caused by using the same linkage section parameters on multiple programs when using ilsmartlinkage?

If this is a different problem, then please show me what the content of the two copybooks should look like so I can try to reproduce this here?

Thanks.


I've got this error when I was trying to build the library, it's at the goback keyword -verb-

       program-id. ExecuteTransaction as "CoreBanking.Transactions.ExecuteTransaction".

       data division.
       working-storage section.
       copy 'Records\\TransactionRecord'.
      
       77  operation-code              pic X(10).
       77  result-code                 pic X(50).
       77  debit-account-balance       pic S9(10)V9(03) comp-3.
       88  internal-accounti-id        values 1 thru 7.

       procedure division using by value operation-code, by reference tansaction-record returning result-code.
           copy 'DatabaseConnection'.
          
           if internal-accounti-id then
               perform debit-internal-account
           else
               perform debit-customer-account
           end-if.
          
           evaluate debit-account
               when 1 thru 7
                   perform debit-internal-account
               when other
                   perform debit-customer-account
           end-evaluate.
           goback.
      
       debit-internal-account.
           exec sql
               insert into bank_transaction(DEBIT_ACCOUNT, CREDIT_ACCOUNT, AMOUNT)
                   values(:debit-account, :credit-account, :transaction-amount)
           end-exec.
          
           exec sql
               commit
           end-exec.
          
           move 'Transaction completed' to result-code.
      
       debit-customer-account.
           exec sql
               select balance
               into :debit-account-balance
               from
               (
                  select sum(credit), sum(debit), sum(credit) - sum(debit) as balance from
                  (
                     select transaction_id as voucher,transaction_date, amount as credit, 0 as debit
                     from bank_transaction
                     where credit_account = :credit-account
                     union
                     select transaction_id,transaction_date, 0 as credit, amount as debit
                     from bank_transaction
                     where debit_account = :credit-account
                  )
               )
           end-exec.
          
           if debit-account-balance <= transaction-amount then
               exec sql
                   insert into bank_transaction(DEBIT_ACCOUNT, CREDIT_ACCOUNT, AMOUNT)
                       values(:debit-account, :credit-account, :transaction-amount)
               end-exec
              
               exec sql
                   commit
               end-exec
              
               move 'Transaction Was Successfuly Completed' to result-code
           else
               move 'Insufficient Funds!' to result-code
           end-if.
          
           exec sql
               disconnect current
           end-exec.
      
       sql-error-routine.
           move 'internal error' to result-code.
          
       end program ExecuteTransaction.

It's related Chris, I am sorry for the conceptually duplicate posts.