BookmarkSubscribeRSS Feed
Zeeshankhan
Calcite | Level 5

Hi. I want to add an empty row in the dataset when the group chages according to KYGVKEY. How to do that? Thanks in advance for help. 

1.PNG

2 REPLIES 2
Astounding
PROC Star

It's probably not a good idea to change the data in that way.  When producing a report, there are ways to add a blank line.  At any rate, this should get the blank line that you asked for:

 

data want;

set have;

by KYGVKEY notsorted;

output;

if last.kygvkey;

call missing(of _all_);

output;

run;

ballardw
Super User

What will you actually use that blank line for?

 

As @Astounding says that is likely to be suboptimal for many things.

 

At a minimum any sort or procedure that produces sorted output will likely move the blank lines to an out of order position or remove them all together.