BookmarkSubscribeRSS Feed
rawindar
Calcite | Level 5

Hi all,

       Is there any other way to create MACRO VARIABLES except %let and callsymput.This is an interview question.

Thanks&Regards

Rawindarreddy

4 REPLIES 4
manojinpec
Obsidian | Level 7


you can create using proc sql and also when you create a macro program parameters are automatically macro variables.

shivas
Pyrite | Level 9

Hi,

%local %global :into(proc sql);

Thanks,

Shiva

kuridisanjeev
Quartz | Level 8

Hi...

we can create macro variables in many ways.

  1. %let
  2. call symput
  3. into(proc sql)
  4. macro(while passing parameters into the macro ,that parameters are acts  as local macro variables)

and if you use %do statements in with in the macro,

for example %macro test;

                   %do i=1 %to 10;

                     ..........

                     ...........

                    %end;

in that example "i" also become a local macro variable.

and I don't think that  we can create macro variables directly by using %local and %global statements.

generally we use % local and %global statement before %let statement to specify weather the macro variable become local or global.

Thanks

Sanjeev K

FloydNevseta
Pyrite | Level 9

That's not entirely correct. %local and %global create macro variables with null values. Even without assigning a value to them with %let, you can reference them without error.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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.

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
  • 4 replies
  • 879 views
  • 0 likes
  • 5 in conversation