Posted: Wed Jul 27, 2011 1:13 am Post subject: How can you sort using TALLY?
I want to read a file containing item codes and create a report containing a row for each unique item code along with the number of times it appears in the file, displayed in descending count sequence. Can I do this using TALLY? If so, how? If not, any ideas? Thanks.
With only 3k items, you could create an array within the code that contains all of the item codes (to be populated by code, not keying<g>) and a count field (initialized to zero and incremented by 1 each tme this item code is detected in the input data).
Once the input data has all been read, sort the array by count descending and generate the report you want. _________________ Have a good one
I will make a file out the existing report and use TSO to sort it.
I agree if this is a one-time requirement. If this needs to be run regularly, i'd go ahead and implement the entire needed output in the code so i didn't have to do extra editing each time it is run . . .
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum