james henderson
asked on
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.
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.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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
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
ASKER
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)