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



If you only want to write one record, I think replacing the DADD on the output line by TADD would do the trick. (replacing Detail time for Total time)

If you just want the functionality, I would go for EXCPT-output, much easier to code, much easier to read(unless you would have been a very old fashioned RPGII-cycle programmer :-)

Regards,
Leo

-----Oorspronkelijk bericht-----
Van: "CRPence" <crpbottle@xxxxxxxxx>
Verzonden: ‎29-‎7-‎2016 02:57
Aan: "rpg400-l@xxxxxxxxxxxx" <rpg400-l@xxxxxxxxxxxx>
Onderwerp: RPG36 with OCL examples desired; 1) insert-a-record 2) update-that-record

I will include what I have attempted already, for reference; many
would find the Subject request to be improper, without showing some
prior effort. But any fully-functional but simple example-sources would
be welcome, as there is no specific reason the following code would need
to be /corrected/.

The following OCL performs a setup for a RPG36 that will be called.
A file S36OUT is created, into which the row should be output\written.
Another file is created too, file S36INP, for possible use to obtain as
data in the program via a read, so that same data can be written to the
S36OUT; note however, that I really do not care if the data written is a
literal or that row data.

// FLIB QS36F,LIBL
// DLTF QS36F/S36INP
// DLTF QS36F/S36OUT
// CRTPF QS36F/S36INP RCDLEN(55)
// CRTPF QS36F/S36OUT RCDLEN(55)
// CPYF QIWS/QCUSTCDT QS36F/S36INP FMTOPT(*NOCHK) +
MBROPT(*REPLACE) NBRRCDS(1)
// LOAD INSS36
// FILE NAME-S36INP,DISP-OLD,LABEL-S36INP
// FILE NAME-S36OUT,DISP-OLD,LABEL-S36OUT
// RUN

Having tried to mimic [a poor excuse for] an example from the docs
showing some declarative that would enable copying data from one file to
another, I culled that example, and combined that with the QPROOF source
shipped in QS36SRC of #LIBRARY. I then created my program as
*CURLIB/INSS36 from the source member of the same name, but from file
QRPGSRC instead of QS36SRC from following source, compiled with a
request to:

CRTS36RPG *CURLIB/INSS36 SRCFILE(QRPGSRC) SRCMBR(INSS36)
OPTION(*SOURCE *SECLVL) GENOPT(*LIST) REPLACE(*YES)


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


After invoking the program as loaded\run by the OCL, my output file
S36OUT has a blank record, followed by the expected record. Statement
trace seems to show the write at '.DRVFW02' occurring twice, but I have
almost no idea why, though possibly something to do with non-detail
record output -- I am really quite RPGII illiterate.

If I can finally get a sensible insert, then I want to get an update;
I have not even begun to delve into that.


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.