BookmarkSubscribeRSS Feed
vikram2000
Calcite | Level 5

how to add extra rows to the existing data set in sas university  edition?

ex- i have only 5 rows , how can i automatcally increase rows with empty values 

how to make the 5 rows as 500 rows

 

 

4 REPLIES 4
Jagadishkatam
Amethyst | Level 16

please try this example, hope it helps

 

 

data have;
set sashelp.class end=eof;
output;
if eof then do i = 1 to 500;
call missing (name,sex,age,height,weight);
output;
end;
run;

 

 

Thanks,
Jag
PeterClemmensen
Tourmaline | Level 20

Hi and welcome to the SAS Communities 🙂

 

You can do something like this

 

data have;
input id $ var;
datalines;
1 1
2 2
3 3
4 4
5 5
;

data want(drop=i);
   set have end=lr;
   output;
   if lr then do;
   call missing (of _numeric_);
   call missing (of _character_);
      do i=1 to 495;
         output;
      end;
   end;
run;
Kurt_Bremser
Super User

One idea: do a loop that counts to 100 for every observation read.

Note that just adding "empty" records only wastes space, but achieves nothing else that has any information value.

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

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
  • 4 replies
  • 956 views
  • 2 likes
  • 4 in conversation