Help using Base SAS procedures

How do we create headers in the SAS Report?

Accepted Solution Solved
Reply
Contributor
Posts: 25
Accepted Solution

How do we create headers in the SAS Report?

Hi ,

 

Please see the attachment for Report screen shot file. I would like to create SAS Report using Proc Reports procedure.In this report screen shot file, how do we create different headers like  "Number of Beneficiary Cases" , "Case Type Initiated","Number of : " 

 

Please help on this .


Accepted Solutions
Solution
‎02-20-2017 03:50 AM
Contributor
Posts: 25

Re: How do we create headers in the SAS Report?

This example helped lot to me. Thank you very much.

View solution in original post


All Replies
SAS Super FREQ
Posts: 8,745

Re: How do we create headers in the SAS Report?

Hi:
Usually, you would write extra lines like this at a break point using a COMPUTE block. But without any data or seeing the code that you've tried, it is hard to guess what the structure of the data is. How the data is structured will impact the code, as you've probably discovered. I assume you want either RTF or PDF output, but again, hard to guess since you did not show your code and ODS statements.

cynthia
Contributor
Posts: 25

Re: How do we create headers in the SAS Report?

Right now my sas app server is down.I have to write code for this.If it is
possible create sample data for the report showing in the attached file
previously.I am not aware of how to use compute block in proc report for
creating headers.Could you please create sample code for this.

Regards,
chandu

##- Please type your reply above this line. Simple formatting, no
attachments. -##
Super User
Posts: 10,550

Re: How do we create headers in the SAS Report?

Some of us don't like opening Microsoft format documents such as DOCX due to security concerns and others have such documents blocked by security.

 

PDF would be a better choice for showing text appearance.

 

As a silly question, do you have labels associated with any of the variables concerned?

SAS Super FREQ
Posts: 8,745

Re: How do we create headers in the SAS Report?

Hi:
  You can always make data using a DATA step program, with the DATALINES technique. For example, here is fake program to make some data for a grade report:

data newclass;
  length Name $40 Type $30;
  infile datalines dlm=',' dsd;
  input ID Name $ Type $ Grade Average Final $;
return;
datalines;
11,"Alex Andrews","Mid-Term Essay",95,93," "
22,"Barb Bascom","Final Exam",70,79,"B"
33,"Carl Clarke","Final Exam",94,92,"A"
33,"Carl Clarke","Group Project",90,92,"A"
44,"Dana Decker","Mid-Term Essay",93,90," "
55,"Edgar Elston","Final Exam",87,90,"A"
;
run;

 

  If you make some fake data that is in the same structure as your data and then post the code you've tried, people can work with data that resembles your actual data and make concrete suggestions based on the code you've started with. Otherwise, it is pointless to write code when the structure of the data for your question is unknown.The fake data that I might make might be completely different than the way your data looks and then the program would not be usable.

 

  The program will be different if the structure of data is different. The Above data for NEWCLASS has one row for every class deliverable for every student. It is possible to have more than one row for one student. In fact, it is likely that there will be more than one row per student. If the data was structured differently, then then program in the screen shot might need to be written differently.

 

  An example of using PROC REPORT with a COMPUTE block is shown below, with the PDF results. What code have you tried? There are a lot of previous forum postings on using COMPUTE blocks.
 
cynthia

 

example_report.png

Solution
‎02-20-2017 03:50 AM
Contributor
Posts: 25

Re: How do we create headers in the SAS Report?

This example helped lot to me. Thank you very much.
☑ This topic is solved.

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

Discussion stats
  • 5 replies
  • 145 views
  • 0 likes
  • 3 in conversation