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

DB2 sequence in COBOL program.


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

Moderator Emeritus


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

PostPosted: Sat May 01, 2010 2:20 am
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: 1353
Location: Israel

PostPosted: Sat May 01, 2010 5:09 pm
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
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

Moderator Emeritus


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

PostPosted: Sat May 01, 2010 11:53 pm
Reply with quote

Hello,

See if this info about CREATE SEQUENCE will help:
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Replace each space in cobol string wi... COBOL Programming 3
No new posts Using API Gateway from CICS program CICS 0
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 Calling DFSORT from Cobol, using OUTF... DFSORT/ICETOOL 5
Search our Forums:

Back to Top