BookmarkSubscribeRSS Feed
nrose
Quartz | Level 8
Hi,

When opening up data tables, I often need to look at the underlying codes of a variable. I know you can change the format of a column to nothing in read write mode to see the underlying variable lables, but is there a quicker and easier way to switch off formatting so you see the underlying values?

Thanks,

Nick
1 REPLY 1
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
You can use varying techniques with the SAS FORMAT statement, such as:

FORMAT _CHARACTER_ ;
FORMAT _NUMERIC_;
FORMAT _ALL_ ;
FORMAT MYVAR: ;

See example execution below.

Scott Barry
SBBWorks, Inc.


24 data x;
25 retain a 'A' b 100;
26 format a $HEX2. b hex4.;
27 putlog _all_;
28 run;

a=41 b=0064 _ERROR_=0 _N_=1
NOTE: The data set WORK.X has 1 observations and 2 variables.


29 data y;
30 set x;
31 format _all_ ;
32 putlog _all_;
33 run;

a=A b=100 _ERROR_=0 _N_=1
NOTE: There were 1 observations read from the data set WORK.X.
NOTE: The data set WORK.Y has 1 observations and 2 variables.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

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
  • 1 reply
  • 642 views
  • 0 likes
  • 2 in conversation