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