Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Is it possible to find hash total of an alphanumeric field

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
sankaranarayanan parasura

New User


Joined: 28 Oct 2007
Posts: 10
Location: chennai

PostPosted: Sat May 09, 2009 10:59 am    Post subject: Is it possible to find hash total of an alphanumeric field
Reply with quote

Hi All,

I have a requirement to use DFSORT utility to verify the hash total calculated in COBOL program. I like to know is it possible to find hash total of an alphanumeric field using SORT and compare this with the one got created earlier.
If possible kindly suggest the control cards to use.
Back to top
View user's profile Send private message

dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Sat May 09, 2009 11:37 am    Post subject:
Reply with quote

Hello and welcome to the forum,

Is this hash total for some field, a series of fields, an entire file. . .?

If you explain what needs to be "hash totaled" and post the cobol algorithm that calculates the hash total, we can see if a similar total might be calculated using sort.

Are you sure your system uses DFSORT?
Back to top
View user's profile Send private message
sankaranarayanan parasura

New User


Joined: 28 Oct 2007
Posts: 10
Location: chennai

PostPosted: Sun May 10, 2009 8:50 am    Post subject: Reply to: Is it possible to find hash total of an alphanumer
Reply with quote

Hi Dick,
Thanks for your support.
Apologies for the delayed response to your query.
As I am out of office I could not able to present you with the screen shots. However the model of COBOL syntax is like this.


Code:
01 EMPLOYEE-TABLE.
    05 EMPLOYEE-KEY.
        10 EMPLOYEE-NO    PIC 9(8).
        10 EMPLOYEE-F-NAME PIC X(12).
        10 EMPLOYEE L-NAME PIC X(12).
......
......
 
77 WS-EMPLOYEE-NAME  PIC 9(18) COMP.
77 WS-HASHTOTAL         PIC 9(18) COMP.
 
..
...
..
 
PROCEDURE DIVISION.
..
..
..
     READ EMPLOYEE-FILE UNTIL END-OF-FILE.
..
..
..
     MOVE EMPLOYEE-FNAME TO WS-EMPLOYEE-NAME.
     COMPUTE WS-HASHTOTAL = WS-HASHTOTAL + WS-EMPLOYEE-NAME.
...
...
...
WRITE-TRAILER-PARA
     .......
     .......
     MOVE WS-HASHTOTAL TO TRAILER-HASHTOTAL
     WRITE TRAILER RECORD.
 
EXIT-PARA.
STOP RUN.


In the above example it moves the alphabet to a COMP field and adds it together to find the total of that particular field and writes it in trailer record of the extract file created in this program.

Now I like to find the same thing using DFSORT so that it can be compared and cleared for further processing of file when it matches. This control step is the original requirement for this task.

Yes we have DFSORT installed in our system.
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Mon May 11, 2009 9:49 pm    Post subject: Reply to: Is it possible to find hash total of an alphanumer
Reply with quote

sankaranarayanan parasura,


You did not mention the lrecl and position of the field on which the total is being calculated. I assumed it as 80 byte file and FB format and the employee name starts in pos 1 for 12 bytes. The following DFSORT JCL will give you the desired results.

Code:

//STEP0100 EXEC PGM=SORT                         
//SYSOUT   DD SYSOUT=*                           
//SORTIN   DD DSN=Your input fb 80byte file,
//            DISP=SHR
//SORTOUT  DD SYSOUT=*                           
//SYSIN    DD *                                   
  SORT FIELDS=COPY                               
  INREC OVERLAY=(81:1,12,ZD,TO=BI,LENGTH=8)         
  OUTFIL REMOVECC,NODETAIL,BUILD=(1,80),         
  TRAILER1=('TOTAL HASH VALUE : ',               
            TOT=(81,8,BI,EDIT=(TTTTTTTTTTTTTTTT)))
/*
Back to top
View user's profile Send private message
sankaranarayanan parasura

New User


Joined: 28 Oct 2007
Posts: 10
Location: chennai

PostPosted: Tue May 12, 2009 8:33 am    Post subject: Reply to: Is it possible to find hash total of an alphanumer
Reply with quote

Hi Kolusu,

Thanks for that. I will try it out and close this post with screenshots.

Sankar
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Tue May 12, 2009 8:43 am    Post subject:
Reply with quote

Hello,

Please continue using copy/paste and the Code tag rather than actual screenshots.

Thanks icon_smile.gif
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts find RACF group for access to spooled... jzhardy JCL & VSAM 1 Mon May 08, 2017 11:46 am
No new posts DSNACCOX (can it be run on 1 db/ts, t... SRICOBSAS DB2 3 Sat May 06, 2017 12:59 am
No new posts READ A PACKED "NEGATIVE" FI... jdesouza CA Products 3 Tue May 02, 2017 11:43 pm
No new posts To find out size allocated to a seque... ashek15 JCL & VSAM 15 Thu Apr 27, 2017 9:42 am
No new posts Alter &DATENS field in HEADER1 Angad DFSORT/ICETOOL 4 Mon Apr 24, 2017 11:49 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us