BookmarkSubscribeRSS Feed
deleted_user
Not applicable
%let a=23;
%let b=45;
%let C=89;

by using %put statement the output should be in the form mentioned below.
what is the syntax for getting this output?

ex: 23
45
89
6 REPLIES 6
LinusH
Tourmaline | Level 20
%put &A; etc.

See on-line doc for macro processing.

/Linus
Data never sleeps
deleted_user
Not applicable
%let a=23;
%let b=45;
%let C=89;

by using %put statement the output should be in the form mentioned below.
what is the syntax for getting this output?

ex: 23
45
89


and this values should store in separate data set...........and that should be done by % put statement.........so is it possible
LinusH
Tourmaline | Level 20
I don't understand your situation here.
Where are your values stored initially?
How/where would you like them to be "outputted"? In a report, another table, or in the LOG? What functionality are you aiming for?

/Linus
Data never sleeps
Cynthia_sas
SAS Super FREQ
Hi:
Although I do not understand what you want to do, one part of your question is easy to answer. %PUT only writes to the SAS log. It does not function like the DATA step PUT statement where you can write to a fileref.

As for the rest of your question, you say that you want the values of &A, &B and &C stored in a data set? Where are they coming from in the first place? Are they constants? Why do you need macro variables?

cynthia

Consider the following program:

[pre]
data examp1;
a=23;
b=45;
c=89;
d = a + b + c;
method = "Direct";
run;

ods listing;
proc print data=examp1;
title 'Examp 1 -- Using Constants';
run;

%let a = 23;
%let b = 45;
%let c = 89;
%let method = Macro;

data examp2;
fred = &a;
ethel = &b;
ricky = &c;
lucy = %eval(&a + &b + &c);
method = "&method";
run;

ods listing;
proc print data=examp2;
title2 'Examp2 -- Using Macro Variables to Substitute for Constants';
run;[/pre]
deleted_user
Not applicable
hi i will make u clear now
%let a=23;
%let b=45;
%let C=89;

so now i need the output
x
-------------
a
b
c

where x is the variable..

abd a, b and c variable names should present in single column as shown above
Patrick
Opal | Level 21
Hi sas@kumar
please keep your posts in one forum only. It's a bit annoying to answer a question only to see later on that there was already quite a discussion going on in another forum.
Cheers, Patrick

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