Nested loop

Moderators: statman, Analyst Techy, andris, Fierce, GerineL, Smash

Posts: 5
Joined: Wed Jul 09, 2014 1:46 pm

Nested loop

Postby buh86 » Tue Aug 19, 2014 1:54 pm


I have following variables: z a1 a2 a3 a4 etc.

I need create following variables b1=z+a1
b3=z+a1+a2+a3 etc.

I would like to automatize this using macro.

I try to write some macro like below:

define !example (arg1 = !tokens(1)
/arg2 = !tokens(1))
!do !i = !arg1 !to !arg2.
compute !concat(b,!i)=z+.................................
!example arg1=1 arg2=4.

but I do not have idea how I can impose conditions in empty place.

Thanks in advance for help,

Best regards

Who is online

Users browsing this forum: No registered users and 2 guests