MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Sequential files in COBOL
Goto page Previous  1, 2
 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming
View previous topic :: View next topic  
Author Message
DaveyC
Moderator


Joined: 02 Dec 2002
Posts: 151
Topics: 3
Location: Perth, Western Australia

PostPosted: Tue Jul 15, 2003 9:20 am    Post subject: Reply with quote

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                                             

_________________
Dave Crayford
Back to top
View user's profile Send private message Send e-mail
prakal
Beginner


Joined: 14 Mar 2003
Posts: 22
Topics: 1

PostPosted: Wed Jul 16, 2003 5:00 pm    Post subject: Reply with quote

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.

Thanks again.
Prakal.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming All times are GMT - 5 Hours
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
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


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group