MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Data corruption when entered in DB2 table from CICS screen.

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> CICS and Middleware
View previous topic :: View next topic  
Author Message
yadavjitesh
Beginner


Joined: 15 Apr 2014
Posts: 1
Topics: 1
Location: Gurgaon, India

PostPosted: Wed Aug 20, 2014 5:51 am    Post subject: Data corruption when entered in DB2 table from CICS screen. Reply with quote

Hi,

I am writing a simple program to get input from CICS screen and enter that data to a DB2 table.
My CICS map is as below:
Code:

TESTMAP DFHMSD TYPE=&SYSPARM,                           
               MODE=INOUT,                             
               LANG=COBOL,                             
               TIOAPFX=YES,                             
               DSATTS=(COLOR,HILIGHT),                 
               MAPATTS=(COLOR,HILIGHT),                 
               CTRL=(FRSET,FREEKB)                     
TESTMP  DFHMDI SIZE=(24,80)                             
        DFHMDF POS=(10,05),LENGTH=10,ATTRB=(PROT),     
               INITIAL='ID      :',COLOR=RED           
ID      DFHMDF POS=(10,16),LENGTH=5,ATTRB=(UNPROT,IC), 
               HILIGHT=UNDERLINE,COLOR=PINK,PICIN='9(5)'
        DFHMDF POS=(10,22),LENGTH=01,ATTRB=(PROT,ASKIP)
        DFHMDF POS=(12,05),LENGTH=10,ATTRB=(PROT),     
               INITIAL='NAME    :',COLOR=RED           
NAME    DFHMDF POS=(12,16),LENGTH=50,ATTRB=(UNPROT),   
               HILIGHT=UNDERLINE,COLOR=PINK           
        DFHMDF POS=(12,67),LENGTH=1,ATTRB=(PROT,ASKIP)
        DFHMSD TYPE=FINAL                             
        END                                           


Below is the COBOL code which is moving and inserting the values to DB2 table:
Code:

           PERFORM MOVE-EMPLOYEES-DATA-TO-DCLGEN         
           PERFORM TSQ-OPER                             
           EXEC SQL                                     
               INSERT INTO MEMBER(EID,ENAME)             
                 VALUES(:EID,:ENAME)                     
           END-EXEC                                     
           EXEC CICS SYNCPOINT END-EXEC                 
           EXEC CICS RETURN END-EXEC.                   
           EXIT.                                         
                                                         
       MOVE-EMPLOYEES-DATA-TO-DCLGEN SECTION.           
           INITIALIZE DCLMEMBER                         
           MOVE NAMEI               TO W-NAME-TMP       
           MOVE W-NAME-TMP          TO ENAME             
           MOVE IDI                 TO W-ID-TMP         
           MOVE W-ID-TMP            TO EID               
           EXIT.                                         


A new row is inserted to the database.
EID comes fine which is a numeric data but ENAME has junk values. Please see below data after insertion to the table:
Code:

          EID  ENAME                                             
  -----------  --------------------------------------------------
          100  BIPIN KUMAR                                       
        12345  -|||||2d||@@@@@@@@@@@@@@@@@@@@@@@@@@@@             
        11111  AAAAAAAAAAAAAAAAAAAAAAAAA                         
        55555  ||||e@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@       
                                                                 
                                                                 
*** END ***                                                       


The first row was inserted through QMF so it comes fine however rest of the rows are inserted through COBOL/CICS program and the ENAME field gets corrupted.
Also I have sent the ENAME field before insert query to CICS screen and there value is coming fine but it gets corrupted on insertion.

I have no idea why this is happening. Can anyone help?
Thanks.[/code]
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12357
Topics: 75
Location: San Jose

PostPosted: Wed Aug 20, 2014 1:12 pm    Post subject: Reply with quote

yadavjitesh,

When you compile the MAP, you do realize that SDF generates the fields with I and O suffix. You need to be moving the contents from fields with a suffix of O fields to your DB2 layout fields.

Kolusu
_________________
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort

www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> CICS and Middleware All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group