Here's my situation.
I am creating a temp-table that will be holding data. I need to create a secondary "reference" temp-table that will hold the order which it is displayed.
I need to create this reference temp-table based on a combination of TWO sorts entered by the user. Each sort has TEN possible selections.
The long, tedious, inefficient way to do it would be this....
if xsort1 = "SomeSort" then do:
if xsort2 = "AnotherSort" then do:
for each tt-data break by field-1 by field-2:
create tt-order.
....
end.
end.
if xsort2 = "ADifferentSort" then do:
for each tt-data break by field-3 by field-4:
create tt-order.
...
end.
end.
...
end. /* if xsort1 = "SomeSort" */
else if xsort2 = "SecondSort" then do:
/*** SAME CODE AS ABOVE, REPEATED ***/
end. /* else if xsort2 = "SecondSort" */
THERE HAS GOT TO BE A BETTER WAY!!!!
Anybody have something slicker that will work in my situation?
Thanks in advance....
I am creating a temp-table that will be holding data. I need to create a secondary "reference" temp-table that will hold the order which it is displayed.
I need to create this reference temp-table based on a combination of TWO sorts entered by the user. Each sort has TEN possible selections.
The long, tedious, inefficient way to do it would be this....
if xsort1 = "SomeSort" then do:
if xsort2 = "AnotherSort" then do:
for each tt-data break by field-1 by field-2:
create tt-order.
....
end.
end.
if xsort2 = "ADifferentSort" then do:
for each tt-data break by field-3 by field-4:
create tt-order.
...
end.
end.
...
end. /* if xsort1 = "SomeSort" */
else if xsort2 = "SecondSort" then do:
/*** SAME CODE AS ABOVE, REPEATED ***/
end. /* else if xsort2 = "SecondSort" */
THERE HAS GOT TO BE A BETTER WAY!!!!
Anybody have something slicker that will work in my situation?
Thanks in advance....