Python Forum
SAS Equivalent of Macro variable in Python
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
SAS Equivalent of Macro variable in Python
#1
I am writing code to simulate different scenarios. However, it gets cumbersome to type in the values for different scenarios. I was hoping I could use something similar to a SAS Macro variable so that I can change the values at the top and the bottom would invoke (via the macro variable) the changes

I've tried various options but no luck

/* Defining the Macro Variable */
%LET a = 10;
%LET b = 5;

/* Invoking it */
x = &a + &b
The answer is 15

thanks

PC
Reply


Messages In This Thread
SAS Equivalent of Macro variable in Python - by AI_ML_Neophyte - Jan-24-2019, 09:09 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Equivalent Python code from VBA Mishal0488 2 794 Apr-19-2024, 10:32 AM
Last Post: masonsbore
Question convert autohotkey script to python / macro - press key when pixel get colour willson94d 1 3,663 Jan-01-2022, 08:13 PM
Last Post: Yoriz
  Python C++ Template Equivalent deanhystad 7 3,413 May-04-2021, 07:45 PM
Last Post: deanhystad
  Auto-populate Macro variables Spartan314 3 2,676 Mar-08-2021, 12:36 AM
Last Post: Spartan314
  How do I reduce the time to Invoke Macro via Python? JaneTan 1 2,140 Dec-28-2020, 06:46 AM
Last Post: buran
  Hi Guys, please help me to write SAS macro parameter equivalent code in Python Manohar9589 2 2,611 Jun-14-2020, 05:07 PM
Last Post: Larz60+
  python equivalent to MATLAB xcov chai0404 2 3,889 Apr-02-2020, 10:29 PM
Last Post: chai0404
  Python equivalent of Matlab code kwokmaster 1 3,463 Mar-25-2020, 10:14 PM
Last Post: j.crater
  Equivalent of 'bwareafilt' for Python Mighty 1 3,613 Feb-05-2020, 10:32 PM
Last Post: Marbelous
  Jython macro which uses PythonInterpreter and Redis script gives an error rkanumola 2 2,257 Oct-30-2019, 07:37 AM
Last Post: rkanumola

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020