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.

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 2 replies
  • 1911 views
  • 0 likes
  • 3 in conversation