We have a team who are running their code with parallel execution in EGuide 7.15. 9 times out of 10 their code works perfectly. The other time they are getting an error when the background SAS wrapper code, which executes before their own code, tries to create the temporary _PRODSAVAIL data. They are getting a 'statement is not valid or it is used out of context' error which usually means there is some sort of syntax error.
It doesn't seem to affect the results of their own code.
Does anyone know of a way to prevent this error appearing or to stop the background wrapper code being run?
Excerpt from the SAS log. The user's own code starts after this and runs ok.
504 data _prodsavail;
ERROR 180-322: Statement is not valid or it is used out of proper order.
505 length name $ 8 fullname $ 30 prodcode $ 10 prodmod $ 10 installed $ 12;
ERROR 180-322: Statement is not valid or it is used out of proper order.
506 input fullname 1-30 name 32-39 prodcode prodmod;
ERROR 180-322: Statement is not valid or it is used out of proper order.
507 licensed=sysprod(prodcode);
ERROR 180-322: Statement is not valid or it is used out of proper order.
508 installed = tslvl(prodmod%GetTslvlParam2);
ERROR 180-322: Statement is not valid or it is used out of proper order.
509 cards;
ERROR 180-322: Statement is not valid or it is used out of proper order.
510 Base BASE prodnum0 sasmeans
ERROR 180-322: Statement is not valid or it is used out of proper order.
511 SAS/STAT STAT stat sasglm
512 SAS/GRAPH GRAPH graph sasgchar
513 SAS/GIS GIS prodnum28 sasgis
514 SAS/ETS ETS ets sasarima
515 SAS/QC QC qc sascapab
516 SAS/CONNECT CONNECT prodnum15 saszrlnk
517 SAS/ACCESS PC Files ACCPC prodnum208 sasdbf
518 ;
To prevent the background wrapper code from appearing in the log you can go to top menu
Tools - Options - Results - General - uncheck "Show generated wrapper code in log". This will not correct the error, but will only prevent Enterprise Guide wrapper code from appearing in the log.
To prevent the background wrapper code from appearing in the log you can go to top menu
Tools - Options - Results - General - uncheck "Show generated wrapper code in log". This will not correct the error, but will only prevent Enterprise Guide wrapper code from appearing in the log.
Thanks for your suggestion - my user tried and this helped.
In the meantime I also raised the issue with SAS Technical Support and they came back with this response - looks like the problem will be fixed when we finish migrating everyone to EGuide 8.3.
Hi Valerie,
Thank you for your email regarding the error you are seeing with SAS EG :
504 data _prodsavail;
___________
180
ERROR 180-322: Statement is not valid or it is used out of proper order
I've done some checking into this error and it seems that there is no way to prevent this code from running when EG starts up, but on the plus side you can just ignore the error message.
The problem is occurring because there is an issue with the way that the SAS EG parallel sessions disconnect from the server when run as a Parallel execution.
An official Defect is in place for this issue and it has been fixed in SAS EG 8.x1 onwards, but unfortunately there are no plans to fix this in SAS EG 7.x versions.
There is a suggested Work around that you may find helpful . In SAS EG -> Project -> Properties -> Code Submission '
Ensure that "Allow parallel execution on same server " is deselected.
This should minimise the potential for the error to appear.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.
Ready to level-up your skills? Choose your own adventure.