Desktop productivity for business analysts and programmers

Switching off formats

Reply
Frequent Contributor
Posts: 91

Switching off formats

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
Super Contributor
Super Contributor
Posts: 3,174

Re: Switching off formats

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.
Ask a Question
Discussion stats
  • 1 reply
  • 118 views
  • 0 likes
  • 2 in conversation