reading a field from an os/400 journal file

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.
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.


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.


Experts Exchange Solution brought to you by ConnectWise

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
dhenderson12Author Commented:
   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)

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.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.