Joined: 02 Dec 2002 Posts: 151 Topics: 3 Location: Perth, Western Australia
Posted: Tue Jul 15, 2003 9:20 am Post subject:
Quote:
semigeezer,
Could you please let me know as to how to hash the data in a mainframe enviroment.
semigeezer comes from a technical programming area of mainframe development where hashing and trees are common algorithms. Hashing in COBOL can be done but it's not easy for your average COBOL programmer. First you need a hash algorithm, then you need to choose if you want linear probing, chaining etc. Chaining is what I normally choose, and for that you need linked lists. Quite easy in COBOL.
For the hash, here is a checksum assembler routine that is quick and does the job. It's not the best, but for a simple hash table it's fine.
Code:
HASH RSECT
HASH AMODE 31
HASH RMODE ANY
YREGS ,
SAVE (14,12)
LR R12,R15
USING HASH,R12
XR R3,R3 .Clear for CheckSum
ICM R4,15,0(R1) .Address of data to hash
BZ EXIT
ICM R5,15,4(R1) .Length of data
BZ EXIT
CHKSUM DS 0H
CKSM R3,R4
BNZ CHKSUM
EXIT DS 0H
RETURN (14,12),RC=(3) .Return hash
END
Thanks for the response Dave. Currently, I'm trying to learn assembler, Once I have a bit more understanding about assembler, I will get into the details of the routine that you have specified.
All times are GMT - 5 Hours Goto page Previous1, 2
Page 2 of 2
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum