|
On Thursday 12 September 2002 4:40 pm, Condon, Mike wrote: > Is there a way to delete the very first record of a physical file in a > CL program? Hi Mike If it needed to be from CL I'd use EXCSQL[1] EXCSQL SQL('delete from file where rrn(file) = 1') but only if there are no deleted records - the file might have a deleted record at RRN 1, and the first active record is at RRN 2 or higher. To handle both cases okay with slightly longer SQL you could use. EXCSQL SQL('delete from file where rrn(file) in + (select min(rrn(file)) from file)') Whether this is over the top compared to a handful of lines of RPG is debatablle ;) Regards, Martin [1] http://www.dbg400.net/excsql.html -- martin@dbg400.net jamaro@firstlinux.net http://www.dbg400.net /"\ DBG/400 - DataBase Generation utilities - AS/400 / iSeries Open \ / Source free test environment tools and others (file/spool/misc) X Debian GNU/Linux | ASCII Ribbon Campaign against HTML mail & news / \
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.