Following up... this may be an erroneous error message.
I am now finding that my updates are occurring.
It is just annoying to see these errors in the job log.
-----Original Message-----
From: MIDRANGE-L <midrange-l-bounces@xxxxxxxxxxxxxxxxxx> On Behalf Of Therrien, Paul via MIDRANGE-L
Sent: Tuesday, November 16, 2021 10:57 AM
To: Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxxxxxxxx>
Cc: Therrien, Paul <ptherrien@xxxxxxxxxxx>
Subject: SQL Stored proc and Pending changes roll back
IBM V7R3. 
Running an SQL stored proc on Machine A (MA) that executes a stored proc on Machine B (MB). Both machines are on V7R3.
When I submit the CL program to batch on MA it runs perfectly, and MB data is updated.
When I run a batch CL program that calls the above CL program, I get a rollback message and updates are lost on MB.
On MA, submit CL program to batch.
   CL Program logic:
  1. Swap User profile to super user on MB
  2. RUNSQL to call Stored Proc on MA
  3. MA Stored proc 
	1. Call QCMDEXC on MB to call a CL to change libl
	2. Call Stored Proc on MB to update data on MB
   4. restore user profile
Again, If I submit the MA CL directly to batch the job runs and updates data on MB with no issue.
When I call the CL from another batch CL I get this message in the joblog:
Message . . . . :   Pending changes rolled back for remote resources; reason                  
                                        01.                                                                                         
                                      Cause . . . . . :   Pending changes are being rolled back while ending                        
                                        commitment definition QILE with logical unit of work identifier                             
                                        APPN.MBIBOOKS.X'3E398C6C5A39'.00001. There were pending changes for 0                       
                                        protected remote resources and 0 unprotected remote resources. The reason                   
                                        codes and their meanings follow: 01 -- The commitment definition is in a                    
                                        state of Reset. 02 -- The commitment definition is in a state of Prepare In                 
                                        Progress. 03 -- The commitment definition is in a state of Prepared and the                 
                                        Action If Endjob commitment option is W. 04 -- The commitment definition is                 
                                        in a state of Prepared and the Action If Endjob commitment option is W. The                 
                                        rollback decision was received from the initiator of this logical unit of                   
                                        work. 05 -- The commitment definition is in a state of Last Agent Pending                   
                                        and the Action If Endjob commitment option is W. 06 -- The commitment                       
                                        definition is in a state of Last Agent Pending and the Action If Endjob                     
                                        commitment option is WAIT. The rollback decision was received from the last                 
                                        agent. 07 -- The commitment definition is in a state of Rollback Required.
And the data on MB is not updated.
The CL that is running that calls the CL in question is doing this call as the last step in the job.  The next statement is ENDPGM.
In both cases the user profile that runs the jobs is the same user.
Paul 
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list To post a message email: MIDRANGE-L@xxxxxxxxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit: 
https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives at 
https://archive.midrange.com/midrange-l.
Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related questions.
Help support midrange.com by shopping at amazon.com with our affiliate link: 
https://amazon.midrange.com
As an Amazon Associate we earn from qualifying purchases.