Journal

pts.
Tags:
Application development
AS/400
Backup & recovery
CLP
RPG
RPGLE
How can i retrieve a record from a journal so that i can update the said record to another physical file. Because i want to retrieve the record created or updated from the journal so that i can update the other file. Thank you.

Answer Wiki

Thanks. We'll let you know when a new response is added.

I use the following command to dump the journal to a file.

DSPJRN JRN(GNDATA/QSQJRN) FILE((GNDATA/CDKUR)) +
RCVRNG(*CURCHAIN) OUTPUT(*OUTFILE) +
OUTFILFMT(*TYPE4) OUTFILE(QTEMP/CDKURJRNX)

Then I process the file.

Discuss This Question: 3  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • Pollywantsacracker
    You could also use RCVJRNE to get the journal entries and process them. You need to keep track of the last journal entry processed so that you can restart your process if needed. I've seen this process in use at another company and it worked well once they worked through the programs involved. If your files are the same...I've never tried it, but could you just use APYJRNCHG to apply the changes to different file than the host? There must be something like this that the high availability vendors are doing with the remote journals.
    0 pointsBadges:
    report
  • astradyne
    Pollywantsacracker is right, HA applications such as Data Mirror Transformation Server receive the journal entries for a file and then apply them to a "mirrored" file. I don't believe they use APYJRNCHG because they allow for data to be transformed between systems if required - e.g. changing value "1" to "Y" and "0" to "N" type of thing.
    370 pointsBadges:
    report
  • TomLiotta
    You can't use APYJRNCHG to apply journal images to a different file. Use RTVJRNE or the Retrieve Journal Entries (QjoRetrieveJournalEntries) API to retrieve entries or DSPJRN to output journal entries to an outfile. For all of them, the record images will be in the Entry-Specific Data (ESD) field. This field can be processed through a program described file or copied over a data structure that matches the record format. Records that were INSERTed can be directly processed through a program-described file. UPDATEs take a little more work -- the related record can read (for update) into a data structure, the ESD can be laid over the structure and then the record can be rewritten. The ESD must be checked first in order to know which record needs to be read. DELETEs will be processed something similar to INSERTs in that the ESD tells which record to DELETE. Tom
    125,585 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following