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-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 18 replies
  • 716 views
  • 21 likes
  • 6 in conversation