AS/400 >> How do set Journal for all tables in a Library?

by pveerasekar » Wed, 25 Apr 2007 16:11:10 GMT

Dear all,

I am a beginner of AS/400. I have some doubts in the
journaling. I would like to do transaction replication between AS400
and SQLServer.
I tried to made a journal for a single table in iSeries. It is
successful. But I need to do all tables in the library. I dont know
the exact command for journaling all tables.
If anybody have a solution, Please share with me.

Thanking you,

Veera


AS/400 >> How do set Journal for all tables in a Library?

by pwrdwn » Fri, 27 Apr 2007 09:57:13 GMT


AS/400 >> How do set Journal for all tables in a Library?

by Thomas Raddatz » Sat, 28 Apr 2007 02:22:45 GMT

eera,

Feel free to use the following CL program to start journaling for all files of a given library. The
comments are in German but the parameter names should tell you what to pass to the program. Just
compile the program from PDM using option 14.

Thomas Raddatz.


/* **************************************************************** */
/* */
/* PGM : ADDJRNCL */
/* Titel : Startet die Journalisierung f alle Dateien in der */
/* angegebenen Bibliothek. */
/* */
/* Input : */
/* filelib : Bibliothek mit den Dateien, f welche die */
/* Journalisierung gestartet werden soll. */
/* */
/* touser : Benutzer, an den die Verarbeitungsnachrichten gesende */
/* werden sollen. */
/* */
/* **************************************************************** */

PGM PARM(&FILELIB +
&JRN +
&JRNLIB +
&TOUSER)

/* ------------------------------ */
/* Entry-Parameter */
/* ------------------------------ */
DCL VAR(&FILELIB ) TYPE(*CHAR) LEN(10)
DCL VAR(&TOUSER ) TYPE(*CHAR) LEN(10)

/* ------------------------------ */
/* Dateien */
/* ------------------------------ */
DCLF FILE(QAFDPHY)

/* ------------------------------ */
/* Arbeitsfelder */
/* ------------------------------ */
DCL VAR(&JRNLIB ) TYPE(*CHAR) LEN(10)
DCL VAR(&JRN ) TYPE(*CHAR) LEN(10)
DCL VAR(&IMAGES ) TYPE(*CHAR) LEN(10) +
VALUE(' ')
DCL VAR(&OMITOP ) TYPE(*CHAR) LEN(10) +
VALUE(' ')
DCL VAR(&ANZAHL ) TYPE(*DEC ) LEN( 5 0) +
VALUE(0)
DCL VAR(&ANZAHLC ) TYPE(*CHAR) LEN( 5 ) +
VALUE('00000')

/* ------------------------------ */
/* Fehlerbehandlung */
/* ------------------------------ */
DCL VAR(&ERROR ) TYPE(*LGL) +
VALUE('0')
DCL VAR(&TRUE ) TYPE(*LGL) +
VALUE('1')
DCL VAR(&FALSE ) TYPE(*LGL) +
VALUE('0')
DCL VAR(&ERRMSGKEY ) TYPE(*CHAR) LEN(4)
DCL VAR(&ERRMSGTYP ) TYPE(*CHAR) LEN(10) +
VALUE('*DIAG')
DCL VAR(&ERRNBRTYP ) TYPE(*CHAR) LEN(4) +
VALUE(X'00000001')
DCL VAR(&ERRPGMMSGQ) TYPE(*CHAR) LEN(10) +
VALUE('*')
DCL VAR(&ERRSTKCTR ) TYPE(*CHAR) LEN(4) +
VALUE(X'00000001')
DCL

AS/400 >> How do set Journal for all tables in a Library?

by Tom Liotta » Sat, 28 Apr 2007 13:29:24 GMT


For future reference, beginning in V5R3, you can create data area
QDFTJRN in a library and put library and name of journal in the data
area followed by either *FILE or *NONE:

http://publib.boulder.ibm.com/infocenter/iseries/v5r3/index.jsp?topic=/dbp/rbafoimplicitjournal.htm

If *FILE is the final portion of the data area, then any time a file is
created in the same library the data area is in, the file will
automatically start journaling to the named journal.

In V5R4, the function is extended to allow journaling of data queues and
data areas as well. Available options also are extended:

http://publib.boulder.ibm.com/infocenter/iseries/v5r4/index.jsp?topic=/rzaki/rzakiautostrjrnl.htm

An interactive possibility for starting journaling on all files in a
library is by listing all physical files in a PDM object list, and then
running STRJRNPF against them all through a user action.

--
Tom Liotta
http://zap.to/tl400

Similar Threads

1. Journal Files automatically in Library - AS/400

2. Wall Street Journal & Rahul Sood: ATI & AMD a done deal

3. How do set Journal size in AS400? - AS/400

4. To journal or not to journal...

I need to capture everytime a record has been added, changed or
deleted in a file and the export a snapshot of that record out to be
processed.  I tried using a journal but it seems to just clump the
snapshot of the record at the end of the journal entry.  Am I doing
something wrong when I display the journal to the outfile?  Is there a
cleaner way to accomplish this task?  Trigger program maybe?

I am just looking for a clean snapshot (easily readable by other
programs) of the record after the change, add or delete.  I still am
going to look at the journal outfile and see if I can extract the file
from that but if anyone has a better solution it would be appreciated.

Thanks,

Thad Rizzi

5. Are journal entries compressed in journal receivers? - AS/400

6. How to get list of tables/libraries

7. Enumerate Tables in Library - AS/400

8. Query doing table scan when added simple predicates

Hi
I was using a query previously, that was efficient
select * from table where pred1 and pred2 and pred3;

Later I was asked to introduce new ones, but they were not based on
table columns but variables declared in SP.

select * from table where pred1 and pred2 and pred3 and variable1
='number1 and variable2 =number2;

so in turn this translates to pure mathematical comparison, sometimes
simple like 2=2,
I;ve added only 2 of them in the ex above, but actually there are 13
(does this influence the path, duh!!). Anyways, what happened was,
after they were added, it started doing a table scan, and was very
very inefficient. Later, I converted the additional predicates into
simple if loops, and executed the original query, and SP was very
fast.
Is there any database logic connected to doing a table scan? or any
registry/variable setting I can do so db2 doesnt do the table scan?
Please advise, since my team has done this  mistake in many places,
and rolling back is going to be a pain in backside.