Author: RahulG31
Subject: Reply to: SQL query not working in Cobol program.
Posted: Thu Feb 23, 2017 11:58 am (GMT 5.5)
Okay. 2 things here:
1. Does your COBOL program abends at sqlcode = 100 ?
2. Is your COBOL program doing a delete and then trying to select the record which it has just deleted ?
There could be a case when your COBOL program deletes a record and then tries to read the same record later. Since, the record no longer exists (as the program sees it), it issues sqlcode = 100 and if you have an abend at sqlcode = 100, then ROLLBACK takes place.
So, after the abend or before the program executes, if you try to run the same query through SPUFI, you would see a record but when the program flow was executing the query there was No record and hence sqlcode = 100. You would think that why sqlcode = 100 when there was a record as you verify from SPUFI but keep in mind that the COBOL program may do a lot of other things than just running your query and that may include first deleting the record you are trying to read later.
.
Subject: Reply to: SQL query not working in Cobol program.
Posted: Thu Feb 23, 2017 11:58 am (GMT 5.5)
Okay. 2 things here:
1. Does your COBOL program abends at sqlcode = 100 ?
2. Is your COBOL program doing a delete and then trying to select the record which it has just deleted ?
There could be a case when your COBOL program deletes a record and then tries to read the same record later. Since, the record no longer exists (as the program sees it), it issues sqlcode = 100 and if you have an abend at sqlcode = 100, then ROLLBACK takes place.
So, after the abend or before the program executes, if you try to run the same query through SPUFI, you would see a record but when the program flow was executing the query there was No record and hence sqlcode = 100. You would think that why sqlcode = 100 when there was a record as you verify from SPUFI but keep in mind that the COBOL program may do a lot of other things than just running your query and that may include first deleting the record you are trying to read later.
.