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

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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