BookmarkSubscribeRSS Feed
deleted_user
Not applicable
Is it possible to compile the sas code separately and execute it at later time?

we usually running the sas code in this stage, itself the code gets complied and executed we gets the output if the code is correct. instead of that compile the code separately and excute that compiled code lately is it possibe?
2 REPLIES 2
Cynthia_sas
SAS Super FREQ
Hi:
SAS code does not compile into a traditional "load" module (like a COBOL program -- where you compile the code and then call the load module). There are several ways to store SAS code so it can be compiled and/or executed at a later time:


1) Macro programs
Putting your code in a macro program can work in different ways to delay the compile phase, depending on whether you use session-compiled macros, autocall macros or stored compiled macro programs
http://support.sas.com/documentation/cdl/en/mcrolref/59526/HTML/default/a002062214.htm

2) Stored Compiled DATA step programs:
http://support.sas.com/documentation/cdl/en/lrcon/59522/HTML/default/a000988945.htm

3) Using SAS Stored Processes (within the context of the SAS Enterprise Intelligence Platform)
A SAS Stored Process runs within a very specific configuration on a special kind of SAS server, but the fundamental concept is that you store code in a special repository and the code will be compiled and executed when needed, based on the kind of code you submitted.

4) EG projects -- although an EG project is a collection of tasks, there is code underlying those tasks. Once the project has been developed and the code resides in an EG project, then the code in the project can be re-executed, without user intervention or additional development -- if that is the model you choose. Or the project can be changed and rerun.

As I said in the beginning, the kind of SAS programs that most people run fall into the "compile and go" category of code -- where the code is compiled before it executes. You can delay this process using the techniques above. In addition, if you are working on z/OS (the mainframe), there is a SAS/C Compiler and a SAS/C++ development system for the mainframe:
http://www.sas.com/products/sasc/index.html
http://www.sas.com/products/sasc/cplusdev.html

Depending on what you want to do it may be that SAS Macro processing is the place to start. There are many good books on how SAS Macro programs work and the macro documentation is excellent. You can also consult with Tech Support for more help figuring out the best method to achieve your task.

cynthia
deleted_user
Not applicable
Simple answer = yes.

Should you?
Probably not.

SAS code can be pre-compiled and stored within the SAS system.

There is an advantage to this only if you have a sophisticated application written in SAS where the performance/throughput/response_time is critical and it really would help to eliminate compile time overhead. Otherwise, stored pre-compiled modules buys you little to no advantage.

Also, the use of macros can cause you to not have the results that you think you will get.

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!

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
  • 2 replies
  • 3378 views
  • 0 likes
  • 2 in conversation