LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (October 2005, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Sat, 15 Oct 2005 09:18:42 -0400
Reply-To:   SUBSCRIBE SAS-L Anonymous <randistan69@HOTMAIL.COM>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   SUBSCRIBE SAS-L Anonymous <randistan69@HOTMAIL.COM>
Subject:   Iteration and Looping

Dear All: I made a mess of the post under Array and Do Loop. Let me start over again and post my question in a simple way. The basic issue is of looping:

Here is an example:

A B C 5000 6000 7000 10000 4000 9000 7000 12000 I want to construct a variable Z. If B > A then the formula is Z = C-B/A But if B < A then the formula to be applied is Z = (C-B/A)+.5((A-B)/A) Thus the output should be: A B C Z 5000 6000 7000 0.2 5000 4000 9000 1.1 5000 7000 12000 1.0 10000 6000 7000 0.3 10000 4000 9000 0.8 10000 7000 12000 0.65

The problem I am having is looping the program back to iterate over all the values of A for all the values of B (and C).


Back to: Top of message | Previous page | Main SAS-L page