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-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

Register now

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