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 

checksum host files from external sources via Cobol

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Other Technical Topics
View previous topic :: View next topic  
Author Message
ROBERTLa
Beginner


Joined: 07 Dec 2003
Posts: 8
Topics: 5

PostPosted: Mon May 24, 2004 8:10 am    Post subject: checksum host files from external sources via Cobol Reply with quote

Gents:

We receive nightly sequential-files from external sources (utility companies etc) transferred to us via Connect-Direct, FTP and heaven knows what. These are edited for errors at our site via a Cobol pgm before running in our nightly batch, using simple record-counts in the file header record. But this only detects dropped records.

We'd like the file's sender to include a simple header field with the checksum field for the entire file, to detect bit level data corruption. We'd then enhance our Cobol edit pgm read the whole file - calculating a Checksum to compare to the header from the sender.

1: Our Cobol edit pgm running under os/390 needs to be able to invoke a file-oriented checksum routine somehow. I haven't seen MVS callable checksum routines on the web so far for files or even record-by-record.

2: The MD5 / CRC routines found on the web seem to use a separate file to hold the checksum. We need it as a header inside each seq data-file.

3: Is it even necessary (with todays modern file xfer utils and comms networks) to worry about bit-level corruption ?

Any Ideas
Rob
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12380
Topics: 75
Location: San Jose

PostPosted: Mon May 24, 2004 8:59 am    Post subject: Reply with quote

Rob,

I have never come across a checksum routine in cobol. A simple way to calculate a checksum is to add all collating rank values and keeping only the lower 8, 16 or 32 bits of them. But this algorithm, if known, might be misused easily.

SAS has the subroutine dmytecks which will perform the checksum on a file upto 200 characters. In the following example, the final checksum is stored in CALC_CS2.

Code:

data _null_;
   length string1 string2 $200 checksm1 checksm2 calc_cs1 calc_cs2; */
     /* The string received from the DataMyte is longer than 200    */
     /* characters, so it is split into two string, STRING1 and     */
     /* STRING2. However, you must calculate the checksum for the   */
     /* entire string (STRING1||STRING2).  SAS statements reading   */
     /* in data from DataMyte until EOT is found.                   */
     /* Initialize the first checksum.                              */
   checksm1='00'x;
   call dmytecks(string1,ckecksm1,calc_cs1);
   checksm2=calc_cs1;
   call dmytecks(string2,checksm2,calc_cs2);
run;


Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Mervyn
Moderator


Joined: 02 Dec 2002
Posts: 415
Topics: 6
Location: Hove, England

PostPosted: Mon May 24, 2004 4:39 pm    Post subject: Reply with quote

I may be wrong, but don't Connect:Direct, FTP and heaven knows what already perform checksum validation transparently?

I'd go along with your option 3, and back that up with a normal header and/or trailer record.
_________________
The day you stop learning the dinosaur becomes extinct
Back to top
View user's profile Send private message
superk
Advanced


Joined: 19 Dec 2002
Posts: 684
Topics: 5

PostPosted: Mon May 24, 2004 8:35 pm    Post subject: Reply with quote

I'm with Mervyn. First of all, consider the impact this type of requirement would have on your trading partner community. There is no way of knowing how these files are produced and on what platforms. Having worked at company that had to produce just such as thing for Insurance claims processing, it was a freakin' nightmare.

Mervyn is right. All of those method of data exchange use sophisticated CRC and error-correction protocols that would make such an event extremely unlikely.
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 -> Other Technical Topics All times are GMT - 5 Hours
Page 1 of 1

 
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