× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



For anyone interested this works for me now.

-- Drop the table used to receive journal output
drop TABLE qtemp.JRN_XX;

-- Retrieve the journal data required
-- Cast the variable length fields returned to make them fixed length
create table qtemp.jrn_xx as (

Select x.entry_timestamp,
x.journal_entry_type,
cast(x.Job_NAme as char(10)) as JobName,
cast(x.Job_USer as char(10)) as JobUser,
cast(x.Job_number as char(6)) as JobNumber,
cast(x.Program_Name as char(10)) as Program,
cast(x.Entry_data as char(56)) as entry_data
-- x.*
FROM TABLE (QSYS2.Display_Journal('JRN', 'JRN',

-- JOURNAL_CODES => 'D,F,R',
JOURNAL_CODES => 'R',
STARTING_RECEIVER_NAME => '*CURCHAIN' )) as x
) with data;

-- View journal data retrieved
Select * from qtemp.jrn_xx ;

-- Delete the work table
drop table qtemp.jrn_work5;

-- Create table to show formatted journal data
create table qtemp.JRN_WORK5 as
(select x.entry_timestamp,
x.journal_entry_type,
cast(x.JobName as char(10)) as JobName,
cast(x.JobUser as char(10)) as JobUser,
cast(x.JobNumber as char(6)) as JobNumber,
cast(x.Program as char(10)) as Program, a2.*

from qtemp.JRN_XX x , mcsdta.MCSDOAPF a2 )

with NO data;

-- Copy the journal data to the table
CL: cpyf qtemp/JRN_xx qtemp/JRN_WORK5 mbropt(*replace) fmtopt(*NOCHK) ;

-- View the data
Select * from qtemp.jrn_work5 ; -- add selection criteria such as where
program = 'program';

-- ===========================================================




Don





From: "Joe Pluta" <joepluta@xxxxxxxxxxxxxxxxx>
To: midrange-l@xxxxxxxxxxxxxxxxxx
Date: 17/11/2020 12:40 AM
Subject: Re: QSYS2.Display_Journal inserts x'000A' between some
fields ?
Sent by: "MIDRANGE-L" <midrange-l-bounces@xxxxxxxxxxxxxxxxxx>



It looks to me like those are lengths, and that you're somehow getting
VARCHAR results.

On 11/16/2020 12:19 AM, Don Brown via MIDRANGE-L wrote:
The system is on 7.3 and a little behind on ptf's


I am trying to use a method that I think Rob Berendt provided some time
back.

I run the following which produces the file.

create table test_lib.jrn_xx as (

Select x.entry_timestamp, x.journal_entry_type, x.Job_NAme,
x.Job_USer, x.Job_number, x.Program_Name, CAST(x.Entry_data as
char(1000))
as entry_data

FROM TABLE (QSYS2.Display_Journal('JRN', 'JRN',
JOURNAL_CODES => 'D,F,R',
STARTING_RECEIVER_NAME => '*CURCHAIN' )) as x
) with data;

My problem is that between some of the fields x'000A' is inserted - I
have
highlighted the position with the ?? below.

2020-11-16-14.04.01.906560JF QPADEV001W USER01 383701 PGM994C
000

FFFF6FF6FF6FF4FF4FF4FFFFFFDC00DDCCCEFFFE00DECCCC444400FFFFFF00DDEFFFC444FFF

2020011016014B04B01B906560160A87145500160A4244320000063837010A4549943000000
?? ?? ??


So we get this;

entry_timestamp
journal_entry_typ
x'000A'
Job_NAme
x'000A'
Job_USer
x'0006'
Job_number
x'000A'
Program_Name
entry_data

Why am I getting these hex values between fields ?

Thanks for any suggestions.

Don

--
This email has been scanned for computer viruses. Although MSD has taken
reasonable precautions to ensure no viruses are present in this email, MSD
cannot accept responsibility for any loss or damage arising from the use
of this email or attachments..



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.