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

I'm not entirely sure why you're code isn't trapping those errors but I would strongly recommend fixing the SAS code outside of an IOM call anyway. When calling SAS from another language I always use a test harness which attempts to emulate the call from within SAS as it's much easier to resolve issues.

 

In your case I think the "Format Couldn't be Loaded" error is caused by a missing FMTSEARCH option telling SAS where to look for the stored custom format and if you add that to your SAS program you should resolve that issue. The "Open Code Statement Recursion" error is impossible to give advice on without seeing the SAS code as it could be caused by a multiplicity of issues.

Petr_D
Calcite | Level 5

Hello,

thanks for quick reply. I am using SAS Enterprise Guide (SAS EG) to debug the code. The problem is same (error free) code when run in SAS EG generates errors when run in VBA.

E. g. Format Couldn't be Loaded error in Visual Basic error log  and vice versa: Open code statement recursion detected - not being indicated in VBA error log.

Open code statement recursion detected error is deliberate for testing purposes driven by missing apostrophe in prxmatch expression.

I tried to use options nosource nonotes to reduce log extent in VBA but again it works in SAS EG only.

Petr

ChrisHemedinger
Community Manager

You might need to add options nofmterr to your code to prevent errors when a SAS format can't be found.  EG submits that statement automatically.

SAS For Dummies 3rd Edition! Check out the new edition, covering SAS 9.4, SAS Viya, and all of the modern ways to use SAS!

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

Creating Custom Steps in SAS Studio

Check out this tutorial series to learn how to build your own steps in SAS Studio.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 17 replies
  • 21432 views
  • 0 likes
  • 5 in conversation