Statistical programming, matrix languages, and more

CALL QUEUE - How many statements is too many?

Accepted Solution Solved
Reply
Frequent Contributor
Posts: 141
Accepted Solution

CALL QUEUE - How many statements is too many?

I have been experimenting for the first time with CALL QUEUE to generate IML statements from character strings and I have noticed that the documentation is a little vague about the number of statements that can be queued.  Specifically there is the following warning:

 

"Caution: Do not queue too many statements at one time. Queuing too many statements can cause problems that can result in exiting the SAS System."

 

I have written a program that queues as many as 1089 IML statments at once (as there are multiple statements in my strings, only 129 CALL QUEUEs are used to do this).  So far I have not experienced any problems where my queued code is nesting a lot of simple Do Loops and If Statements.  Am I tempting fate?  What sort of queued code, or how much of it, might lead to the unrecoverable error that the warning hints at?

 

PS.  I tried to attach a sas program but I get "The contents of the attachment doesn't match its file type."  Perhaps what I am trying is on the extreme side!


Accepted Solutions
Solution
‎11-30-2015 03:08 AM
SAS Super FREQ
Posts: 3,554

Re: CALL QUEUE - How many statements is too many?

If that statement is in the doc, there must have been some problem that the developers at the time knew about. However, that statement was probably written in Version 6 when memory was measured in kilobytes.

 

I am not aware of any  issues like you describe. I have never tried to "push the limits" of CALL QUEUE myself, but I suspect the issue would be related to pushing too many statements on the stack.  If your program is pushing a few statements that then get executed before you push more statements, then the stack never gets very deep. In other words, it is not how many calls you execute, but how many are "pushed but not yetexecuted" However, I am just guessing. 

 

If you do run in to problems and are using SAS/IML 13.2 or later, you might try the EXECUTEFILE statement.  You can write a file at run time and then turn around and execute the statements in the file. See the article "Execute SAS/IML statements at run time".

View solution in original post


All Replies
Solution
‎11-30-2015 03:08 AM
SAS Super FREQ
Posts: 3,554

Re: CALL QUEUE - How many statements is too many?

If that statement is in the doc, there must have been some problem that the developers at the time knew about. However, that statement was probably written in Version 6 when memory was measured in kilobytes.

 

I am not aware of any  issues like you describe. I have never tried to "push the limits" of CALL QUEUE myself, but I suspect the issue would be related to pushing too many statements on the stack.  If your program is pushing a few statements that then get executed before you push more statements, then the stack never gets very deep. In other words, it is not how many calls you execute, but how many are "pushed but not yetexecuted" However, I am just guessing. 

 

If you do run in to problems and are using SAS/IML 13.2 or later, you might try the EXECUTEFILE statement.  You can write a file at run time and then turn around and execute the statements in the file. See the article "Execute SAS/IML statements at run time".

Frequent Contributor
Posts: 141

Re: CALL QUEUE - How many statements is too many?

Thanks Rick, that's helpful and more or less what I was expecting, so I think I can stop worrying.  I have never managed to bring myself to throw away my copy of the version 6 first edition Usage and Reference, so I can say that the while the statement has been rewritten, something very similar is there in the first edition which also warns about SAS exiting.

Frequent Contributor
Posts: 141

Re: CALL QUEUE - How many statements is too many?

Just a footnote to say that I have not experienced any problems since I wrote the above.

 

In case anyone is interested, the attached IML program effectively uses CALL QUEUE to compile another program.  The latter is not something that you would want to write 'by hand', since at one point the do loops are nested 49 levels deep!  The program carries out a complete enumeration of a particular type of Latin Square.

Attachment
☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 3 replies
  • 346 views
  • 3 likes
  • 2 in conversation