× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



You can't go back up on lines using O specs.

If you read your file C at the same time you read your
file B then that should work for you.

In one instance on another system I had a similar type of
difficulty, where I didn't know what needed to print on
what line 'til I had read through the entire file.  What
I did in that instance is I created a 66 element array
and built the page in the array then when I was done with
the page I for...nexted through the array and printed the
lines.

You don't want to do this if you can help it though, you
are much better served, I think, if you change your program
logic to incorporate you new file.

Regards,

Jim Langston

-----Original Message-----
From: Buck Calabro [mailto:Buck.Calabro@commsoft.net]
Sent: Wednesday, November 07, 2001 9:16 AM
To: 'rpg400-l@midrange.com'
Subject: RE: Line count?


>I read File A and print all records, with each record on
>a different line. Within this read loop, I read File B
>(File B may have one or more records
>matching with File A).
>
>Assume I print the first record from File A on Line 1.
>
>Then I read File B, find 3 records. Each record must
>be printed on a different line.
>
>In order to print these records from Line 1, I specify
>0 spaces before new line is printed in the O-specs.
>This serves my purpose and I get the first record from
>File B on Line 1. then I go ahead and print the other
>2 records from File B on Lines 2 & 3 respectively.
>
>BUT now there is another File C which also may
>have one or more records matching File A. These
>records also must be printed from Line 1. Because
>I have already printed records from File B, I have
>reached Line number 3.
>
>How do I get back to Line 1. and start printing
>data from File C?

Several ideas:
1) Switch to DDS and use the POSITION keyword.
2) Matching record
3) Build the entire page (or section) in an array
4) Go back to the user and simplify the output
5) Use SQL/OPNQRYF to join the records
6) Give the data to the user in PC or HTML form and let them format it

I you get some ideas from this list that might work for you.
  --buck


As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 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.