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 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: 1232
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 XML Parse for COBOL 5.2 Bhanu Praveen COBOL Programming 1 Sat Jul 08, 2017 8:58 pm
No new posts Writing a file using online program grvtomar PL/I & Assembler 3 Fri Jun 30, 2017 1:06 pm
No new posts pre-compiler for program in an HFS Pedro DB2 0 Fri Jun 23, 2017 11:13 pm
No new posts Dynamic output file creation in cobol... smileheal COBOL Programming 7 Thu Jun 15, 2017 10:53 pm
No new posts Search utility(3.14) using JCl and Cobol RKS3 COBOL Programming 12 Sat Jun 10, 2017 10:24 pm


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