DATA Step, Macro, Functions and more

proc transpose want to keep format

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 15
Accepted Solution

proc transpose want to keep format

Dear all,

 

I have a question .

I have one dataset with numeric format. I use transpose and the format have not same as original.

 

Any suggestion?


data input;
set data_plot;
     format all_cid pass fail comma22.0 fail_rate goal comma22.2;


label fail_rate = Fail Rate(%);
label all_cid = Total;
label pass = Pass;
label fail = Fail;
label goal = goal;


run;

 

 

proc transpose data=input out=output (drop = _NAME_);
id xaxis ;
var all_cid pass fail fail_rate goal;
run;

 

i attach my input file and output file which i want to see

 

this is the current result which is wrong

ScreenHunter_84 Sep. 09 19.58.jpg


Accepted Solutions
Solution
‎09-16-2016 01:25 AM
Super User
Posts: 9,681

Re: proc transpose want to keep format

Or you could use PROC REPORT + CALL DEFINE()

View solution in original post


All Replies
Super User
Posts: 17,840

Re: proc transpose want to keep format

A column in SAS can only have one format, numeric or percent. 

You can convert the values or character using a PUT statement and apply the format of choice. 

Super User
Posts: 17,840

Re: proc transpose want to keep format

A column in SAS can only have one format, numeric or percent. 

You can convert the values or character using a PUT statement and apply the format of choice. 

Solution
‎09-16-2016 01:25 AM
Super User
Posts: 9,681

Re: proc transpose want to keep format

Or you could use PROC REPORT + CALL DEFINE()
☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 3 replies
  • 720 views
  • 2 likes
  • 3 in conversation