Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1746
  • Last Modified:

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:

DSPJRN JRN(DEMOLIB/MYLOG)
            OUTPUT(*OUTFILE)
            OUTFILFMT(*TYPE4)
            OUTFILE(DEMOLIB/LOGOUTPUT)
            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:
F0F2H1F6D7C1.......

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.
0
dhenderson12
Asked:
dhenderson12
  • 2
1 Solution
 
tliottaCommented:
dhenderson12:

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:

   http://www.experts-exchange.com/Q_21347686.html

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.

Tom
0
 
dhenderson12Author Commented:
Tom,
   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)
0
 
tliottaCommented:
Dan:

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.

Tom
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now