Re: comparing binary file

2013-08-18 Thread Ron Hawkins
Gil,

I agree with you.

However, you may be replying to the wrong post. 

I was simply commenting on what I know as normal behavior when a sorting 
utility deletes duplicate keys or records.

Ron

> -Original Message-
> From: IBM Mainframe Discussion List [mailto:IBM-MAIN@LISTSERV.UA.EDU]
> On Behalf Of Paul Gilmartin
> Sent: Sunday, August 18, 2013 4:45 PM
> To: IBM-MAIN@LISTSERV.UA.EDU
> Subject: Re: [IBM-MAIN] comparing binary file
> 
> On Sun, 18 Aug 2013 15:48:17 -0700, Ron Hawkins wrote:
> >
> >A
> >B
> >
> >Just omit the duplicates, but keep the 1st one...
> >
> >> On Thu, 15 Aug 2013 17:24:43 +0300, Itschak Mugzach wrote:
> >>
> >> >Or sort with omit duplicates...
> >> >
> Sorting would seem to be counterproductive when comparing files.
> Two files which differ only in the order of their records will appear 
> identical
> when sorted.
> 
> Of course, only if the files are considered as sets (not multisets) of 
> records,
> with order being irrelvant, sorting is useful.
> 
> -- gil
> 
> --
> For IBM-MAIN subscribe / signoff / archive access instructions, send email to
> lists...@listserv.ua.edu with the message: INFO IBM-MAIN

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


Re: comparing binary file

2013-08-18 Thread Paul Gilmartin
On Sun, 18 Aug 2013 15:48:17 -0700, Ron Hawkins wrote:
>
>A
>B
>
>Just omit the duplicates, but keep the 1st one...
>
>> On Thu, 15 Aug 2013 17:24:43 +0300, Itschak Mugzach wrote:
>> 
>> >Or sort with omit duplicates...
>> >  
Sorting would seem to be counterproductive when comparing files.
Two files which differ only in the order of their records will appear
identical when sorted.

Of course, only if the files are considered as sets (not multisets) of
records, with order being irrelvant, sorting is useful.

-- gil

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


Re: comparing binary file

2013-08-18 Thread Ron Hawkins
Paul,

A
B

Just omit the duplicates, but keep the 1st one...

Ron

> -Original Message-
> From: IBM Mainframe Discussion List [mailto:IBM-MAIN@LISTSERV.UA.EDU]
> On Behalf Of Paul Gilmartin
> Sent: Thursday, August 15, 2013 7:34 AM
> To: IBM-MAIN@LISTSERV.UA.EDU
> Subject: Re: [IBM-MAIN] comparing binary file
> 
> On Thu, 15 Aug 2013 17:24:43 +0300, Itschak Mugzach wrote:
> 
> >Or sort with omit duplicates...
> >
> Ummm ...  Suppose File 1 is:
> 
> A
> B
> 
> And File 2 is:
> 
> B
> A
> 
> Merged and sorted is:
> 
> A
> A
> B
> B
> 
> Eliminating duplicates gives:
> 
> (nothing!)
> 
> -- gil
> 
> --
> For IBM-MAIN subscribe / signoff / archive access instructions, send email to
> lists...@listserv.ua.edu with the message: INFO IBM-MAIN

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


Re: comparing binary file

2013-08-15 Thread Itschak Mugzach
John,

Sort, at least on distibuted platforms, enables you to compare in a JOIN
like syntax where you can decide to keep OUTER (of the join) only. If all
records are duplicated, you'll get an empty file. else you'll get 1 or more
records in the outer condition. So, if the files goes to Unix, sort can
help.


ITschak


On Thu, Aug 15, 2013 at 7:11 PM, John Gilmore  wrote:

> Eliminating duplicates gives
>
>   A
>   B
>
> Eliminating all duplicated values is a different and rare requirement.
>   Eliminating duplicate values ordinarily means that if there are d >=
> 1 instances of a value v in a list, file, whatever,  then d - 1 of
> these values v are eliminated.
>
> John Gilmore, Ashland, MA 01721 - USA
>
> --
> For IBM-MAIN subscribe / signoff / archive access instructions,
> send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
>

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


Re: comparing binary file

2013-08-15 Thread John Gilmore
Eliminating duplicates gives

  A
  B

Eliminating all duplicated values is a different and rare requirement.
  Eliminating duplicate values ordinarily means that if there are d >=
1 instances of a value v in a list, file, whatever,  then d - 1 of
these values v are eliminated.

John Gilmore, Ashland, MA 01721 - USA

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


Re: comparing binary file

2013-08-15 Thread Paul Gilmartin
On Thu, 15 Aug 2013 17:24:43 +0300, Itschak Mugzach wrote:

>Or sort with omit duplicates...
> 
Ummm ...  Suppose File 1 is:

A
B

And File 2 is:

B
A

Merged and sorted is:

A
A
B
B

Eliminating duplicates gives:

(nothing!)

-- gil

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


Re: comparing binary file

2013-08-15 Thread Paul Gilmartin
On Thu, 15 Aug 2013 08:56:52 -0500, Ron Thomas wrote:

>Hello.
>
>We have  bainary file that is send to unix box in that file there a mapping 
>data in which each byte represent data for 8 unix  box. ... , so here after 
>modification how we can compare the files as this a binary data ( ie 1500 *8) 
>information is embedded here.
> 
cmp file1 file2

-- gil

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


Re: comparing binary file

2013-08-15 Thread Itschak Mugzach
Or sort with omit duplicates...
ITschak
בתאריך 15 באוג 2013 17:22, מאת "John McKown" :

> What sort of output do you want from your compare? If you just want to know
> if the two files have identical contents, then the UNIX "cmp" command will
> tell you that. If you want to compare what would be "logical records" on
> z/OS, they you'll need to write a program to do it. If it were me, I write
> it in C or maybe Java. But what sort of output would be appropriate? Simply
> saying something like "record #5 differs". Or do you want something more
> complicated which would be more like the output from the UNIX "diff"
> command? In this latter case, I would probably have my program do some sort
> of "encoding" of the binary data into lines of "text" which diff could then
> compare.
>
>
> On Thu, Aug 15, 2013 at 8:56 AM, Ron Thomas  wrote:
>
> > Hello.
> >
> > We have  bainary file that is send to unix box in that file there a
> > mapping data in which each byte represent data for 8 unix  box.
> >
> > The data defintion is of the below
> >
> > 01  IT2-REC.
> > 03  IT2-LNG   PIC 9(4)  COMP.
> > --
> >03   MAP-DATA OCCURS 0 TO 1500
> > DEPENDING ON IT2-LNG  PIC X.
> >
> > Here now we are planning to increase from 1500 to 2000 , so here after
> > modification how we can compare the files as this a binary data ( ie 1500
> > *8) information is embedded here.
> >
> > Thanks
> > Ron T
> >
> > --
> > For IBM-MAIN subscribe / signoff / archive access instructions,
> > send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
> >
>
>
>
> --
> As of next week, passwords will be entered in Morse code.
>
> Maranatha! <><
> John McKown
>
> --
> For IBM-MAIN subscribe / signoff / archive access instructions,
> send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
>

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


Re: comparing binary file

2013-08-15 Thread John McKown
What sort of output do you want from your compare? If you just want to know
if the two files have identical contents, then the UNIX "cmp" command will
tell you that. If you want to compare what would be "logical records" on
z/OS, they you'll need to write a program to do it. If it were me, I write
it in C or maybe Java. But what sort of output would be appropriate? Simply
saying something like "record #5 differs". Or do you want something more
complicated which would be more like the output from the UNIX "diff"
command? In this latter case, I would probably have my program do some sort
of "encoding" of the binary data into lines of "text" which diff could then
compare.


On Thu, Aug 15, 2013 at 8:56 AM, Ron Thomas  wrote:

> Hello.
>
> We have  bainary file that is send to unix box in that file there a
> mapping data in which each byte represent data for 8 unix  box.
>
> The data defintion is of the below
>
> 01  IT2-REC.
> 03  IT2-LNG   PIC 9(4)  COMP.
> --
>03   MAP-DATA OCCURS 0 TO 1500
> DEPENDING ON IT2-LNG  PIC X.
>
> Here now we are planning to increase from 1500 to 2000 , so here after
> modification how we can compare the files as this a binary data ( ie 1500
> *8) information is embedded here.
>
> Thanks
> Ron T
>
> --
> For IBM-MAIN subscribe / signoff / archive access instructions,
> send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
>



-- 
As of next week, passwords will be entered in Morse code.

Maranatha! <><
John McKown

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN


comparing binary file

2013-08-15 Thread Ron Thomas
Hello.

We have  bainary file that is send to unix box in that file there a mapping 
data in which each byte represent data for 8 unix  box.

The data defintion is of the below

01  IT2-REC.
03  IT2-LNG   PIC 9(4)  COMP.
--
   03   MAP-DATA OCCURS 0 TO 1500
DEPENDING ON IT2-LNG  PIC X.

Here now we are planning to increase from 1500 to 2000 , so here after 
modification how we can compare the files as this a binary data ( ie 1500 *8) 
information is embedded here.

Thanks
Ron T

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN