BookmarkSubscribeRSS Feed
knveraraju91
Barite | Level 11

Dear,

I need to insert two blank rows in my data set to use it for a graph. I am getting the output i need from data two, but is there a better way to program as there are more variables in actual data set. Thank you

 

output needed

a 1 c a
a
b 2 c a c 3 c a d 4 c a e 5 c a g 6 c a
data one;
input a $ b c $  d $;
datalines;
a 1 c a
b 2 c a
c 3 c a
d 4 c a
e 5 c a
g 6 c a
;

data two;
set one;
if _n_=1 then output;
if _n_=1 then do;b=.;c='';d='';output;end;
if _n_=1 then do;a='';b=.;c='';d='';output;end;
else output;
run;
3 REPLIES 3
novinosrin
Tourmaline | Level 20
data two1;
set one;
if _n_=1 then do;
output;
call missing(b,c,d);
output;
call missing(of _all_);
output;
end;
else output;
run;
PeterClemmensen
Tourmaline | Level 20

What kind of graph requires a blank row?

ballardw
Super User

@PeterClemmensen wrote:

What kind of graph requires a blank row?


I am guessing one that the data is coming from a spreadsheet and is structured poorly for SAS graphing and this an attempt to translate spreadsheet graphing practices to a SAS graphic procedure.

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 10089 views
  • 2 likes
  • 4 in conversation