Rob, You can create a UDF to return the sequence, but you MUST use an order by, which seems to defeat the purpose. If you are interested, here is an example of a UDF that will return a sequence: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/iseries-toolkit/CVSROOT/src/qrpglesrc/numseq.irp?rev=HEAD&content-type=text/vnd.viewcvs-markup David Morris >>> email@example.com 01/29/02 12:25PM >>> You cannot use an Order by in an Update statement therefore you can't UPDATE ROB/ALAN SET RANKING=0 ORDER BY BUCKS Then I can't think of any built in function which would return the number you desired. My question is this, what possible value is a ranking number when you can organize the file by any sort criteria you wish? Especially when you've already determined that the rank is based on another column. Rob Berendt
As an Amazon Associate we earn from qualifying purchases.
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.