reading a field from an os/400 journal file

Posted on 2006-05-10
Last Modified: 2010-05-18
I have a journal file called mylog with a field called joesd that contains user-defined character data on an iSeries box running OS400 V5R3.  

I am using the following command to write the journal to a physical file:

            ENTDTALEN(*VARLEN 300)                                            

If I view the output file using the wrkdbf command, the joesd field displays all the data that was written to it (however, it is just one long string of text, which is how the journal records it).  However, when I run an SQL command against it or try to view it in iSeries Navigator, the data shows up as a string of (hex?) characters (maybe in ebcdic?) like this:

Is there any way to convert this data to ascii chars on the fly with sql or another method I need to use.  All help appreciated.
Question by:dhenderson12
    LVL 26

    Accepted Solution


    The JOESD (Journal Entry-Specific Data) field is necessarily CCSID 65535. It is by definition "binary" data and cannot by translated between EBCDIC and ASCII.

    If you need to access parts of that field, there are two options.

    1. Write a program to perform CCSID (code page/character set) conversion in whatever way you choose.

    2. Don't use the default *OUTFILE format. Use one of your own that accounts for the various individual fields that make up JOESD.

    I almost invariably use the second method but have used both. The basics are found in:

    See the comments beginning at date/time 03/14/2005 03:43PM PST. The four or five comments from that point describe how you can prepare your journal output.

    If you need discussion, let me know.


    Author Comment

       Thanks for the response.  I am trying to do those things you suggested.  I will let you know how they turn out.  You win the points, but I will, no doubt, need some more discussion.  Thanks again for your help.

    Dan (dhenderson12)
    LVL 26

    Expert Comment


    The concept is simple. Create a record format that contains everything from the journal format _except_ JOESD. Add the field definitions from the journalled file in place of JOESD. When the record image is placed in the new format, the field definitions become useful.

    The record can be populated in whatever way you choose. I often use CPYF FMTOPT(*NOCHK) to force an "image" copy, But I believe you can simply output direectly from DSPJRN into a duplicate of the file that you create.

    Ask for clarification as needed.


    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    November 2009 Recently, a question came up in the DB2 forum regarding the date format in DB2 UDB for AS/400.  Apparently in UDB LUW (Linux/Unix/Windows), the date format is a system-wide setting, and is not controlled at the session level.  I'm n…
    Recursive SQL in UDB/LUW (it really isn't that hard to do) Recursive SQL is most often used to convert columns to rows or rows to columns.  A previous article described the process of converting rows to columns.  This article will build off of th…
    Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
    Here's a very brief overview of the methods PRTG Network Monitor ( offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

    733 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now