BookmarkSubscribeRSS Feed
Jhan1
Calcite | Level 5

Im sure there is a simple solution but i cant seem to figure it out and thought Id ask here. 

 

Im working with a dataset with a numeric variable that has hex8 format. This happens to be a unique id for the data. Im simply wanting to take a look at a few observations using proc print. A tyoical id is a combination of letters and numbers hence i tried something similar to below. 

 

Proc print dara = dataset;

Where unique_id in ("x12345z"); run;

 

This doesnt work as unique_id is actually a numeric variable. Any solution to work around this?

 

Thank you!

Spoiler
 
2 REPLIES 2
Astounding
PROC Star

The letters in a hex format are limited in scope ... you won't see an X or a Z.  Presumably you know the right code to search for.  Here is how you would search for A12345D:

 

where unique_id in (A12345Dx);

ballardw
Super User

You might show what you are seeing for the value. Hex really shouldn't have "x" or "Z". There should be no letters higher than F appearing.

 

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 871 views
  • 0 likes
  • 3 in conversation