|
You might want to use the RRN (Relative Record Number) as others have suggested. However if the file may have records deleted and then a RGZPFM done then you may want to use a counter as you suggest. I don't feel that a trigger is the best way to initialize the file. If you're going to write a trigger couldn't you do it easier with the following RPG pseudocode without a trigger? Don't get me wrong, I like triggers and all. It's just the wrong tool for this job. 1 do 10000 COUNTER write record ENDDO eval *inlr=*on return StoneJ@GourmetAward.com on 04/25/2000 12:28:29 PM Please respond to MIDRANGE-L@midrange.com@Internet To: MIDRANGE-L@midrange.com@Internet cc: Fax to: Subject: how to add 10,000 records to new file with one field set equal to counter Is there a simple way to add 10,000 records to a new file such that one field in the record is a counter as follows: record# fielda contains 1 1 2 2 3 3 4 4 5 5 etc. Can Query/400 do this? Can SQL do this? Or must I write an RPG pgm? Thanks!
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN"> <HTML> <HEAD> <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1"> <META NAME="Generator" CONTENT="MS Exchange Server version 5.5.2650.12"> <TITLE>how to add 10,000 records to new file with one field set equal to counter</TITLE> </HEAD> <BODY> <P><FONT SIZE=2 FACE="Arial">Is there a simple way to add 10,000 records to a new file such that one field in the record is a counter as follows:</FONT> </P> <P><FONT SIZE=2 FACE="Arial">record# fielda </FONT> <BR> <FONT SIZE=2 FACE="Arial">contains</FONT> <BR><FONT SIZE=2 FACE="Arial">1 1</FONT> <BR><FONT SIZE=2 FACE="Arial">2 2</FONT> <BR><FONT SIZE=2 FACE="Arial">3 3</FONT> <BR><FONT SIZE=2 FACE="Arial">4 4</FONT> <BR><FONT SIZE=2 FACE="Arial">5 5</FONT> </P> <P><FONT SIZE=2 FACE="Arial">etc.</FONT> </P> <BR> <P><FONT SIZE=2 FACE="Arial">Can Query/400 do this? Can SQL do this? Or must I write an RPG pgm?</FONT> </P> <P><FONT SIZE=2 FACE="Arial">Thanks!</FONT> </P> </BODY> </HTML>
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.