The SAS Output Delivery System and reporting techniques

PROC REPORT

Reply
Frequent Contributor
Posts: 78

PROC REPORT

 

 

                                                                                                      SUBSYS REPORT

DATE

TIME

SubSys

Blades

Blade Name

Blade Util

Blade Name

Blade Util

Blade Name

Blade Util

Blade Name

Blade Util

Blade Name

Blade Util

Blade Name

Blade Util

Blade Name

Blade Util

Blade Name

Blade Util

28FEB2015

8:30

12345

4

1MA

0

1MB

46

2MC

67

2MD

49

 

.

 

.

 

.

 

.

26FEB2015

8:30

12345

4

1MA

0

1MB

27

2MC

66

2MD

55

 

.

 

.

 

.

 

.

21FEB2015

8:30

12345

4

1MA

0

1MB

41

2MC

60

2MD

44

 

.

 

.

 

.

 

.

20FEB2015

10:30

12345

4

1MA

0

1MB

46

2MC

57

2MD

60

 

.

 

.

 

.

 

.

 

Above is an output of the PROC REPORT after processing the data and after the "Blade Name" the next column represent the "Value for that Blade ..

I was wondering if it's possible via PROC REPORT to print this data something like where we have Blade name as column heading and then Blade value...I guess similar kind of question I asked before However none of the solution work...I have requirement to use PROC REPORT becuase I am using that in the MACRO and then printing output in ODS HTML ...

 

Esteemed Advisor
Esteemed Advisor
Posts: 6,726

Re: PROC REPORT

Hi,

 

Sorry, am not following what it is you want.  Please provide example of what you have, and an example of what you want.  Is it possible you mean across variables?  

Frequent Contributor
Posts: 78

Re: PROC REPORT

This is the output I am looking instead of above output

   ​  SUBSYS REPORT
DATE TIME SubSys Blades 1MA 1MB 2MC 2MD
28-Feb-15 8:30 12345 4 0 46 67 49
26-Feb-15 8:30 12345 4 0 27 66 55
21-Feb-15 8:30 12345 4 0 41 60 44
20-Feb-15 10:30 12345 4 0 46 57 60
Esteemed Advisor
Esteemed Advisor
Posts: 6,726

Re: PROC REPORT

This then is nothing to do with proc report.  You are restructuring your data from wide (transposed) to long (normalised).  There are many posts and papers about on this subject, try the learning module on the subject:

http://www.ats.ucla.edu/stat/sas/modules/ltow_transpose.htm

 

The simplest form, but most typing, is just to set each block:

data want;
  set have (keep=date time subsys blades blade_util1 rename=(blade_util1=1ma))
      have (keep=date time subsys blades blade_util2 rename=(blade_util2=1mb))
      have (keep=date time subsys blades blade_util3 rename=(blade_util3=2mc))
      have (keep=date time subsys blades blade_util4 rename=(blade_util4=2md));
run;

Note, I do not know what your variable names are so just made them up based on the bits you have posted.

Frequent Contributor
Posts: 78

Re: PROC REPORT

Thanks for your advice however You have hardcoded rename statement with blade_util1=1MA however that's not the case everytime since this is for one SUBSYS(which is a by variable) next subsys data can have Blade_util1=2MC (different name) so renaming with hard coding value won't be successful.

Esteemed Advisor
Esteemed Advisor
Posts: 6,726

Re: PROC REPORT

Well, I can only post with what you have provided there.  That code was presented for the data shown, there was also a link there which goes into other wasy to normalise data.  Alternatively, post a datastep (i.e. data + datalines) with some test data and I can modify the code to work with the data.

Post a Question
Discussion Stats
  • 5 replies
  • 409 views
  • 0 likes
  • 2 in conversation