Operating System - OpenVMS
1752794 Members
5661 Online
108789 Solutions
New Discussion юеВ

CREATE_UID from Alpha system

 
SOLVED
Go to solution
Dan Cassels
New Member

CREATE_UID from Alpha system

I am trying to generate a UID from a Fortran program on OpenVMS Alpha. Looking at the documenation I see that it wants a 16 byte argument. Fortran has max 8 byte integer that I get a return value which I don't know is unique. I also can use a 16 byte real argument that I also get a return value, but again don't know is unique. Either way, I need to convert to an ascii value to send in a pipe delimited file as the end of the exercise. Any help would be appreciated
2 REPLIES 2
Ian Miller.
Honored Contributor
Solution

Re: CREATE_UID from Alpha system

Its been 20 years since I did FORTRAN but can you give it a array of 16 bytes then convert each binary byte value to two hex digits?


____________________
Purely Personal Opinion
John Gillings
Honored Contributor

Re: CREATE_UID from Alpha system

Dan,
Don't use REAL. The UID could contain an arbitrary bit pattern, which might not be a valid floating point value, so touching the variable could generate an HPARITH or similar error.

Since FORTRAN isn't strongly typed, you can pass the address of any object at least 16 bytes long. Use whatever is most convenient for your purposes. Arrays, BYTE(16), WORD(8), LONG(4) or a structures containing multiple fields.

Best bet would be to write a little module that hides the details and the calls - and just implements the operations your application needs. For example you could implement MY_UID which returns (say) a hex string, if that's the most appropriate value for your application.
A crucible of informative mistakes