fhg
Volume 10, Number 21 -- July 14, 2010

Who's the Scoundrel That Corrupted My Database?

Published: July 14, 2010

Dear Guru:

Yes, I'm talking to you. You who read this newsletter are gurus. Devoted and profoundly resourceful reader Sarah showed me a tip that I've got to share with you. Her technique makes it easy to find out who's doing what with the database.

Sometimes a user asks Sarah to determine who changed something in a file. The journal tells all. The problem is that journals are not easy to read. The data is stored in one big long field, called entry-specific data. However, Sarah has a way to break down the entry-specific data as it is defined in the database. Here's how it's done.

Assume that physical file CUSTOMERS is journaled into journal MYJRN. Create a file--let's call it JRNCUST--into which the journaled data will be copied. Here's the DDS for JRNCUST.

A          R QJORDJE            
A            JOENTL         5S 0
A            JOSEQN        10S 0
A            JOCODE         1A  
A            JOENTT         2A  
A            JODATE         6A  
A            JOTIME         6S 0
A            JOJOB         10A  
A            JOUSER        10A  
A            JONBR          6S 0
A            JOPGM         10A  
A            JOOBJ         10A  
A            JOLIB         10A  
A            JOMBR         10A  
A            JOCTRR        10S 0
A            JOFLAG         1A  
A            JOCCID        10S 0
A            JOINCDAT       1A  
A            JOMINESD       1A  
A            JORES          6A  
A            COMPANYNO      3P 0
A            CUSTOMERNO     5P 0
A            CUSNAM        20A  
A            BILLSTREET    16A
A            BILLCITY      12A
A            BILLSTATE      2A
A            BILLZIP       10A
A            SHIPSTREET    16A
A            SHIPCITY      12A
A            SHIPSTATE      2A
A            SHIPZIP       10A
A            TYPE           1A

The first part of the file--everything from JOENTL to JORES--has the journaling information. The entry-specific data is replaced with the fields from the database file: COMPANYNO thru TYPE.

To load the file, use the Display Journal (DSPJRN) command.

DSPJRN JRN(MYLB/MYJRN)
       FILE((MYLB/CUSTOMERS))
       ENTTYP(PT DL UB UP)
       OUTPUT(*OUTFILE)
       OUTFILFMT(*TYPE1)
       OUTFILE(MYLB/JRNCUST)

Voilą! Use your favorite query tools to view the data in human-readable format.

--Ted




                     Post this story to del.icio.us
               Post this story to Digg
    Post this story to Slashdot


Sponsored By
PRODATA COMPUTER SERVICES

DBU 9.0 Now Available!

Just when you thought DBU had it all, we've added MORE!

                                                                 New DBUSQL command
                                                                 Enhanced Audit Logging
                                                                 Execute DBUJRN in batch
                                                                 Supports DBCS for Chinese,
                                                                   Korean and Japanese
                                                                 Wizard-based DBU security set-up

And MORE!

Download today!
800.228.6318
www.DoDBU.com


Senior Technical Editor: Ted Holt
Technical Editor: Joe Hertvik
Contributing Technical Editors: Erwin Earley, Brian Kelly, Michael Sansoterra
Publisher and Advertising Director: Jenny Thomas
Advertising Sales Representative: Kim Reed
Contact the Editors: To contact anyone on the IT Jungle Team
Go to our contacts page and send us a message.

Sponsored Links

Shield Advanced Solutions:  Receiver Apply Program ~ affordable availability for the IBM i
Linoma Software:  Secure and automate data transfers with GoAnywhere Director
COMMON:  Join us at the Fall 2010 Conference & Expo, Oct. 4 - 6, in San Antonio, Texas


 

IT Jungle Store Top Book Picks

Easy Steps to Internet Programming for AS/400, iSeries, and System i: List Price, $49.95
The iSeries Express Web Implementer's Guide: List Price, $49.95
The System i RPG & RPG IV Tutorial and Lab Exercises: List Price, $59.95
The System i Pocket RPG & RPG IV Guide: List Price, $69.95
The iSeries Pocket Database Guide: List Price, $59.00
The iSeries Pocket SQL Guide: List Price, $59.00
The iSeries Pocket Query Guide: List Price, $49.00
The iSeries Pocket WebFacing Primer: List Price, $39.00
Migrating to WebSphere Express for iSeries: List Price, $49.00
Getting Started With WebSphere Development Studio Client for iSeries: List Price, $89.00
Getting Started with WebSphere Express for iSeries: List Price, $49.00
Can the AS/400 Survive IBM?: List Price, $49.00
Chip Wars: List Price, $29.95


 
The Four Hundred
IBM's Evolving Power Systems Rollout

Power7 Boxes Show Good Java Oomph Versus Other Iron

Infor Readies ERP Applications for i 7.1

As I See It: Uproar Down Under

Get Me a Vendor Who Knows My Business

Four Hundred Stuff
LANSA Unveils Major Update to aXes Modernization Tool

ASNA Updates RPG Technology for MS Visual Studio 2010

Pat Townsend Claims Industry First with Tokenization Offering

Attachmate Roots Out Insider Fraud with New Software

Health Insurance for Your Career and Your Company

Four Hundred Monitor
Four Hundred Monitor's
Full iSeries Events Calendar

System i PTF Guide
July 10, 2010: Volume 12, Number 28

July 3, 2010: Volume 12, Number 27

June 26, 2010: Volume 12, Number 26

June 19, 2010: Volume 12, Number 25

June 12, 2010: Volume 12, Number 24

June 5, 2010: Volume 12, Number 23

TPM at The Register
New project leader wears the Fedora

InfiniBand to outpace Ethernet

Double-Take helps Microsoft Flex HPC muscles

Stayin' alive: Ten years of Linux on the mainframe

Red Hat fights Microsoft for cloud profits

Oracle refreshes Sun Xeon server lineup

CPU, GPU makers gussie up their wares for Hot Chips

Azul goes virtual with Java appliance

Nimbula puffs up 'cloud operating system'

Oracle uses Sun as springboard in Q4

Neon to take mainframe complaints to Europe

Red Hat turns the crank of KVM enterprise virt

THIS ISSUE SPONSORED BY:

SEQUEL Software
ProData Computer Services
System i Developer


Printer Friendly Version


TABLE OF CONTENTS
Heads Up! Additional Configuration Required for Windows 7/Windows Server 2008 R2

Who's the Scoundrel That Corrupted My Database?

Admin Alert: Keep Your Data Synced Up During an HA Switch Over

Four Hundred Guru

BACK ISSUES




 
Subscription Information:
You can unsubscribe, change your email address, or sign up for any of IT Jungle's free e-newsletters through our Web site at http://www.itjungle.com/sub/subscribe.html.

Copyright © 1996-2010 Guild Companies, Inc. All Rights Reserved.
Guild Companies, Inc., 50 Park Terrace East, Suite 8F, New York, NY 10034

Privacy Statement