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
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;
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;
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.
PS I corrected your meaningless subject line.
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
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.
Ready to level-up your skills? Choose your own adventure.