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;
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;
What kind of graph requires a blank row?
@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.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.