Limits for the number of imputes

Discussions about editing and cleaning data
Post Reply
AriSilva
Posts: 606
Joined: July 22nd, 2016, 3:55 pm

Limits for the number of imputes

Post by AriSilva »

Hi folks,
Is there any limit for the number of impute statements in a program?
Or any other limit whasoever?
Attached is a pack with a small program with around 1200 lines with imputes errmsgs etc
If I try to execute it, it does not shown even the input screen to select the input file.
But if I comment out some of the lines it asks for the input in the input screen.
I´m a little bit lost on that.
Best
Ari
Attachments
01_mca.zip
(30.31 KiB) Downloaded 76 times
Best
Ari
Gregory Martin
Posts: 1828
Joined: December 5th, 2011, 11:27 pm
Location: Washington, DC

Re: Limits for the number of imputes

Post by Gregory Martin »

CSPro initially allocates about 200 kb of memory for the compiled bytecode for each PROC. The memory can grow, but the way the compiler works, it only grows at certain times, and in your case, there are so many statements in PROC P49_OCU, that the compiled bytecode is being written to memory that is too small. In the future, we'll likely revisit how this works.

In the meantime, your best option is to split up your statements into multiple functions or PROCs:
if P26_EDAD > 6 then
   
ImputePart1();
    ImputePart2();
    ImputePart3();
    // ...
This is bit annoying, but it would fix your issue. Just as reference, your compiled bytecode is 1,572,672 bytes, so you'd likely have to split those statements into eight functions.
AriSilva
Posts: 606
Joined: July 22nd, 2016, 3:55 pm

Re: Limits for the number of imputes

Post by AriSilva »

Thanks, Gregg
Best
Ari
AriSilva
Posts: 606
Joined: July 22nd, 2016, 3:55 pm

Re: Limits for the number of imputes

Post by AriSilva »

Apparently it may have the same memory limitations concerning the total amount used in the functions, because when I moved all the IFs to the functions it did not work, but when I moved part of them to the functions and the other part I left in the original proc it worked, asking for the input.
Thanks, anyway, the impirtnat thnik is that it works, following your advice.
Best
Ari
Best
Ari
Post Reply