IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Regarding commit in cics calling db2 program


IBM Mainframe Forums -> CICS
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
ram_vizag

Active User


Joined: 21 Aug 2008
Posts: 112
Location: hyd

PostPosted: Wed Feb 05, 2014 10:56 am
Reply with quote

Hi,

My cics program is calling a batch program which inserts records in a table primary key being a plan id.

When i insert for the first time, th ereocrds getting inserted succesfully in tha table and a message is bening promted onto the screen saying record inserted successfully.

when i refresh the screen and enter the key details and try to insert the reocrds in th etabke i'm getting -803 but no record with the respective primary exist in the table.

Then i issued commit statement in batch program but getting -925(which is commit not valid in cics or ims region). I have issues syncpoint in cics progarm aslo but not useful

Can you please suggest how to proceed further.
Back to top
View user's profile Send private message
sureshpathi10

Active User


Joined: 03 May 2010
Posts: 154
Location: Kuala Lumpur

PostPosted: Wed Feb 05, 2014 11:45 am
Reply with quote

ram_vizag wrote:

When i insert for the first time, th ereocrds getting inserted succesfully in tha table and a message is bening promted onto the screen saying record inserted successfully.

Have you checked the table after you got success? is there a record?

ram_vizag wrote:
when i refresh the screen and enter the key details and try to insert the reocrds in th etabke i'm getting -803 but no record with the respective primary exist in the table.

I'm quite not sure what are you doing in your refresh screen. If you provide your code, then we can able to help you.
Back to top
View user's profile Send private message
ram_vizag

Active User


Joined: 21 Aug 2008
Posts: 112
Location: hyd

PostPosted: Wed Feb 05, 2014 1:11 pm
Reply with quote

sureshpathi10 wrote:
ram_vizag wrote:

When i insert for the first time, th ereocrds getting inserted succesfully in tha table and a message is bening promted onto the screen saying record inserted successfully.

Have you checked the table after you got success? is there a record?

ram_vizag wrote:
when i refresh the screen and enter the key details and try to insert the reocrds in th etabke i'm getting -803 but no record with the respective primary exist in the table.

I'm quite not sure what are you doing in your refresh screen. If you provide your code, then we can able to help you.


Hi,
yes the first record is there in the table. I have cross verifed. But second time when i try with the next plan id, though the plan id is not there in the table(which is supposed to be inserted) i got -803.

actually , the plan id taken as max(plan id) +1 before calling batch program to insert.

But after 2-3 times trying with the sam erec, i'm able to insert record.

But the same should happen every time, i believe there is a logic which i have to hadle about commit.

Please suggest on the same.
Back to top
View user's profile Send private message
sureshpathi10

Active User


Joined: 03 May 2010
Posts: 154
Location: Kuala Lumpur

PostPosted: Wed Feb 05, 2014 1:24 pm
Reply with quote

Quote:
actually , the plan id taken as max(plan id) +1 before calling batch program to insert.

But after 2-3 times trying with the sam erec, i'm able to insert record.


I don't think, there is a problem with COMMIT. There is LOGIC that generate Plan-id in your program that causing this issue. And again, if you provide your code, it will be more easy to find out.
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3051
Location: NYC,USA

PostPosted: Wed Feb 05, 2014 1:56 pm
Reply with quote

Please use a display statements in that batch program and see what is the value of plan id before a insert, in that way you will come to know why are you getting -803. I suspect it has something to with your logic in a batch program. In short try to debug you batch program.
Back to top
View user's profile Send private message
ram_vizag

Active User


Joined: 21 Aug 2008
Posts: 112
Location: hyd

PostPosted: Wed Feb 05, 2014 3:58 pm
Reply with quote

sureshpathi10 wrote:
Quote:
actually , the plan id taken as max(plan id) +1 before calling batch program to insert.

But after 2-3 times trying with the sam erec, i'm able to insert record.


I don't think, there is a problem with COMMIT. There is LOGIC that generate Plan-id in your program that causing this issue. And again, if you provide your code, it will be more easy to find out.


hi suresh,

Code:

EXEC SQL                     
                             
   SELECT MAX(PLAN_ID) 
     INTO :planid
   FROM table
                             
END-EXEC.   

EVALUATE SQLCODE                                 
                                                 
   WHEN  0                                       
                                                 
           
         MOVE ZEROES       TO WS-PLAN-ID         
         COMPUTE WS-PLAN-ID = PLANID + 1; 
         MOVE WS-PLAN-ID   TO OUT-PLAN-ID (BOTH FIELDS ARE IN COMP)
         MOVE SQLCODE      TO OUT-SQLCODE

                 


THE VALUE in the ws-planid is moved to out copy book field and used in cics pgm to populate into screen using following code:

01 out-planid PIC S9(09) USAGE COMP.

01 WS-PLANIDO PIC S9(9) USAGE COMP.
01 WS-PLANID-9-DISPLAY PIC 9(10) USAGE DISPLAY.
01 WS-PLANID-ALPHA PIC X(10).
01 WS-PLANIDO-MAP PIC X(03).

move out-planid to ws-planido
MOVE WS-PLANIDO TO WS-PLANID-9-DISPLAY
MOVE WS-PLANID-9-DISPLAY TO WS-PLANID-ALPHA
MOVE WS-PLANID-ALPHA(8:3) TO WS-PLANIDO-MAP
MOVE WS-PLANIDO-MAP TO PLANIDO

the value with incremented to planid id in table is incremented in db2 pgm and the respective planid value is being converted into alphanumeric in cic sprogram and pouplate screen.

once the value is populated( its working fine, means th eupdated value plus one value is populating onto cics screen), user will enter remaining values and press enter then the records should be inserted planid being primary key
Back to top
View user's profile Send private message
ram_vizag

Active User


Joined: 21 Aug 2008
Posts: 112
Location: hyd

PostPosted: Wed Feb 05, 2014 4:01 pm
Reply with quote

once the user enter values and press enter key all the fields will be populate dinti input copy fields of db2 program and with insert sql the reocrd has to be inserted.

but there i'm getting -803 and i have done debug and th eplani id is latest on eand not in table.

i wonder how come its possible???
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3051
Location: NYC,USA

PostPosted: Thu Feb 06, 2014 1:25 pm
Reply with quote

Can you please check what happens after receive map? May be show us the code or add a display statements and check them.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CICS

 


Similar Topics
Topic Forum Replies
No new posts Using API Gateway from CICS program CICS 0
No new posts Calling DFSORT from Cobol, using OUTF... DFSORT/ICETOOL 5
No new posts Calling Java method from batch COBOL ... COBOL Programming 5
No new posts Calling an Open C library function in... CICS 1
No new posts How to 'Ping' a CICS region in JCL CICS 2
Search our Forums:

Back to Top