|
Buck: Yep, and that's an added reason why I wouldn't use it as a unique identifier in the first place as Scott and one or two others also mentioned. I'd almost certainly go with a UUID or similar to begin with. And if I really _needed_ a sequential number, I'd likely create a server-type function, perhaps receiving requests and serving responses via keyed data queues, or implement (quite possibly service program) procedures with maybe a core procedure like: pgm ( + &pqSpcNam + &pIncVal + ) dcl &pqSpcNam *char 20 dcl &pIncVal *dec ( 15 0 ) dcl &SpcNam *char 10 dcl &SpcLib *char 10 chgvar &SpcNam %sst( &pqSpcNam 1 10 ) chgvar &SpcLib %sst( &pqSpcNam 11 10 ) alcobj obj( ( &SpcLib/&SpcNam + *usrspc *excl ) ) chgvar &pIncVal ( &pIncVal + 1 ) dlcobj obj( ( &SpcLib/&SpcNam + *usrspc *excl ) ) return endpgm ...and a few related procedures to create the space and initialize when it doesn't exist, to retrieve a pointer to it and to call this procedure passing the pointer in place of &pIncVal in the parm list, and you have a fairly small, reasonably easy to maintain sequential number generator that's also pretty quick. Obviously, add proper error handling and choose how to handle lock timeouts. A 15-digit packed number will go up to about a quadrillion before needing to be rolled over, so it could be used just about anywhere in a system. But if that ain't enough, then bump the pointer by 8 and create a new number in the same space. I suppose you could have a description field followed by a number followed by a description field followed by... etc., if you need to get fancy, and it should still be pretty fast. ILE CL is handy for some procedures. In this case, the ALCOBJ and DLCOBJ are what is really used. Of course, since the lock(), unlock() and similar APIs are available, there's no real use for ILE CL in this except for concept. Tom Liotta rpg400-l-request@xxxxxxxxxxxx wrote: > 4. RE: "Reference #" (Buck Calabro) > >>this does make me think that even when time-change >>does apply, it might be helped by simply appending the UTC >>offset system value to the string. Somebody might make use of it. > >When people set the system value. ICT poll shows that 3 of 15 people have >it set to +00:00. Doesn't invalidate the idea though, just limits the >implementation. -- -- Tom Liotta The PowerTech Group, Inc. 19426 68th Avenue South Kent, WA 98032 Phone 253-872-7788 x313 Fax 253-872-7904 http://www.powertechgroup.com __________________________________________________________________ Try AOL and get 1045 hours FREE for 45 days! http://free.aol.com/tryaolfree/index.adp?375380 Get AOL Instant Messenger 5.1 for FREE! Download Now! http://aim.aol.com/aimnew/Aim/register.adp?promos=380455
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.