Difference Between Binary and Swapped Binary Data

Different types of hardware architecture store Binary in different formats. PC’s and other Intel based machines (Linux/SCO) store it in one form, while some other mini-computers (HP and IBM for sure) store it another way. The two Binaries are similar, but they have the order of the bits “swapped”.

The waySurvox handles this is you can write out or read in either type of Binary by using the ~Input/~Output options Binary or Swapped_Binary. One thing to be very aware of is that when you use the Binary option you get the type of Binary that is “your” type. If you say Binary on a PC you get the “Intel” type Binary, however, if you say Binary on an HP based machine, you get the HP based Binary. If you say Swapped_Binary you get the “other guys” Binary.

If a client who you has not previously sent Binary data to requests a Binary file,Survox strongly recommends that you send them BOTH types and have them tell you which they can read for future reference. If you know what type of system they are on you can try to figure it out from the above information, but it is usually easier and safer to just send them both.

If a client sends you a Binary file and you/they are not sure what type it is, just read it in as Binary and it will either look right or it will look wrong. If it looks wrong though, it will look wrong in a very particular way.

If the data should look like this:

1234567890-&abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ

it will look like this:

789&-0123654***************************@*DMU****’*ENV***=*FOW***

Notice that the numbers/punches are offset by 6. In particular if the first case should have a case ID of 0001 in 1-4, you will see 6667 there instead.

If you get the bad data, then just read the file in using Swapped_Binary and verify it now looks correct.