× 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 03:16 -0500, Kevin Passey wrote:
On 29-Jul-2016 03:13 -0500, Kevin Passey wrote:
I would use a record Id on the input record and put that on the
output header.

Don't condition detail output on LR

The program will then copy what ever is in the input file in your
example.

I would re-write this for you today but I have a tee time quite
soon. If you don't get it done over the weekend I will address it
Monday for you - it's a very simple 36 program.

Also if you are using the cycle you don't need to seton LR


:-) Need vs desire. I thought that my use of LR was going to limit my output to just one row, per having ended the cycle prematurely; i.e. my desire was to end the cycle with LR=*ON.

As noted in another reply, after adding the LR conditioning to the type=Detail-record of the O-spec [whereas originally the LR was coded only on type=field of the O-spec], _then_ I got the results desired; i.e. the one row being read, then written [copied], and the cycle terminating. The effect from that change, that I was no longer accidentally writing a blank [heading] record; that since, only the RCDOUT data that I intended to be written, was getting written.

The change of course could have been to move the LR from the field to the record [vs adding the LR to the record]. The following source shows that change made to the source found in the OP [to move the LR from field to record, while also removing all CT Array stuff], which performs as I desire [irrespective what might be proper coding :-)]:

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

You are welcome to provide a more conventionally or otherwise more appropriately coded simple example RPG36 program source for writing a record to an output file.

I am sufficiently satisfied however, with the above for the "1) insert" portion of this topic.

I will need to move on the "2) update" of this topic.


As an Amazon Associate we earn from qualifying purchases.

This thread ...

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.