View previous topic :: View next topic
|
Author |
Message |
Peter Larsen
New User
Joined: 03 Aug 2012 Posts: 6 Location: Denmark
|
|
|
|
Anyone know how to generate a GUID - known from windows-platforms?
It would be nice if there is a way to do this in batch and cics.
Regards Peter |
|
Back to top |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2455 Location: Hampshire, UK
|
|
|
|
What, exactly, is a "GUID"? And which language are you referring to - PL/1 or Assembler? |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
take a look at RDz. |
|
Back to top |
|
|
Peter Larsen
New User
Joined: 03 Aug 2012 Posts: 6 Location: Denmark
|
|
|
|
A GUID or UUID is a number like this:
e15717a3-75e6-19fa-b6e1-4028170caf96
It is possible to get one number: TSO UUIDGEN
But I need to do a routine that can be called from PL/I.
If the actually code is C++ or ASM I can call from PL/I on the zOS mainframe.
Regards Peter |
|
Back to top |
|
|
Peter Larsen
New User
Joined: 03 Aug 2012 Posts: 6 Location: Denmark
|
|
|
|
dbzTHEdinosauer wrote: |
take a look at RDz. |
I don't see the connection with RDz. For me RDz is just a fine graphically mainframe with a lot of features.... |
|
Back to top |
|
|
Peter Larsen
New User
Joined: 03 Aug 2012 Posts: 6 Location: Denmark
|
|
|
|
dbzTHEdinosauer wrote: |
take a look at RDz. |
I use RDz 8.5. |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
well,
my rdz suggestion is obviously not germane to the discussion.
where, why would you want to generate a GUID/UUID for use on the mainframe?
all the existing guid/uuid generators are based on their environment.
so, again i ask, what do you want to do with the generted guid/uuid?
once you answer that question, you then have the opportunity to define the algorithm. after that it is just a matter of coding,
if this is a unique (read: totally new application) situation.
otherwise, i would suggest surfing a bit, seems to be a lot of literature
about guid/uuid and their generation.
though they are not called guid/uuid on the mainframe,
mainly because they are not 16 char,
mainframe seems to be able to accomplish what it needs with the
permutations available with 8 bytes.
one place guids are used:
Wikipedia wrote: |
GUIDs are commonly used as the primary key of database tables, and with that, often the table has a clustered index on that attribute |
|
|
Back to top |
|
|
Peter Larsen
New User
Joined: 03 Aug 2012 Posts: 6 Location: Denmark
|
|
|
|
It is a mainframe program that first needs to get a GUID in the standard format. After that is is send to different recievers as a unique key for "cases". These recievers do something and if they want to update data in our end, they need to send in the GUID we issued.
We do have a solution for this, but we want to improve that - this is what we do:
Generate 50.000 GUID on a windows server, upload the file to mainframe, insert the GUID's in DB2.
Then we can take out a GUID until the table is empty.
We have a job monitoring "low stack" of GUID's and then generate a stack more.
This is not efficient and we wants to skip having DB2 hold the GUID's and just get one on the fly when needed.
I chose to write in this forum for one reason - if one of you already have a nice piece of code why not use that instead of doing my own....
Regards Peter |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
Quote: |
if one of you already have a nice piece of code why not use that instead of doing my own.... |
even if somebody had that nice piece of code, most probably his/her employee would not be glad to see proprietary code posted/sent around! |
|
Back to top |
|
|
Peter Larsen
New User
Joined: 03 Aug 2012 Posts: 6 Location: Denmark
|
|
|
|
I don't know about Italy - but here in Denmark we do share code and helps each other - programmer to programmer.
I have sent some windows API-coding to a competitor - can't really see the problem as long as we talk about small pieces of code.
Of couse I don't share valuable code that is critical for a system - but how to do a doubble pointer-chain in PL/I is not valuable for me.
I have also shared an emal-validator, a small piece of code that tells if an email-adress is ok or not. Of cource you can read the wiki and rfc5322-documentation for this and do it yourself - still nice if you can get an example. Here we also have some sites for sharing pieces of code - of cource this is often C#, Java, C++ and not PL/I+COBOL.
Well if this site is not about helping even with a little code I have joined the wrong forum. Can you tell if this is the normal approach in here? If it is I delete my account again and try elsewhere. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
Quote: |
Well if this site is not about helping even with a little code I have joined the wrong forum. Can you tell if this is the normal approach in here? If it is I delete my account again and try elsewhere. |
just drop the condescending tone, please....
my comment was not rude, your reply yes
looks like you took my advice from the wrong side.
but that' s You problem not mine
generating a GUID is NOT a small task
so even if the code is short the time to test might be significant!
a simple google search would have returned a link to the libuuid
hg.secondlife.com/3p-libuuid/src
and/or to
www.ossp.org/
where the c source code can be downloaded,
since PL/I and ASSEMBLER can interface C and in this case looks like METAL C should be enough
....... |
|
Back to top |
|
|
|