BookmarkSubscribeRSS Feed
deleted_user
Not applicable
I have a macro that will do a data step for all datasets in a specified library, then it does a sort on all the datasets. I then do a proc transpose. The datasets all come together fine but the output under COL1 all the data is the uncoded values.
Example 1= NO the dataset shows 1 instead of no. How in a transpose do I get these values to come out. This program is to run generically across any study chosen within the application so using a format statement for specific formats will not work.
1 REPLY 1
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
There are specific, defined rules for PROC TRANSPOSE and handling numeric and character variables that have a 'formatted value' associated. See the documentation for applying an ID statement (and possibly the PREFIX= keyword) where you have a numeric variable value which you want to take on some other string when generating your SAS variable/column names during TRANSPOSE.


Scott Barry
SBBWorks, Inc.

PROC TRANSPOSE documentation, refer to section on "Attributes of Transposed Variables"
http://support.sas.com/documentation/cdl/en/proc/61895/HTML/default/a000063675.htm

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

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.

SAS Training: Just a Click Away

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

Browse our catalog!

Discussion stats
  • 1 reply
  • 894 views
  • 0 likes
  • 2 in conversation