Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Regarding commit in cics calling db2 program

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CICS
View previous topic :: :: View next topic  
Author Message
ram_vizag

New User


Joined: 21 Aug 2008
Posts: 92
Location: hyd

PostPosted: Wed Feb 05, 2014 10:56 am    Post subject: Regarding commit in cics calling db2 program
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    Post subject: Re: Regarding commit in cics calling db2 program
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

New User


Joined: 21 Aug 2008
Posts: 92
Location: hyd

PostPosted: Wed Feb 05, 2014 1:11 pm    Post subject: Re: Regarding commit in cics calling db2 program
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    Post subject:
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

Senior Member


Joined: 21 Sep 2010
Posts: 1609
Location: NY,USA

PostPosted: Wed Feb 05, 2014 1:56 pm    Post subject:
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

New User


Joined: 21 Aug 2008
Posts: 92
Location: hyd

PostPosted: Wed Feb 05, 2014 3:58 pm    Post subject: Regarding plan id code logic
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

New User


Joined: 21 Aug 2008
Posts: 92
Location: hyd

PostPosted: Wed Feb 05, 2014 4:01 pm    Post subject: Regarding commit in cics calling db2 program
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

Senior Member


Joined: 21 Sep 2010
Posts: 1609
Location: NY,USA

PostPosted: Thu Feb 06, 2014 1:25 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> CICS All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts How does a called pgm know if its cal... Graeme Westerman COBOL Programming 4 Tue Nov 29, 2016 9:25 pm
No new posts IMS BMP program causes 878 system abend Artemk IMS DB/DC 7 Tue Nov 22, 2016 8:26 pm
No new posts CICS Roll back partially - Need to re... dwijadas CICS 4 Wed Nov 16, 2016 4:30 pm
No new posts CICS NEW SIT PARAMETERS CICS BEHAVIOR... Kyle Carroll CICS 0 Fri Nov 04, 2016 11:55 pm
No new posts Single COPY CICS TS datasets and when... Kyle Carroll CICS 2 Tue Oct 11, 2016 9:47 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us