Hi,
I am using "Do for" loop in a SPSS macro, and noticed that the default limit for "MITERATE' is 1000. I can changed this limit to 5000, but the loop still stopped at 3998 and it casued the SPSS crash. Is there any way to get around this or an alternative method to do it? Do for loop I used. /*!do !i=1 to 5000 blabla !doend*/. Thanks, |
Administrator
|
Albert,
This ran without any issues on Statistics 22.0.0.1 DEFINE mymacro(). !DO !I=1 !TO 10000. ECHO !QUOTE (!I). !DOEND !ENDDEFINE. SET MITERATE 10001. SHOW MITERATE. mymacro . You need to provide more information on what you are doing?
Please reply to the list and not to my personal email.
Those desiring my consulting or training services please feel free to email me. --- "Nolite dare sanctum canibus neque mittatis margaritas vestras ante porcos ne forte conculcent eas pedibus suis." Cum es damnatorum possederunt porcos iens ut salire off sanguinum cliff in abyssum?" |
thanks, David. I am using SPSS 21, and I already set MITERATE to 10000, however, the loop will stop at 3998, and cause SPSS to crash.
On Wed, Apr 23, 2014 at 11:20 AM, David Marso [via SPSSX Discussion] <[hidden email]> wrote: Albert, |
Administrator
|
My code also ran WITHOUT issues in SPSSWin 11.5 !!!
Did you run MY exact simple test code to verify it doesn't have something do do with the SPECIFICS of WHAT YOU ARE DOING in the loop rather than the number of iterations? When I state YOU NEED TO PROVIDE MORE SPECIFICS I meant precisely that!!!! You ask for suggested alternatives but fail to provide anything to chew on in order to spit out any suggestions.
Please reply to the list and not to my personal email.
Those desiring my consulting or training services please feel free to email me. --- "Nolite dare sanctum canibus neque mittatis margaritas vestras ante porcos ne forte conculcent eas pedibus suis." Cum es damnatorum possederunt porcos iens ut salire off sanguinum cliff in abyssum?" |
Hi, David: This was the code I sued.On Wed, Apr 23, 2014 at 11:37 AM, David Marso [via SPSSX Discussion] <[hidden email]> wrote: My code also ran WITHOUT issues in SPSSWin 11.5 !!! |
In reply to this post by David Marso
Hi, David This is the code I useddefine !readXML (Level=!charend('/') / start=!charend('/') / end=!charend('/')) !do !l !in (!Level). !DO !i=!start !TO !end get file=!quote(!concat('directory\',!l,'_Raw.sav')). select if (SeqID=!i). exe. write outfile=!quote(!concat("directory\xml_txt\",!l,"_",!i".xml")) /all. new file. !DOEND dataset close all. !doend. !enddefine. show miterate. set miterate=3000. !readXML Level=1 / start=1 / end=8000/. On Wed, Apr 23, 2014 at 11:49 AM, Xiaoxun Sun <[hidden email]> wrote:
|
Administrator
|
As I suspected, it has NOTHING to to with MITERATE!
You are trying to open TOO MANY files in a single session! That is why I requested you run my ECHO code!!!!! Testcide. ---- DEFINE mywrite(). !DO !I=1 !TO 10000. TEMPORARY. SELECT IF (ID=!I). WRITE OUTFILE=!QUOTE(!CONCAT('G:\TEMP\',!I,'.dat'))/ID var01 TO var10. EXECUTE. !DOEND !ENDDEFINE. /*<Create sample data>*/. DATASET DECLARE tmp. MATRIX. SAVE ({T({1:10000}), UNIFORM(10000,10)}) / OUTFILE tmp /VARIABLES ID var01 TO var10. END MATRIX. DATASET ACTIVATE tmp. /* Test call */. mywrite. ERROR MESSAGE!
Please reply to the list and not to my personal email.
Those desiring my consulting or training services please feel free to email me. --- "Nolite dare sanctum canibus neque mittatis margaritas vestras ante porcos ne forte conculcent eas pedibus suis." Cum es damnatorum possederunt porcos iens ut salire off sanguinum cliff in abyssum?" |
Administrator
|
Go here to view screenshot of Error message in case you can't see it through your access method.
http://spssx-discussion.1045642.n5.nabble.com/Limite-on-MITERATE-td5725602.html#a5725613
Please reply to the list and not to my personal email.
Those desiring my consulting or training services please feel free to email me. --- "Nolite dare sanctum canibus neque mittatis margaritas vestras ante porcos ne forte conculcent eas pedibus suis." Cum es damnatorum possederunt porcos iens ut salire off sanguinum cliff in abyssum?" |
Thanks, David if I do need to process this many files in one session, how to get around to make it work. Currently I split the loop into every 3000.On Wed, Apr 23, 2014 at 1:20 PM, David Marso [via SPSSX Discussion] <[hidden email]> wrote: Go here to view screenshot of Error message in case you can't see it through your access method. |
Administrator
|
I can think of a number of ways but they are beyond what I am willing to share for free in this forum.
Please reply to the list and not to my personal email.
Those desiring my consulting or training services please feel free to email me. --- "Nolite dare sanctum canibus neque mittatis margaritas vestras ante porcos ne forte conculcent eas pedibus suis." Cum es damnatorum possederunt porcos iens ut salire off sanguinum cliff in abyssum?" |
Free forum by Nabble | Edit this page |