BookmarkSubscribeRSS Feed
gauravkodmalwar
Calcite | Level 5

Hi all,

I am new to SAS world and wanted to know, how to run one SAS code file by calling it from another SAS code file. None of them are macro. I know one option is by %INCLUDE but wanted to see some better option where I can also pass on some variable values to called SAS file.

Thanks,

Gaurav

2 REPLIES 2
Kurt_Bremser
Super User

%include is the method to use, and values for parametrization can be passed as macro variables. Macro variables are also the method how parameters are fed to stored processes.

RW9
Diamond | Level 26 RW9
Diamond | Level 26

Could you clarify the part about " better option where I can also pass on some variable values to called SAS file ".  The reason I ask is that SAS code files are text files.  Now in the additional step of the macro pre-processesor, all %include statements are replaced by the text found in the respective file.  Therefore it is the full text which is sent to the compiler, there are no "parameters" created/passed.  So please describe a bit more what your attempting to do.

%include is the best method to include other programs, though a cursory mention should be given to reading a file in an infile and then generating code from it.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 2905 views
  • 0 likes
  • 3 in conversation