Kisco U - Journaling Data Areas

Programming - Other
Typography
  • Smaller Small Medium Big Bigger
  • Default Helvetica Segoe Georgia Times

Data areas are useful for passing a large quantity of information between programs and even systems without creating a lot of parameter fields. They are also useful for distributing application settings. Because they are handled by multiple programs, it is sometimes difficult to understand how a setting in a data area was changed and when it happened.

The IBM i OS supports journaling for data areas. With a journal active on a data area you can see what changes are made, when they were made, what program was used and even see the before and after data contents. We recently had a development issue where a data area was changing and we could not track down the culprit program. By activating a data area journal, we discovered the problem quickly and were able to remedy it.

There is one big restriction in the IBM i OS for data area journaling. You can only journal a named local data area. The special data areas like *LDA, *GDA, *PDA and DDM data areas cannot be journaled.

To journal a data area, you will need to complete these steps:

  1. Create a journal receiver
  2. Create a journal
  3. Start the journaling process
  4. Review the journal results

In the following example, we will show how to journal a 2000 character data area named CONTROL in a library named MYLIB. To do this, we will create a journal receiver named CONTROL and a journal, also with the same name.

The following commands will create the journal receiver and journal and start the journaling process:

 

CRTJRNRCV JRNRCV(MYLIB/CONTROL)

CRTJRN JRN(MYLIB/CONTROL) JRNRCV(MYLIB/CONTROL)

STRJRNOBJ OBJ(MYLIB/CONTROL) OBJTYPE(*DTAARA) JRN(MYLIB/CONTROL)IMAGES(*BOTH)

 

In this example, we will capture both the before data area contents and the after data area contents.

Once this has been set up, let your application process. Each time a position or string in the data area is changed, two records will be added to the journal showing the results.

To review the results stored in the journal, you can use this command:

 

DSPJRN JRN(MYLIB/CONTROL)

 

When you do, you will see a display that might look like this:

 Kisco U  - Journaling Data Areas - Figure 1

The “Type” column indicates what kind of journal record is recorded:

  • PR: journal created
  • EG: journaling started
  • EB: data BEFORE the change
  • EA: data AFTER the change

Detail about the change are in the EB and EA records. For this example, we’ll just look at the final EA record. Place a 5 next to it to view it:

 Kisco U  - Journaling Data Areas - Figure 2

In this example, position 1432 of the data area was changed to the value *ALL. You can see the character string changed starting in position 27 of the area shown. To view the specific field position and length, press F6 and then F11 to see the record displayed in hex.

 Kisco U  - Journaling Data Areas - Figure 3

The first four characters point to the data area position and the next 4 characters indicate the number of characters in the string that was changed.

From the original display, you can use the F10 key to display information about when and how the data area was changed.

 Kisco U  - Journaling Data Areas - Figure 4

In this example, you can see that QSECOFR is the guilty party. By scrolling up (not shown) we see that the program used was QCMD which means that the data area was changed using the command line.


BLOG COMMENTS POWERED BY DISQUS

LATEST COMMENTS

Support MC Press Online

$

Book Reviews

Resource Center

  •  

  • LANSA Business users want new applications now. Market and regulatory pressures require faster application updates and delivery into production. Your IBM i developers may be approaching retirement, and you see no sure way to fill their positions with experienced developers. In addition, you may be caught between maintaining your existing applications and the uncertainty of moving to something new.

  • The MC Resource Centers bring you the widest selection of white papers, trial software, and on-demand webcasts for you to choose from. >> Review the list of White Papers, Trial Software or On-Demand Webcast at the MC Press Resource Center. >> Add the items to yru Cart and complet he checkout process and submit

  • SB Profound WC 5536Join us for this hour-long webcast that will explore:

  • Fortra IT managers hoping to find new IBM i talent are discovering that the pool of experienced RPG programmers and operators or administrators with intimate knowledge of the operating system and the applications that run on it is small. This begs the question: How will you manage the platform that supports such a big part of your business? This guide offers strategies and software suggestions to help you plan IT staffing and resources and smooth the transition after your AS/400 talent retires. Read on to learn: