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
 
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: 6970
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: 6970
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
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 VBS and VB, COBOL syntax is the same ... natt.sut COBOL Programming 3 Sun Nov 12, 2017 6:36 am
No new posts COBOL - EXIT statement weird behavior anthony.pangestu COBOL Programming 0 Fri Oct 27, 2017 9:57 am
No new posts IEW2456E error when link-editing a C ... Senthilraj JCL & VSAM 0 Fri Oct 13, 2017 3:12 pm
No new posts Assembler Macro Copybook converted to... Ziquilix PL/I & Assembler 4 Tue Sep 26, 2017 3:07 am

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