DATA Step, Macro, Functions and more

STORED COMPILED MACRO FACILITY in University Edition

Reply
Super Contributor
Posts: 320

STORED COMPILED MACRO FACILITY in University Edition

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

Super User
Super User
Posts: 9,193

Re: STORED COMPILED MACRO FACILITY in University Edition

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.

Super Contributor
Posts: 320

Re: STORED COMPILED MACRO FACILITY in University Edition

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.

Super User
Posts: 22,820

Re: STORED COMPILED MACRO FACILITY in University Edition

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.

Super User
Super User
Posts: 9,193

Re: STORED COMPILED MACRO FACILITY in University Edition

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!

Super User
Posts: 22,820

Re: STORED COMPILED MACRO FACILITY in University Edition

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. 

 


@datasp wrote:

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


 

Super Contributor
Posts: 320

Re: STORED COMPILED MACRO FACILITY in University Edition

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

Super User
Posts: 22,820

Re: STORED COMPILED MACRO FACILITY in University Edition


@datasp 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. 

Ask a Question
Discussion stats
  • 7 replies
  • 98 views
  • 4 likes
  • 3 in conversation