BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
AKHILA
Obsidian | Level 7
I have a dataset in which the first variable'name' like this ,say

Name
FRUIT
apple
Orange
Grapes
Mango
Cherry
FLOWER
Jasmine
Lilly
Lotus
COLOUR
blue
Pink
Yellow
red
How can i insert an empty row in proc report as i have splitted into different pages using pagebreak like:
Name
FRUIT
apple
Orange
Grapes
Mango
Cherry
----------------
FLOWER
Jasmine
Lilly
Lotus
---------------------
COLOUR
blue
Pink
Yellow
red
1 ACCEPTED SOLUTION

Accepted Solutions
Cynthia_sas
Diamond | Level 26

HI:
I'm not sure what you mean when you say "using pagebreak". Do you mean that the dashed line you show is actually where you want a page break? Or do you JUST want an empty line in the report before the strings COLOUR, FLOWER, FRUIT, etc??

While a compute block may help you, it will only work with GROUP or ORDER items on the report. So depending on what the rest of your data looks like, It seems to me like your data is using one column to hold grouping information and detail information, with no distinction between them.

If you could restructure your data, using PROC REPORT would be easier as shown below:

need_break_report.png
If you had something like a TYPE variable on every row, then you could control what was written out at the break.

 

Or, otherwise, restructure your data another way to get the same report:

alternate_break.png

 

My tendency is to prefer the first approach, but I have also used the second approach too.

 

Cynthia

View solution in original post

2 REPLIES 2
andreas_lds
Jade | Level 19

The line-statement in a compute-block should do what you want.

Cynthia_sas
Diamond | Level 26

HI:
I'm not sure what you mean when you say "using pagebreak". Do you mean that the dashed line you show is actually where you want a page break? Or do you JUST want an empty line in the report before the strings COLOUR, FLOWER, FRUIT, etc??

While a compute block may help you, it will only work with GROUP or ORDER items on the report. So depending on what the rest of your data looks like, It seems to me like your data is using one column to hold grouping information and detail information, with no distinction between them.

If you could restructure your data, using PROC REPORT would be easier as shown below:

need_break_report.png
If you had something like a TYPE variable on every row, then you could control what was written out at the break.

 

Or, otherwise, restructure your data another way to get the same report:

alternate_break.png

 

My tendency is to prefer the first approach, but I have also used the second approach too.

 

Cynthia

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

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
  • 2 replies
  • 6462 views
  • 0 likes
  • 3 in conversation