MIDRANGE dot COM Mailing List Archive



Home » MIDRANGE-L » April 2000

Re: how to add 10,000 records to new file with one field set equal to counter


  • Subject: Re: how to add 10,000 records to new file with one field set equal to counter
  • From: Rob Berendt <rob@xxxxxxxxx>
  • Date: Wed, 26 Apr 2000 8:47:48 -0500

fixed

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# &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
fielda&nbsp; </FONT>
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2 
FACE="Arial">contains</FONT>
<BR><FONT SIZE=2 FACE="Arial">1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1</FONT>
<BR><FONT SIZE=2 FACE="Arial">2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2</FONT>
<BR><FONT SIZE=2 FACE="Arial">3&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 3</FONT>
<BR><FONT SIZE=2 FACE="Arial">4&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 4</FONT>
<BR><FONT SIZE=2 FACE="Arial">5&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 5</FONT>
</P>

<P><FONT SIZE=2 FACE="Arial">etc.</FONT>
</P>
<BR>

<P><FONT SIZE=2 FACE="Arial">Can Query/400 do this?&nbsp; Can SQL do 
this?&nbsp; Or must I write an RPG pgm?</FONT>
</P>

<P><FONT SIZE=2 FACE="Arial">Thanks!</FONT>
</P>

</BODY>
</HTML>





Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2014 by MIDRANGE dot 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 here. If you have questions about this, please contact