Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
DB2 sequence in COBOL program.

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
Tone

New User


Joined: 01 Oct 2008
Posts: 12
Location: India

PostPosted: Sat May 01, 2010 1:59 am    Post subject: DB2 sequence in COBOL program.
Reply with quote

Hi

I would like to use have a "list of number" included in DB2 query embedded in COBOL program for assigning a unique identifier.

Could anybody help me with how to include & use a DB2 sequence in a COBOL program ?

Thanks
Tone
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: Sat May 01, 2010 2:20 am    Post subject:
Reply with quote

Hello,

Possibly i misunderstand. . .

What does "how to include & use a DB2 sequence" mean?

Many applications have a separate table that supports assigning "the next number".
Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1259
Location: Israel

PostPosted: Sat May 01, 2010 5:09 pm    Post subject:
Reply with quote

1. Can you use more than one sentence to explain your requirement ?
2. Are you sure this is a COBOL question and not a DB2 question ?
Back to top
View user's profile Send private message
Tone

New User


Joined: 01 Oct 2008
Posts: 12
Location: India

PostPosted: Sat May 01, 2010 10:21 pm    Post subject:
Reply with quote

I am using COBOL program to fetch records using a cursor and insert into a new DB2 Table-A. In doing so, I need to assign a unique identifier to each record before inserting into Table-A.

I have a predefined set of unique identifiers with me for this. This list of identifiers are so huge that I cannot insert into a DB2 table and use it. So I will be using a DB2 sequence to generate it.

Because of the nature of the identifier, I can't use an internal table or program level incrementation to generate the number.

But I am not sure How to use a DB2 sequence in cobol program.
How do I use it in a cursor along with other tables ? how to get the next value ?



Please let me know if furthur info is required ?

Thanks
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: Sat May 01, 2010 11:53 pm    Post subject:
Reply with quote

Hello,

See if this info about CREATE SEQUENCE will help:
http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/handheld/Connected/BOOKS/dsnsqj10/5.35

and the "sequence reference" info that is linked near the bottom of CREATE SEQUENCE.
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 -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts KSDS and Index file in cobol deepak14450 COBOL Programming 9 Fri Dec 22, 2017 9:36 am
No new posts The same REXX program doesnt work for... jackzhang75 CLIST & REXX 5 Wed Dec 06, 2017 2:51 am
This topic is locked: you cannot edit posts or make replies. Cobol to fetch the content by using s... arunc55 COBOL Programming 4 Fri Nov 17, 2017 1:25 pm
No new posts Calling IKJEFT01 program from Rexx upendrasri CLIST & REXX 8 Wed Nov 15, 2017 4:27 pm
No new posts VBS and VB, COBOL syntax is the same ... natt.sut COBOL Programming 3 Sun Nov 12, 2017 6:36 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us