BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
IanWakeling
Barite | Level 11

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!

1 ACCEPTED SOLUTION

Accepted Solutions
Rick_SAS
SAS Super FREQ

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

3 REPLIES 3
Rick_SAS
SAS Super FREQ

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".

IanWakeling
Barite | Level 11

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.

IanWakeling
Barite | Level 11

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.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

Multiple Linear Regression in SAS

Learn how to run multiple linear regression models with and without interactions, presented by SAS user Alex Chaplin.

Find more tutorials on the SAS Users YouTube channel.

From The DO Loop
Want more? Visit our blog for more articles like these.
Discussion stats
  • 3 replies
  • 980 views
  • 3 likes
  • 2 in conversation