ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Dspjrn outfilfmt(*type3)

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Dspjrn outfilfmt(*type3)

    I need to use the DSPJRN command to dump some changes to a journaled file into an outfile and read them in an RPGLE program. I have chosen to use OUTFILFMT(*TYPE3) because it creates a 26 character timestamp field, which I need, instead of separate, smaller date and time fields offered by OUTFILFMT(*TYPE1) / OUTFILFMT(*TYPE2). I have been using ENTDTALEN(*CALC) but I noticed that the length of the JOESD field in the outfile is considerably larger than the record length of the journaled file. Example, JOESD is 875 but the record length of the journaled file is 291. Any idea why the JOESD field is larger if it contains only entry specific data. I've noticed that the field length of JOESD varies depending on how many entries are in the journal for the file I am extracting journal entries for. It appears that everything past posn 291 of JOESD is blank. This command is run over and over in a nightly job stream so I want to make sure the entry specific data is always formatted the same. Would it be safe to hard code ENTDTALEN to be the same as the record length of the journaled file.

  • #2
    I think so, though things may get odd if you have varying length columns that use the overflow area of the record.

    Or, consider using SQL table function QSYS2.Display_Journal(). This is an SQL function that wraps DSPJRN returns the results directly in an SQL select statement, that you can then directly read in an SQLRPGLE program. It returns all the full details including the full record. https://www.ibm.com/support/knowledg...layjournal.htm

    Comment

    Working...
    X