BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
shotstopper30
Calcite | Level 5

I am a fairly new user to SAS and have discovered some issues I can't get my head around.  I am working with a huge transactional data set.

I first created a data set that included a hashed customer identifier along with a new purchase column that was sorted in descending order.  I became curious with the observation that came to the top of this list.  So, I was interested in revealing the rest of the variables from the original data set that went along with this top customer's purchases (SKUs, date/time of purchase, etc).

Here's an example of what I entered (I'm just looking for the first entry for now since this is a huge data set and takes a long time to run.)

proc sql inobs=1;

select *

from ben.<datasetname>

where <identifier> like "3B342DC8";

run;

The result every time is not an error code but a blank results page.

The hashed customer identifier is of type hexadecimal and I'm wondering if that's what's causing my problems.  I have also tried the contains statement as well as % and _ to solve this issue and find out if there are any wild cards that I can't see.  No luck.

Any ideas?

Thank You!

Ben

1 ACCEPTED SOLUTION

Accepted Solutions
data_null__
Jade | Level 19

Not sure I understand completely, but character hex constants are specified in SAS as "quoted hex string" followed by X.

"3B342DC8"x

View solution in original post

3 REPLIES 3
Reeza
Super User

Have you tried = and check the length of the character variable in your customer identifier and actual table.  Your actual variable in the dataset could have trailing spaces perhaps?

Could you explain how you created your hash identifier as well and how it maps to the old dataset?

data_null__
Jade | Level 19

Not sure I understand completely, but character hex constants are specified in SAS as "quoted hex string" followed by X.

"3B342DC8"x

shotstopper30
Calcite | Level 5

Thank you Reeza and data_null_:! 

Reeza - I forgot to mention that I had tried = first and checked the length of the customer identifier in the actual table, and concluded there were no trailing spaces in my first post.  I also wouldn't have been able to explain how the identifier was hashed because someone else had done it before me and sent it to me that way.

Data_null_: - I knew I was missing something small and somewhat obvious but I could not find the answer to why this was happening anywhere, and it was the x following the quoted string. 

Thanks again to you both for quick replies to my vague post.

Ben

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 946 views
  • 4 likes
  • 3 in conversation