VARBINARY

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

VARBINARY

Peter Spangler
Hi all, 

I have a Varbinary variable pulled directly from a SQL 2012 database that contain hashed email addresses. The variable appear correctly in the variable view, but becomes mumbled when I try to save the data pull as an SPSS file.  I tried to use the ALTER TYPE command to change to String, however, it this mumbled into letters, numbers and "?" symbols.

Any way I can use use Alter Type or other so that I can save the file with the data intact.


Peter
Reply | Threaded
Open this post in threaded view
|

Re: VARBINARY

Jon K Peck
What data type is this coming into Statistics as?  I would have guessed that it would be a string.  However, hash codes are generally not valid strings of characters.  If Statistics is in Unicode mode but the database is not, Statistics would be trying to convert to Unicode, but that would fail with many byte sequences, hence question marks in the result.

You might have better luck in code page mode.

I think the most you could do with these codes is to tell whether two addresses are the same or different.  You might need to recode these in the database in a hex code or such first.


Jon Peck (no "h") aka Kim
Senior Software Engineer, IBM
[hidden email]
phone: 720-342-5621




From:        Peter Spangler <[hidden email]>
To:        [hidden email],
Date:        11/11/2013 03:30 PM
Subject:        [SPSSX-L] VARBINARY
Sent by:        "SPSSX(r) Discussion" <[hidden email]>




Hi all, 

I have a Varbinary variable pulled directly from a SQL 2012 database that contain hashed email addresses. The variable appear correctly in the variable view, but becomes mumbled when I try to save the data pull as an SPSS file.  I tried to use the ALTER TYPE command to change to String, however, it this mumbled into letters, numbers and "?" symbols.

Any way I can use use Alter Type or other so that I can save the file with the data intact.


Peter
Reply | Threaded
Open this post in threaded view
|

Re: VARBINARY

Peter Spangler
It is coming into Statistics as undefined (the variable type window is empty). Certainly accounts for the question marks at saving because Statistics wants to save them as strings. 

I'm thinking that they need to be saved to the database as strings once they are hashed. 


On Mon, Nov 11, 2013 at 2:49 PM, Jon K Peck <[hidden email]> wrote:
What data type is this coming into Statistics as?  I would have guessed that it would be a string.  However, hash codes are generally not valid strings of characters.  If Statistics is in Unicode mode but the database is not, Statistics would be trying to convert to Unicode, but that would fail with many byte sequences, hence question marks in the result.

You might have better luck in code page mode.

I think the most you could do with these codes is to tell whether two addresses are the same or different.  You might need to recode these in the database in a hex code or such first.


Jon Peck (no "h") aka Kim
Senior Software Engineer, IBM
[hidden email]
phone: <a href="tel:720-342-5621" value="+17203425621" target="_blank">720-342-5621




From:        Peter Spangler <[hidden email]>
To:        [hidden email],
Date:        11/11/2013 03:30 PM
Subject:        [SPSSX-L] VARBINARY
Sent by:        "SPSSX(r) Discussion" <[hidden email]>




Hi all, 

I have a Varbinary variable pulled directly from a SQL 2012 database that contain hashed email addresses. The variable appear correctly in the variable view, but becomes mumbled when I try to save the data pull as an SPSS file.  I tried to use the ALTER TYPE command to change to String, however, it this mumbled into letters, numbers and "?" symbols.

Any way I can use use Alter Type or other so that I can save the file with the data intact.


Peter