× 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.



On 29-Jul-2016 08:48 -0500, Englander, Douglas wrote:

The program is functioning as written. The O spec has a Detail line,
and has no indicators on that line, so it will output each time.
Since there are no other fields on that record besides RCDOUT, you
are getting a blank line, because RCDOUT only appears on the line
when LR is on.

I had thought, that the LR on the definition of RCDOUT would prevent RCDOUT from being output beyond one time. In one sense, that was the effect. But I remained confounded by the blank record; I incorrectly understood that output to have been the RCDOUT being written when the value was blank-initialized, whilst LR was *not* on; what was actually written, seems undefined -- had I received an error suggesting that no fields of the record were indicated-on for output, but that the record was indicated for output, then I probably would have figured out that issue.


If you always want an output line for each input, then remove the LR
indicator on the field RCDOUT and also remove the SETON LR
calculation line. In a simple file copy program, you would want all
input to be copied to output, so let RPG manage LR for you. Because
S36INP is defined as a Primary file, RPG will turn on LR when all
records have been read from S36INP.
I would also remove the "XX" from the input spec and replace it with
a indicator. Then condition the O spec with that indicator.

Like this:

FS36INP IP F 55 DISK
FS36OUT O F 55 DISK A
E ARRY 1 3 8
I* .1....+....2....+....3....+....4....+....5....+....6....+.
IS36INP 01
I******* ^^-- the 01 is not valid here; see below
I 1 55 RCDINP
C MOVE ARRY,2 ARRY,3
C MOVE RCDINP RCDOUT 55
C* .1....+....2....+....3....+....4....+....5....+....6
OS36OUT DADD 01
O RCDOUT 55
**
COMPILE
TIME
ARRAY

Hope this helps,


Helpful. But because the "XX" is actually not the place for the indicator, instead being the sequence-is-inconsequential SEQ-spec, the 01 as indicator shown above, goes in positions 19-20 as shown below; and I change "XX" to NS to better imply No-Sequence.

I still am not entirely clear what is the general purpose of the Record ID indicator on the type=record-format line of the I-spec; possible values being any 01-99, L1-L9, H1-H9, LR, **, DS, and 01-10 specifically for CONSOLE files. I understand the effect as utilized, or I believe I do; i.e. the indicator is on, when and only when, the record from the I-spec is read, thus appropriately controlling the write which is since conditioned with the same indicator.

By an additional modification to remove the unnecessary CT Array stuff, the following revision to the above works swimmingly, to copy all rows from the input-file to the output-file; and Booth's comment to use RCDINP in place of RCDOUT would also allow eliminating the MOVE:

FS36INP IP F 55 DISK
FS36OUT O F 55 DISK A
I* .1....+....2....+....3....+....4....+....5....+....6....+.
IS36INP NS 01
I 1 55 RCDINP
C MOVE RCDINP RCDOUT 55
O* .1....+....2....+....3....+....4....+....5....+....6
OS36OUT DADD 01
O RCDOUT 55




As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

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.