From: Jinto83 on
Hi, I want to define a bunch of variables:

japanpopulation=something someting
japanarea=something someting
usapopulation=something someting
usaarea=something someting

How do I loop inside two loops:
1.[japan,usa]
2.[population,area]
And define new variable names based on the cartesian product of the two arrays?

--- news://freenews.netfront.net/ - complaints: news(a)netfront.net ---
From: Reeza on
On Apr 14, 3:11 am, "Jinto83" <jint...(a)sina.com> wrote:
> Hi, I want to define a bunch of variables:
>
> japanpopulation=something someting
> japanarea=something someting
> usapopulation=something someting
> usaarea=something someting
>
> How do I loop inside two loops:
> 1.[japan,usa]
> 2.[population,area]
> And define new variable names based on the cartesian product of the two arrays?
>
> --- news://freenews.netfront.net/ - complaints: n...(a)netfront.net ---

Can you provide an example of what the data would look like and the
answer would be?
From: hewei2004 on
On Apr 14, 12:38 pm, Reeza <fkhurs...(a)hotmail.com> wrote:
> On Apr 14, 3:11 am, "Jinto83" <jint...(a)sina.com> wrote:
>
> > Hi, I want to define a bunch of variables:
>
> > japanpopulation=something someting
> > japanarea=something someting
> > usapopulation=something someting
> > usaarea=something someting
>
> > How do I loop inside two loops:
> > 1.[japan,usa]
> > 2.[population,area]
> > And define new variable names based on the cartesian product of the two arrays?
>
> > --- news://freenews.netfront.net/ - complaints: n...(a)netfront.net ---
>
> Can you provide an example of what the data would look like and the
> answer would be?

Hi,

I just want to set all of the variables into 1. But I want to save
time in typing the cartesian products of the the above 2 arrays I
mentioned.
So that the data table has four new variables :
japanpopulation=1;
japanarea=1;
usapopulation=1;
usaarea=1;

From: montura on
Interesting.
Why are you using two userID on the same posted question?

From: Reeza on
On Apr 14, 12:34 pm, hewei2004 <hewei2...(a)gmail.com> wrote:
> On Apr 14, 12:38 pm, Reeza <fkhurs...(a)hotmail.com> wrote:
>
>
>
>
>
> > On Apr 14, 3:11 am, "Jinto83" <jint...(a)sina.com> wrote:
>
> > > Hi, I want to define a bunch of variables:
>
> > > japanpopulation=something someting
> > > japanarea=something someting
> > > usapopulation=something someting
> > > usaarea=something someting
>
> > > How do I loop inside two loops:
> > > 1.[japan,usa]
> > > 2.[population,area]
> > > And define new variable names based on the cartesian product of the two arrays?
>
> > > --- news://freenews.netfront.net/ - complaints: n...(a)netfront.net ---
>
> > Can you provide an example of what the data would look like and the
> > answer would be?
>
> Hi,
>
>  I just want to set all of the variables into 1. But I want to save
> time in typing the cartesian products of the the above 2 arrays I
> mentioned.
> So that the data table has four new variables :
>  japanpopulation=1;
>  japanarea=1;
>  usapopulation=1;
>  usaarea=1;- Hide quoted text -
>
> - Show quoted text -

Sorry, still don't understand. An example of the data prior to the
calculation and after would be useful.

Or lookup the array function in SAS documentation, if you're sure an
array is what you want.