BookmarkSubscribeRSS Feed
JoeyFerkull
Calcite | Level 5

Hello,

 

I have been using a custom macro in SAS Studio 9.4 for about a year and a half without errors. The macro is pretty much a shell for all my projects and gets copied to a new folder per each new project. I have never had any general SAS errors or issues until this message started popping up:

JoeyFerkull_0-1752265471867.png

Lately, whenever I copy said program to a new folder and click Run, I am immediately provided this message. It is its own pop-up box and the program itself does not actually run at all (no log output or anything). I thought this error might be related to the path being too long but I tried much shorter paths and that doesn't help. I can still use and run the 'shell' of this program/macro in its original folder fine, and this message does not happen with older projects I try to rerun. This message also seems to encompass clicking run on any part of the program (not a specific data step or %let step or anything).

 

Does anybody have any troubleshooting tips with this? I have been trying to look around myself but the error seems so general that it is hard to find any info. Thank you!

 

6 REPLIES 6
ballardw
Super User

I would start by comparing the path of the last successful run and the first failure. look for something that might be a capital letter that doesn't appear as such on your screen such as a capital i   ( I ) that might be visually similar to a lowercase L ( l ).

 

One question might also be why are you copy/pasting a macro at all? A proper reusable macro should have parameters to tell it where to find things and should not rely at all an the location of the macro program code.

JoeyFerkull
Calcite | Level 5

I have a 'backend' and 'frontend' file for each project. The macro is in the backend program, and then the frontend file uses %include to include the  macro and then I call it. I do it this way since there are often bespoke requirements per each project and the output from the macro can then be edited in the frontend file if needed. I did initially keep the backend file alone and in the same spot, but it temporarily gets updated and this would mess up older projects that should be reproducible at any point. Does that make sense?

Tom
Super User Tom
Super User

I would suspect that something in that code makes it impossible for SAS/Studio process that controls the user interface from coordinating with the SAS session that runs the submitted code.

 

I would suggest deleting or commenting out parts of the code until you find the part that causes the issue.

JoeyFerkull
Calcite | Level 5

Thank you for the suggestion! I agree it does seem to be something weird with the user interface. I did try commenting out parts of the code one at a time and also all at once, but I still get the same error. Even if I comment out the whole code and add a simple data step, I still get the error when I click run. It is like the whole file gets 'corrupted' when this happens.

Quentin
Super User

And it's only this one file that has the problem? 

 

You might try opening the file in a text editor that will show non-printable characters, and see if there's anything odd in the file.  Or I suppose could be a problem with the encoding of the file.  If you open a text file on Windows, I think some editors will add a BOM.

 

Since you know the problem is not in the SAS code, did you try copying the macro definition into a new program?  If it's a problem with the file itself, that should avoid the problem.

JoeyFerkull
Calcite | Level 5

I tried copying the entire macro definition into a new program and it still gave the same error. However, I copied the code AGAIN from that new file into an even newer file and the error is no longer there! My issue is solved, thank you.

 

Is it possible to 'copy to' a program so much that it gets corrupted somehow? 

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

How to Concatenate Values

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.

SAS Training: Just a Click Away

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

Browse our catalog!

Discussion stats
  • 6 replies
  • 566 views
  • 0 likes
  • 4 in conversation