BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
braam
Quartz | Level 8

I would like to add an empty line when a specified condition is met. I have a column, NO, that looks below.

Obs. NO

1 1

2 2

3 3

4 4

5 5

6 1

7 2

8 3

9 4

10 5

11 1

12 2

 

 

Then I would like to add a blank line that follows the observation whose NO is 5. What I would like to have looks below. 

 

Obs. NO

1 1

2 2

3 3

4 4

5 5

7 1

8 2

9 3

10 4

11 5

12 

13 1

14 2

 

So, the lines 6 and 12 are blank. Can anybody help me with this?

1 ACCEPTED SOLUTION

Accepted Solutions
novinosrin
Tourmaline | Level 20

 

data want;

set have;

output;

if no=5 then do;

no=.;

output;

end;

run;

 

 

View solution in original post

1 REPLY 1
novinosrin
Tourmaline | Level 20

 

data want;

set have;

output;

if no=5 then do;

no=.;

output;

end;

run;

 

 

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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
  • 1 reply
  • 254 views
  • 0 likes
  • 2 in conversation