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
 

 

Need COBOL function to generate unique id

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

New User


Joined: 30 Aug 2006
Posts: 30
Location: mumbai

PostPosted: Fri Nov 10, 2006 3:52 pm    Post subject: Need COBOL function to generate unique id
Reply with quote

My requirements are as below,

1. we want to generate one unique no like Trans Id in DB2 table without help of any DB2 table.

Is there any Cobol Function like GENERATE_UNIQUEID in DB2. So that we can able to generate unique id in COBOL variable.
Back to top
View user's profile Send private message

dbzTHEdinosauer

Global Moderator


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

PostPosted: Fri Nov 10, 2006 5:06 pm    Post subject: Re: Need COBOL function to generate unique id
Reply with quote

Unique to what? Have you thought out your question?

If you want a unique value for a column in a DB2 table, you need to know what values are already in the DB2 column.
Back to top
View user's profile Send private message
soumyaranjan007

New User


Joined: 30 Aug 2006
Posts: 30
Location: mumbai

PostPosted: Fri Nov 10, 2006 5:44 pm    Post subject:
Reply with quote

Actually my business requirement is like:-

I am working in credit card domain. Every day we are getting transaction file as pert of our daily process. But i am getting trisection batch file without having unique transection id, so we have to generate a unique transaction id for each of transaction.

i am thinking that if we could generate unique id by help of COBOL function or db2 system table , that will good.

Regards
Somu
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Fri Nov 10, 2006 6:38 pm    Post subject: Re: Need COBOL function to generate unique id
Reply with quote

what is wrong with a timestamp?
transactio-ids are normally generated to encode the source, subject, type, etc... A transid is used for an audit trail. suggest you google for some info on the subject.
Back to top
View user's profile Send private message
cobolunni

Active User


Joined: 07 Aug 2006
Posts: 128
Location: kerala,india

PostPosted: Thu Nov 16, 2006 2:25 pm    Post subject:
Reply with quote

While creating the db2 table you can use one field as unique identifier by declaring the field as GENERATED ALWAYS AS IDENTITY

EG:
Code:
CREATE TABLE EMP(ID INTEGERATED ALWAYS AS IDENTITY PRIMARY KEY,NAME VARCHAR(20),DEP VARCHAR(20));
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 How to generate a new unique Input fi... for1ranjith CLIST & REXX 11 Sat Jul 01, 2017 12:09 pm
No new posts Dynamic output file creation in cobol... smileheal COBOL Programming 7 Thu Jun 15, 2017 10:53 pm
No new posts What is the Extract Function in JCL dharmaraok JCL & VSAM 3 Wed Jun 14, 2017 9:12 am
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