View Full Version : Comparing a Unix file to an As/400 file to verify successful transmission...
01-01-1995, 02:00 AM
When interfacing, is it feasible to check data integrity by comparing file sizes? For instance, after a file change on the AS/400 is transmitted to the corresponding file on our Unix, comparing file sizes to verify that each file is the same?
01-03-2001, 10:03 AM
Unless I'm misunderstanding your uestion, I wouldn't think so. After an EBCDIC to ASCII translation, there are bound to be size differences, and each system varies in the way size is measured. Dave
01-03-2001, 10:12 AM
This worse than comparing qumquats and 747s but here is a possibility. copy the 400 db2 version to IFS and see if these could be compared. Please don't use my name if you tell anyone about this. bobh
01-03-2001, 11:14 AM
"John" suggests to "copy the 400 db2 version to IFS". How do I do this?
01-03-2001, 12:10 PM
Deb, I had to do a FTP transfer from AS/400 to an outside SCO UNIX server thru an automated Batch process for one of my projects. I had to verify whether the contents had reached properly in the Target machine. So after some aimless wandering I wrote a not too sophisticated procedure. a) Open FTP session b) Transfer FileA from AS/400 to Unix machine as FileB c) Download the FileB from Unix to AS/400 as FileC in the same library as FileA. d) Do a Compare Physical File Member betn. FileA and FileC. e) MONMSG for Message ID "SPC6002". This happens when the 2 files are not the same. f) Process Logic depending on that. After I used this procedure the earlier issues bcos of FTP connexn terminating inbetween were all ironed out. Hope this helps.
01-03-2001, 11:16 PM
Deb, File size comparison is no good. The method by Seetharam will work and would be useful for troubleshooting purposes. However, it may not be practical for large files with slow comm lines. For frequently run automated tasks involving large files, you would be better off to create a program in the target machine to extract controls (record count and hash totals) from the transferred file. Call this program immediately after the transfer, then compare values with the controls for the original file.
01-08-2001, 11:24 AM
Rick, I have not tested my method with large files. The maximum file size that I have transferred is near 200 KB. The communication is fast. I had suggested this method mainly bcos Deb was doing a transfer to Unix inside an INTRANET and so the available bandwidth may be pretty high. Rgds, Seeths
01-08-2001, 06:40 PM
Seeths, Please don't get me wrong. I agree that your method will work. In fact, I am already working on script to use your method in troubleshooting some of our problematic lease lines. My only reservation is that if huge files are involved, this is a pretty good way to significantly reduce available bandwidth in the network. Also, the file member comparison is going to take much longer to finish if the file sizes are several hundred megabytes or more.
Powered by vBulletin® Version 4.1.5 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.