BookmarkSubscribeRSS Feed
yabwon
Onyx | Level 15

It's already spinning, as soon as I get results will let you know. But for now it's taking much much longer then "plain data _null_".

 

Bart

_______________
Polish SAS Users Group: www.polsug.com and communities.sas.com/polsug

"SAS Packages: the way to share" at SGF2020 Proceedings (the latest version), GitHub Repository, and YouTube Video.
Hands-on-Workshop: "Share your code with SAS Packages"
"My First SAS Package: A How-To" at SGF2021 Proceedings

SAS Ballot Ideas: one: SPF in SAS, two, and three
SAS Documentation



yabwon
Onyx | Level 15

The macro I used was a bit different:

%macro genCode(genlineOfCode);
  %if %nrbquote(&genlineOfCode) = %nrbquote() %then %let genlineOfCode=100;
  %do i=1 %to &genlineOfCode;
    data _null_; 
      %do j = 1 %to &i.;
       a&j. = &j;
      %end;
    run;
  %end;
%mend;

but it looks like "the longer the generated data step code the bigger the difference", and it doesn't look "linear", I dare to say it's quadratic

yabwon_0-1714559166854.png

 

Bart

 

 

Bart

_______________
Polish SAS Users Group: www.polsug.com and communities.sas.com/polsug

"SAS Packages: the way to share" at SGF2020 Proceedings (the latest version), GitHub Repository, and YouTube Video.
Hands-on-Workshop: "Share your code with SAS Packages"
"My First SAS Package: A How-To" at SGF2021 Proceedings

SAS Ballot Ideas: one: SPF in SAS, two, and three
SAS Documentation



Tom
Super User Tom
Super User

That makes sense.  It is essentially opening the file again each time it wants to write.  And since it is writing at the end the larger the file the longer it takes to find the end to start writing.

peterprec
Fluorite | Level 6

Looking at @yabwon 's code, I think it should be quadratic as you have 2 %do-loops with the same counter inside each other. Nice to see that theory and reality aligns. 🙂 And it still confirms the rather large penalty for using MFILE...

 

@Tom : Do you know something about the inner workings of the MFILE?

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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
  • 18 replies
  • 1879 views
  • 21 likes
  • 6 in conversation