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.

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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
  • 1557 views
  • 0 likes
  • 3 in conversation