× 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.



I'm trying to do something using Query/400 (QU1) that I thought would take a couple of seconds and it has turned into several hours with no luck!

The QAUDJRN ZC data puts out a string of data that contains Character and Packed Numeric's

Column 1 - 31 is all CHARACTER DATA ... Column 32-34 is a Packed Numeric (Dec 5 0)

Code . . . . . . . . : T - Audit trail entry
Type . . . . . . . . : ZC - Object change access

Entry specific data
Column *...+....1....+....2....+....3....+....4....+....5
00001 'CPOWER520 QSYS *LIB " '

Same Data Displayed in HEX ...

Code . . . . . . . . : T - Audit trail entry
Type . . . . . . . . : ZC - Object change access

Entry specific data
Column * . . . + . . . . 1 . . . . + . . . . 2 . . . . +
00001 'C3D7D6E6C5D9F5F2F04040D8E2E8E24040404040405CD3C9C2'
00026 '4040404000007F404040404040404040404040404040404040'

You can see that the value I'm after in this example is 00007

I'm trying to create a Query Report showing the data in Column 32-34 ...

But I can't figure out how to change this Packed Numeric data into a Character that can be displayed on my report.

The data I'm trying to process is a substring of field AUDATA ... (AUDATA, 32, 3) to be exact... I realize the AUDATA field is defined as CHAR with a length of 1000 ... This field contains the character data and this bit of packed Data .... I imagine this is the root of my problem.

The DB file I'm running my queries over is defined like this:

Field Level Information

Data Field Buffer Buffer Field Column
Field Type Length Length Position Usage Heading

AUCODE CHAR 1 1 1 Both Jrnl
code

Field text . . . . . . . . . . . . . . . : Jrnl code
Coded Character Set Identifier . . . . . : 37
AUENTT CHAR 2 2 2 Both Jrnl
entry
type
Field text . . . . . . . . . . . . . . . : Jrnl entry type
Coded Character Set Identifier . . . . . : 37
AUSUBT CHAR 1 1 4 Both Jrnl
sub
type
Field text . . . . . . . . . . . . . . . : Jrnl sub type
Coded Character Set Identifier . . . . . : 37
AUUSPF CHAR 10 10 5 Both User
causing
entry
Field text . . . . . . . . . . . . . . . : User causing entry
Coded Character Set Identifier . . . . . : 37
AUJOB CHAR 10 10 15 Both Job
Field text . . . . . . . . . . . . . . . : Job
Coded Character Set Identifier . . . . . : 37
AUUSER CHAR 10 10 25 Both User
of
job
Field text . . . . . . . . . . . . . . . : User of job
Coded Character Set Identifier . . . . . : 37
AUJOBN CHAR 6 6 35 Both Job
number

Field text . . . . . . . . . . . . . . . : Job number
Coded Character Set Identifier . . . . . : 37
AUDATE CHAR 7 7 41 Both Entry
date
CYMD
Field text . . . . . . . . . . . . . . . : Entry date CYMD
Coded Character Set Identifier . . . . . : 37
AUTIME CHAR 6 6 48 Both Entry
time

Field text . . . . . . . . . . . . . . . : Entry time
Coded Character Set Identifier . . . . . : 37
AUSYSN CHAR 8 8 54 Both System
name

Field text . . . . . . . . . . . . . . . : System name
Coded Character Set Identifier . . . . . : 37
AUSEQN PACKED 10 0 6 62 Both Jrnl
seq
nbr
Field text . . . . . . . . . . . . . . . : Jrnl seq nbr
AUENTL PACKED 5 0 3 68 Both Entry
length

Field text . . . . . . . . . . . . . . . : Entry length
AUPGM CHAR 10 10 71 Both Program
causing
entry
Field text . . . . . . . . . . . . . . . : Program causing entry
Coded Character Set Identifier . . . . . : 37
AUOBJ CHAR 10 10 81 Both Object
entry
is for
Field text . . . . . . . . . . . . . . . : Object entry is for
Coded Character Set Identifier . . . . . : 37
AULIB CHAR 10 10 91 Both Obj/Lib
entry
is for
Field text . . . . . . . . . . . . . . . : Obj/Lib entry is for
Coded Character Set Identifier . . . . . : 37
AUMBR CHAR 10 10 101 Both File/mbr
entry
is for
Field text . . . . . . . . . . . . . . . : File/mbr entry is for
Coded Character Set Identifier . . . . . : 37
AUDATA CHAR 1000 1000 111 Both Entry data
Field text . . . . . . . . . . . . . . . : Entry data
Coded Character Set Identifier . . . . . : 37

Anyone have a tip that can help me out?

I have already tried this - TYPE SUBSTR(AUDATA, 32, 3)
CHARTYPE DIGITS(TYPE)

... that didn't work ...

P
Please consider the environment before printing this email

Kenneth
Kenneth E. Graap
Systems Administrator
NW Natural
keg@xxxxxxxxxxxxx<mailto:keg@xxxxxxxxxxxxx>
http://www.linkedin.com/in/kennethgraap
503-226-4211 x5537


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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.