BookmarkSubscribeRSS Feed
KachiM
Rhodochrosite | Level 12

Are there any issues in saving stored compiled Macro in SAS University Edition? I appreciate any help to a sample program.

7 REPLIES 7
RW9
Diamond | Level 26 RW9
Diamond | Level 26

I don't know about UE, however stored catalogs are a real pain anywhere.  The move from 32bit to 64bit really highlighted how bad compiled catalogs are in terms of portability, and code hiding.  Even if there is a very good reason to use them, I wouldn't and I don't accept catalogs as far as I can.  I suppose one other question would be why you need to use compiled catalogs in a learning environment, other than code hiding (which is really their only purpose even if bad), there is no real use for them.

KachiM
Rhodochrosite | Level 12

I wanted to use a Macro Function in different SAS sessions as if it is a SAS Function. My purpose is not to hide the code. I read that

there is a SOURCE option to  store the macro source code along with the compiled code since SAS 9.1

 

Thanks for your information.

Reeza
Super User

Well, for functions you should be using PROC FCMP instead, but then I'd probably go with the third option. 

Yes you can include the SOURCE option, but you have to remember to do so for each macro and that transferring them across systems is difficult.

RW9
Diamond | Level 26 RW9
Diamond | Level 26

If the intention is not to hide the code then use %include and save macros in a plain text file.  You can also include these plain text files in a folder and include them automatically with the sasautos option:

http://documentation.sas.com/?docsetId=mcrolref&docsetTarget=p12b2qq72dkxpsn1e19y57emerr6.htm&docset...

 

Far simpler, and easy files to work with - just try updating a catalog!

Reeza
Super User

Are you looking into this as a learning exercise (how to work with compiled macros) or are you trying to solve a problem - how to save code for future reuse? 

 

As others have mentioned, compiled macros are not a great idea. You'll find lots of questions here of people trying to get their code back out of compiled macros or issues with transferring it.

 

For SAS Studio you have a few other options that are good. 

 

1. I think you can connect to a code repository, such as GitHub 

2. Code Snippets - you can save your own code as snippets to easily access them later.

3. You can save them in a specific folder and use a %include within your autoexec to have the programs available as soon as you start SAS UE. 

 


@KachiM wrote:

Are there any issues in saving stored compiled Macro in SAS University Edition? I appreciate any help to a sample program.


 

KachiM
Rhodochrosite | Level 12

I have not saved  Macro Functions. I was trying to save it in SAS University Edition. It did not work for me. Thanks for you for showing alternatives.

 

Why not  SAS people see this question and provide an answer? 

 

Regards,

DataSp

Reeza
Super User

@KachiM wrote:

I was trying to save it in SAS University Edition. It did not work for me. 

 

 


You never stated that. How did you try and what does 'it did not work for me' mean?

 


 

Why not  SAS people see this question and provide an answer? 

 

 


This is not SAS Tech support, this is a community user forum, where SAS does monitor the questions, but their response time I believe is 24 hours if it's not answered. If you want immediate tech support, contact tech support, but you need a valid paid license for that. 

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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
  • 7 replies
  • 1231 views
  • 4 likes
  • 3 in conversation