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
 

 

DB2-cobol module not fetching records whose primary key is 0

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
rickyc.mathew

New User


Joined: 06 Mar 2008
Posts: 30
Location: kottayam

PostPosted: Fri Aug 06, 2010 5:21 pm    Post subject: DB2-cobol module not fetching records whose primary key is 0
Reply with quote

Hi All,

I wrote a new cobol DB@ program which fetches values from database.My program is working fine for all values except for values '0000' as the primary key.I dont know how to proceed.Could any one please help to resolve this.

Thanks,
Ricky
Back to top
View user's profile Send private message

dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Fri Aug 06, 2010 6:05 pm    Post subject:
Reply with quote

are you successful in spufi when you attempt to Select rows where col = '0000'?
Back to top
View user's profile Send private message
rickyc.mathew

New User


Joined: 06 Mar 2008
Posts: 30
Location: kottayam

PostPosted: Mon Aug 09, 2010 11:04 am    Post subject: Reply to: DB2-cobol module not fetching records whose primar
Reply with quote

Yes I am able to select it through Spufi...

But my program reads the next value when it encounters '0000' and fetches the value corresponding to that from the Db2 table.

Thanks,
Ricky
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Mon Aug 09, 2010 11:12 am    Post subject:
Reply with quote

Hello,

Suggest you show the code that does not work as desired.
Back to top
View user's profile Send private message
rickyc.mathew

New User


Joined: 06 Mar 2008
Posts: 30
Location: kottayam

PostPosted: Mon Aug 09, 2010 12:18 pm    Post subject:
Reply with quote

Code:
     MOVE  WL-SE-NUMBER  TO  WS-SE-NO                             
     MOVE  WS-SE-NO      TO  SE-NO                               
                                                                 
     EXEC SQL                                                     
         SELECT SE_ACCT_TYPE_CD,                                 
                SE_INDUS_MJR_DS_CD,                               
                SE_SUBOR_DS_CD,                                   
                SE_INDUS_DTL_DS_CD,                               
                SE_INDUS_DS_CD,                                   
                CTRY_ID                                           
         INTO   :SE-ACCT-TYPE-CD,                                 
                :SE-INDUS-MJR-DS-CD,                             
                :SE-SUBOR-DS-CD,                                 
                :SE-INDUS-DTL-DS-CD,                             
                :SE-INDUS-DS-CD,                                 
                :CTRY-ID                                         
         FROM   V01_GMAPS_MER_GENESIS_INDUS                       
         WHERE  SE_NO = :SE-NO       


please find the definiton

Code:
 01  WL-GR35100-PARAMETERS.                         
     03  WL-SE-HQ-NO             PIC S9(10) COMP-3.

01  WS-SE-NO                    PIC  X(09).
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Mon Aug 09, 2010 3:57 pm    Post subject:
Reply with quote

you have a cobol problem.

you should display the values after you move

besides,
you provided code:
Code:

MOVE WL-SE-NUMBER TO WS-SE-NO
MOVE WS-SE-NO TO SE-NO

and a definition of working-storage:
Code:

01 WL-GR35100-PARAMETERS.
03 WL-SE-HQ-NO PIC S9(10) COMP-3.

01 WS-SE-NO PIC X(09).


but do not show us the definitions of WS-SE-NUMBER or SE-NO.
if your code is like your explanations,
your problem is accuracy.
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 -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Executing OO COBOL program invoking J... Virendra Shambharkar COBOL Programming 2 Tue Jan 10, 2017 6:37 pm
No new posts OO COBOL compile error Virendra Shambharkar COBOL Programming 3 Tue Jan 10, 2017 6:05 pm
No new posts Need Suggestion on COBOL program vickey_dw COBOL Programming 5 Thu Jan 05, 2017 10:55 pm
No new posts Removing Duplicates based on certain ... chandracdac DFSORT/ICETOOL 8 Fri Dec 09, 2016 4:40 am
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm


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