DATA Step, Macro, Functions and more

How to call a macro from batch?

Reply
Super User
Posts: 17,826

How to call a macro from batch?

How do I call a macro from Batch?

I know how to include my macro to run but how can I call the macro and pass the parameters? This is on Windows XP, SAS 9.2.

eg macro missing_vars(libname, dset_in, dset_out)

I want to call as

missing_vars(ha_test, table2014, table2014_missing);

Thanks

Super Contributor
Posts: 333

Re: How to call a macro from batch?

If you havent go through the process of permanently storing the macro definition (see SAS(R) 9.2 Macro Language: Reference) you must have the macro definition in the program being run as batch.

Calling the macro is the same in batch or interactive SAS: %macroname(vars to pass);

EJ

Ask a Question
Discussion stats
  • 1 reply
  • 162 views
  • 0 likes
  • 2 in conversation