Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problems selecting data

Status
Not open for further replies.

TomBorcoman

Technical User
Apr 30, 2003
10
US
Hi there, first post for me. Below I have some sample data in a master file for employees and I would like some help with some code that will select/filter out the right data:

ID# POS# FUND PERCENT EFF.DATE
4366 Z1 20502 100 35796
4366 Z1 20502 100 36923 *
4306 Z2 20502 50 35796
4306 Z2 22018 50 35796
4306 Z2 20502 50 36192
4306 Z2 22018 50 36192
4306 Z2 20502 50 36514 *
4306 Z2 10003 50 36514 *
4307 Z3 20502 100 35796
4356 Z3 20502 100 36290
4323 Z3 20502 100 37270 *

I have a number of issues here. Ideally, I'd like to select the line(s) of code that have the highest date for a particular POS#. The PERCENT field, if not 100, needs to have more than one line produced. I have put an asterisk next to the lines I would want to keep. I hope I have been clear on this and I would really appreciate some ideas for the Focus code.

I'm thinking I need to have a complex WHERE statement in the TABLE FILE section. Thanks in advance!!
 
I think this will do it:

TABLE FILE yourfile
PRINT ID FUND PERCENT
BY POS
BY HIGHEST 1 EFFDATE
END

HTH
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top