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

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


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
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
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
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
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

Moderator Emeritus


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

PostPosted: Mon Aug 09, 2010 11:12 am
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
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts Replace each space in cobol string wi... COBOL Programming 3
No new posts COBOL -Linkage Section-Case Sensitive COBOL Programming 1
No new posts COBOL ZOS Web Enablement Toolkit HTTP... COBOL Programming 0
No new posts Compare only first records of the fil... SYNCSORT 7
Search our Forums:

Back to Top