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

DB2 with CICS transactions


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Ganesh Kumar.J

New User


Joined: 06 Feb 2006
Posts: 4

PostPosted: Wed Mar 29, 2006 10:34 am
Reply with quote

Hi,
Anyone can help me how to insert records in the DB2 table using CICS transactions. I have tried the following code. The cntrl is not going into the insert statement it is directly go to the refresh para. Please give me your valuable suggestions.

2300-ADDUSER-PARA.
MOVE LOW-VALUES TO AMAPI.
EXEC CICS SEND
MAP('AMAP')
MAPSET('KGCM021')
ERASE
ALARM
END-EXEC.
MOVE 'SUCCESSFULLY ADDED ' TO MGS1O.
EXEC CICS RECEIVE
MAP('AMAP')
MAPSET('KGCM021')
INTO(AMAPI)
END-EXEC.
MOVE AOPTI TO WS-AOPT.
IF WS-AOPT = 'Y' AND EIBAID = DFHPF5
MOVE AUNAMEI TO WS-AUSERNAME
MOVE AUIDI TO WS-AUSERID
MOVE ADOBI TO WS-ADOB
MOVE AADDRI TO WS-AADDR
MOVE ACNTI TO WS-ACONTACT
PERFORM 2310-AMOVE-PARA

EXEC SQL INSERT INTO URTAB VALUES(:URNAME,
:URID,
:URDOB,
:URADDR,
:URCONT)
END-EXEC
MOVE 'SUCCESSFULLY INSERTED' TO MGS1O
EXEC CICS SEND
MAP('AMAP')
MAPSET('KGCM021')
ERASEAUP
END-EXEC
EXEC CICS RETURN
END-EXEC
PERFORM 2320-REFRESH-PARA
MOVE 'SUCCESSFULLY ADDED ' TO MGS1O
ELSE
IF WS-AOPT = 'N' AND EIBAID = DFHPF5
PERFORM 2320-REFRESH-PARA
ELSE
IF EIBAID = DFHPF3
PERFORM 2100-MAIN-PARA
END-IF
END-IF
END-IF.
2310-AMOVE-PARA.
MOVE WS-AUSERNAME TO AUNAMEO.
MOVE WS-AUSERID TO AUIDO.
MOVE WS-ADOB TO ADOBO.
MOVE WS-AADDR TO AADDRO.
MOVE WS-ACONTACT TO ACNTO.

2320-REFRESH-PARA.
MOVE LOW-VALUES TO AMAPI.
EXEC CICS
SEND MAP('AMAP')
MAPSET('KGCM021')
ERASE
ALARM
END-EXEC.
EXEC CICS RECEIVE
MAP('AMAP')
MAPSET('KGCM021')
END-EXEC.


Thanks,
Ganesh Kumar.J
Back to top
View user's profile Send private message
Manojudha

New User


Joined: 13 Jul 2005
Posts: 13

PostPosted: Wed Mar 29, 2006 11:29 am
Reply with quote

Hi

Try giving an exit para after the refresh para

Change your perform statement to

Perform ....refreshpara thru exit-para.

It should work

Thanks
Mano
Back to top
View user's profile Send private message
Manojudha

New User


Joined: 13 Jul 2005
Posts: 13

PostPosted: Wed Mar 29, 2006 11:32 am
Reply with quote

I doubt with your program..

You insert values with variables urname, urid.,,etc.. But you have not moved the values to these variables. Please check or send me your full code.
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 -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Using API Gateway from CICS program CICS 0
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
No new posts Parallelization in CICS to reduce res... CICS 4
No new posts How to avoid duplicating a CICS Web S... CICS 0
Search our Forums:

Back to Top