arrays - Checking correct order of values -


I have a data set that looks like the bottom. Actually, I have current prices for three different sizes of an item type. If the size is correctly priced (i.e. small and lieutenant; big & lt; big ), I will call them "y" I want to mark and continue to use the current price if they do not have the right value, then I want to mark them with "n" and want to use the recommended price. I know that this is probably the time to use array programming, but my strength skills, of course, are a little weak. There are hundreds of places, but there is only one item type. Currently unique locations are loaded in the macro variable list.

  is the data; Input type space $ size $ cur_price rec_price; Leaves; X NYS 4 1 x NY M5 2 x NY L 6 3 x LA S 5 1 x LA M4 2 x LL3 3 x DC S5 1 x DC M5 2 x DC L5 3; Run; Proc sql; Select different location in: is loc_list; leave;  

Any help would be greatly appreciated.

Thanks

Not sure why you want to use an array here ... proc movements and some data phase logic can easily solve this problem arrays are very useful (I should know, I'm not completely resting with them), but in a situation where your There are many places nearby, I think the transition is better.

Did your goal in the code below be fulfilled?

  / * To be ready for the transition * / proc sort data is =; From the place; Run; / * Move the current value * / proc moved data = is out = cur_tran prefix = cur_price; From the place; Size of ID; Var cur_price; Run; / * Transfer price recommended * / proc transferred data = out = rec_tran prefix = rec_price; From the place; Size of ID; Var rec_price; Run; / * Merge back together * / merge data; Merge cur_tran rec_tran; From the place; Run; / * Creates flags and new grounds for the final price * / data want; Merge set; If cur_priceS & lt; Cur_priceM & lt; Cur_price l so do; Flag = 'y'; Prices = cur_priceS; PriceM = cur_priceM; PriceL = cur_priceL; End; Do more; Flag = 'n'; Prices = rec_priceS; PriceM = rec_priceM; PriceL = rec_priceL; End; Run;  

Comments

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -