From: Joe Whitehurst on
I second that emotion!

On Mon, Feb 22, 2010 at 9:11 AM, montura <monturainc(a)gmail.com> wrote:

> You are attempting to use Base/SAS for programming that is really the
> domain of SCL.
>
> This is simple transaction-style processing where the data can be
> loaded into a LIST in ENVLIST, which is a session resource.
> Data can be accessed across data steps and procedures until SAS
> terminates.
>
> You can stick with Base/SAS but the macro generation and updates will
> cause non-stop fumbles, especially in a few months when the specs
> change or you discover tghat you miss a condition.
>
> Learn SCL.
>
From: Tom Abernathy on
What are you trying to do?
If you are trying to use the ARRAY statement then you syntax is way
off.

If instead you have done a previous ARRAY statement and preversely
used the name 'arrray' as the name of your array then perhaps your
issue is trying to use a datastep variable to index the array and an
macro variable to generate the version of the LAG function that you
want to use.

Again (maybe the third time is the charm?) what are you trying to do?
If you explain what you are trying to do then perhaps someone can
suggest how to do it with SAS.

On Feb 23, 4:07 am, kuh...(a)126.COM (Clark An) wrote:
> I get a problem....
>
> in the do loop data step....
>
> array(n)=lag&n.(x);
>
> any ideas?Thank you very much!

From: Clark An on
Thank you:)
From: Clark An on
1.e.g.

Thank you for the solution.

data mat2345;
array x[2,3,4,5] x1-x120;
retain n 0;
do i=1 to 2;
do j=1 to 3;
do k=1 to 4;
do l=1 to 5;
n+1;
...
x[i,j,k,l]=lag&n.(n);
output;
end;
end;
end;
end;
run;

If array can help me identify a variable easily,then how to treat lag
function with macro variable?

2.What I want to do/get:
1)generate a series of variables.
2)put the value of a variable to macro varibles which can be used in new
created varible's name.
3)lag&n.(x) in a loop without %do loop
From: Clark An on
I think you are better of learning what the lag&i.(x) means...
Data step Do loop to change the value of Macro Variable as the topic
mentioned, I wanna instead the %do loop with data step do loop.

Thank you.