ca.portal.admin

Re: [IDMSVENDOR-L] Journal extracts to flat files

Discussion created by ca.portal.admin on Apr 5, 2007
okay - here is the code:

step 1 - I use the standard CUPRIT-supplied journal input exit to flatten
the journal records (the reason I picked CULPRIT - CA has written the hard
part for you)
I onlty need 5000 characters per record (maybe less, but this would CYA) -
so here is the code:

DATABASE DICTNAME=APPL
INPUT 32760 32760 UM(CULLJRNL)
REC INPUT-RECORD 1 5000
REC $
REC $ jrnl definitions copied from JREPORT 000
REC $
REC REC-LEN 1 2 1
REC TYPE 5 4
REC GMT 9 8
REC SEQ 17 8 1
REC QUAL 25 8 1 $qualifier:
REC QUAL-CV 25 8 $CV: node
REC QUAL-LOCAL 25 8 1 $Local: GMT
REC CVNO 33 1
REC VERS 34 1
REC RSV1 35 2 $Reserved
REC $ BGIN,COMT,ENDJ,ABRT,RTSV, Plus AREA,BFOR,AFTR RECORDS ********
REC TRANSACT-ID 37 4 1
REC TRANSACT-IDC 37 4
REC $ BGIN,COMT,ENDJ,ABRT,RTSV, Plus AREA RECORDS ******************
REC VIB 41 4 1
REC $ BGIN,COMT,ENDJ,ABRT,RTSV RECORDS******************************
REC PROGRAM-NAME 45 8
REC DTESTAMP 53 8
REC DTESTAMPX 53 8 1
REC OLDTIM 61 8 2 $not used
REC UPDATE-QUIESE 69 2 1
REC QUIESCE 71 2 1
REC SAVEPOINT-SEQ 73 8 1 $RTSV only.
REC TASK-ID 73 8 $Local Task id.
REC LT-P1 73 4
REC LT-P2 77 4 1
REC $ COMT,ENDJ,ABRT RECORDS ONLY **********************************
REC UPDATED 81 4 1
REC DB-STATS 85 60
REC READ 85 4 1
REC WRITTEN 89 4 1
REC PAGE-REQUESTS 93 4 1
REC CALC-ON 97 4 1
REC CALC-NOT-ON 101 4 1
REC VIA-ON 105 4 1
REC VIA-NOT-ON 109 4 1
REC REC-REQUESTED 113 4 1
REC CURR-OF-TR 117 4 1
REC CALLS 121 4 1
REC FGMT-STORED 125 4 1
REC FGMT-RETURNED 129 4 1
REC LOCKS-REQUESTED 133 4 1
REC SHARED-LOCKS-HELD 137 4 1
REC EXCLUSIVE-LOCKS-HELD 141 4 1
REC TR-ID-CV 145 4 1 $TRANSACTION ID.
REC TASK-ID-CV 149 4 1 $TCE address.
REC LOCAL-TASK-ID-CV 153 8
REC LT-PART1 153 4
REC LT-PART2 157 4 1
REC LT-PART2A 157 3 1 $ IDMS/2549
REC LT-PART2B 160 1 1 $ IDMS/2549
REC IX-STATS 161 40
REC IX-SR8-SPLITS 161 4 1
REC IX-SR8-SPAWNS 165 4 1
REC IX-SR8-STORED 169 4 1
REC IX-SR8-ERASED 173 4 1
REC IX-SR7-STORED 177 4 1
REC IX-SR7-ERASED 181 4 1
REC IX-BTREE-SEARCHES 185 4 1
REC IX-BTREE-LEVELS-SEARCHED 189 4 1
REC IX-ORPHANS-ADOPTED 193 4 1
REC IX-LEVELS-SEARCHED-BEST 197 2 1
REC IX-LEVELS-SEARCHED-WORST 199 2 1
REC $ TIME RECORD ONLY *********************************************
REC T-DATESTMP 37 8 1
REC $ AREA RECORD ONLY *********************************************
REC AREA 45 18
REC RESERVED2 63 2
REC LOW-PAGE 65 4 1
REC HIGH-PAGE 69 4 1
REC MODE 73 2 1
REC ACCESS 75 2 1
REC $ BFOR & AFTR RECORDS ONLY *************************************
REC IDMS-VSAM-FLAG 41 1 1
REC AREA-TYPE 41 1 1
REC VERB-NUM 42 1 1
REC VERB 42 1 1
REC PAGE-GROUP 43 2 1
REC DBK-FORMAT 45 4 1
REC DBK-LINES 48 1 1
REC DB-KEY 49 4 1
REC DB-KEY1 49 3 1 $IDMS/1209
REC DB-KEY2 52 1 1 $IDMS/1209
REC DB-KEY-A 49 4 $Hex compares IDMS/2721
REC USER-REC-ID 53 2 1
REC USER-REC-ID-A 53 2 $Hex compares IDMS/1893
REC PG-DISPL 55 2 1
REC IMAGE-LEN 57 2 1
REC PREFIX-LEN 59 2 1
REC DISPLACEMENT 61 2 1
REC SPAN-OFFSET 63 2 1
REC USER-RECORD 65 2 1
01OUT 5000 D PS DD=OFA
01SORT NOSORT
01510001 INPUT-RECORD SZ=5000
017 $ if a user journal record, pass it on
017 IF TYPE EQ ('USER') TAKE
017 $ if a r/u related jrnl record, pass it on
017 IF TYPE EQ ('BGIN' 'ENDJ' 'ABRT' 'COMT') TAKE
017 $ if not a bfor/aftr. get rid of it
017 IF TYPE NE ('BFOR' 'AFTR') DROP
017 $ IF NOT one of the specified record IDs,
017 $ drop it


then - take this input and apply it as follows:

IN 5000 F PS DD=INF
REC $
REC $ jrnl definitions copied from JREPORT 000
REC $
REC REC-LEN 1 2 1
REC TYPE 5 4
REC GMT 9 8
REC SEQ 17 8 1
REC QUAL 25 8 1 $qualifier:
REC QUAL-CV 25 8 $CV: node
REC QUAL-LOCAL 25 8 1 $Local: GMT
REC CVNO 33 1
REC VERS 34 1
REC RSV1 35 2 $Reserved
REC $ BGIN,COMT,ENDJ,ABRT,RTSV, Plus AREA,BFOR,AFTR RECORDS ********
REC TRANSACT-ID 37 4 1
REC TRANSACT-IDC 37 4
REC $ BGIN,COMT,ENDJ,ABRT,RTSV, Plus AREA RECORDS ******************
REC VIB 41 4 1
REC $ BGIN,COMT,ENDJ,ABRT,RTSV RECORDS******************************
REC PROGRAM-NAME 45 8
REC DTESTAMP 53 8
REC DTESTAMPX 53 8 1
REC OLDTIM 61 8 2 $not used
REC UPDATE-QUIESE 69 2 1
REC QUIESCE 71 2 1
REC SAVEPOINT-SEQ 73 8 1 $RTSV only.
REC TASK-ID 73 8 $Local Task id.
REC LT-P1 73 4
REC LT-P2 77 4 1
REC $ COMT,ENDJ,ABRT RECORDS ONLY **********************************
REC UPDATED 81 4 1
REC DB-STATS 85 60
REC READ 85 4 1
REC WRITTEN 89 4 1
REC PAGE-REQUESTS 93 4 1
REC CALC-ON 97 4 1
REC CALC-NOT-ON 101 4 1
REC VIA-ON 105 4 1
REC VIA-NOT-ON 109 4 1
REC REC-REQUESTED 113 4 1
REC CURR-OF-TR 117 4 1
REC CALLS 121 4 1
REC FGMT-STORED 125 4 1
REC FGMT-RETURNED 129 4 1
REC LOCKS-REQUESTED 133 4 1
REC SHARED-LOCKS-HELD 137 4 1
REC EXCLUSIVE-LOCKS-HELD 141 4 1
REC TR-ID-CV 145 4 1 $TRANSACTION ID.
REC TASK-ID-CV 149 4 1 $TCE address.
REC LOCAL-TASK-ID-CV 153 8
REC LT-PART1 153 4
REC LT-PART2 157 4 1
REC LT-PART2A 157 3 1 $ IDMS/2549
REC LT-PART2B 160 1 1 $ IDMS/2549
REC IX-STATS 161 40
REC IX-SR8-SPLITS 161 4 1
REC IX-SR8-SPAWNS 165 4 1
REC IX-SR8-STORED 169 4 1
REC IX-SR8-ERASED 173 4 1
REC IX-SR7-STORED 177 4 1
REC IX-SR7-ERASED 181 4 1
REC IX-BTREE-SEARCHES 185 4 1
REC IX-BTREE-LEVELS-SEARCHED 189 4 1
REC IX-ORPHANS-ADOPTED 193 4 1
REC IX-LEVELS-SEARCHED-BEST 197 2 1
REC IX-LEVELS-SEARCHED-WORST 199 2 1
REC $ TIME RECORD ONLY *********************************************
REC T-DATESTMP 37 8 1
REC $ AREA RECORD ONLY *********************************************
REC AREA 45 18
REC RESERVED2 63 2
REC LOW-PAGE 65 4 1
REC HIGH-PAGE 69 4 1
REC MODE 73 2 1
REC ACCESS 75 2 1
REC $ BFOR & AFTR RECORDS ONLY *************************************
REC IDMS-VSAM-FLAG 41 1 1
REC AREA-TYPE 41 1 1
REC VERB-NUM 42 1 1
REC VERB 42 1 1
REC PAGE-GROUP 43 2 1
REC DBK-FORMAT 45 4 1
REC DBK-LINES 48 1 1
REC DB-KEY 49 4 1
REC DB-KEY1 49 3 1 $IDMS/1209
REC DB-KEY2 52 1 1 $IDMS/1209
REC DB-KEY-A 49 4 $Hex compares IDMS/2721
REC USER-REC-ID 53 2 1
REC USER-REC-ID-A 53 2 $Hex compares IDMS/1893
REC PG-DISPL 55 2 1
REC IMAGE-LEN 57 2 1
REC PREFIX-LEN 59 2 1
REC DISPLACEMENT 61 2 1
REC SPAN-OFFSET 63 2 1
REC USER-RECORD 65 2 1
IN 5000 F PS MB=DUMMY
REC $ USED TO HOLD THE TYPE USER JOURNAL IMAGE
REC USRJTR 001 5000
IN 5000 F PS MB=DUMMY
REC $ USED TO HOLD THE ""FROM"" JOURNAL IMAGE
REC WRKJTR-TEMP 001 5000
REC JT-BYTES 001 GROUP JT 1.5000
REC JT-BYTE 001 001 ELMNT JT
IN 5000 F PS MB=DUMMY
REC $ USED TO HOLD THE ""TO"" JOURNAL IMAGE
REC WRKJTR 001 5000
REC J-BYTES 001 GROUP JX 1.5000
REC J-BYTE 001 001 ELMNT JX
REC X-LENGTH 001 002 1
REC X-LENGTHC 001 002
REC X-IMAGE 057 002 1
REC X-IMAGEC 057 002
REC X-PREFIX 059 002 1
REC X-PREFIXC 059 002
REC X-OFFSET 063 002 1
REC X-OFFSETC 063 002
GW0 REPORT-SW 'N'
010 WRKLNGTH 0
010 WRKDATE 0
010 WRKTIME 0
010 CNTRUSER 0
010 WUSRSEQN 0
010 USRSEQN 0
010 TEMP-REC-LEN 0
010 FIRST-TIME 'Y'
010 TEMP-DATE 0
01OUT 561 D PS DD=OFA
01SORT NOSORT
01510001 WRKLNGTH FB SZ=002
01510003 X'0000'
01510005 WRKDATE FM '99999'
01510010 WRKTIME FM '9999999'
01510017 '0'
01510018 USRSEQN FP SZ=006
01510024 USRJTR SZ=538
017 MOVE 'N' TO REPORT-SW $ RESET THE REPORT FLAG
017 IF FIRST-TIME NE 'Y' 010 $ SKIP IF NOT FIRST
017 CALL US10( '2' TEMP-DATE 0 0 0 0) $ GET DATE/TIME
017 CALL US15( TEMP-DATE 'P' 'MDY' 'YDD' WRKDATE )
017 CALL US10( '7' 0 0 0 0 WRKTIME)
017 MOVE 'N' TO FIRST-TIME
017010 IF TYPE NE 'USER' DROP $ SKIP IF NOT USER TYPE REC
017 MOVE 'Y' TO REPORT-SW $ SET REPORT FLAG
017 CNTRUSER + 1 CNTRUSER $ INCREMENT COUNTERS
017 WUSRSEQN + 1 WUSRSEQN
017 MOVE WUSRSEQN TO USRSEQN $ LOAD OUTPUT FIELDS
017 23 + REC-LEN WRKLNGTH $ ADD HDR LENGTH TO
017 $ EXISTING JRNL HDR LENGTH
017 MOVE REC-LEN TO TEMP-REC-LEN
017 CALL US45(REC-LEN USRJTR TEMP-REC-LEN 538 ' ') $move data
017 TAKE $ write data
020 WRKLNGTH 0
020 WRKDATE 0
020 WRKTIME 0
020 WRKRUID 'XXXX'
020 CNTRCNTL 0
020 WWRKSEQN 0
020 WRKSEQN 0
020 TEMP-REC-LEN 0
020 TEMP-COMPUTED 0
020 FIRST-TIME 'Y'
020 TEMP-DATE 0
020 COMPUTED 0
020 TEMP-VAL 0
020 SUB1 0
020 SLIDE-AMT 0
020 TEMP-IMAGE-LEN 0
020 TEMP-SPAN-OFFSET 0
020 TEMP-PREFIX-LEN 0
02OUT 720 D PS DD=OFB
02SORT NOSORT
02510001 WRKLNGTH FB SZ=002
02510003 X'0000'
02510005 WRKDATE FM '99999'
02510010 WRKTIME FM '9999999'
02510017 '0'
02510018 WRKRUID SZ=004
02510022 WRKSEQN FP SZ=006
02510028 WRKJTR SZ=693
027 IF FIRST-TIME NE 'Y' 010 $ skip if not first time
027 CALL US10( '2' TEMP-DATE 0 0 0 0) $ get date/time
027 CALL US15( TEMP-DATE 'P' 'MDY' 'YDD' WRKDATE )
027 CALL US10( '7' 0 0 0 0 WRKTIME)
027 MOVE 'N' TO FIRST-TIME
027010 IF TYPE NE ('BGIN' 'ENDJ' 'ABRT' 'COMT') 020 $ branch
027 IF PROGRAM-NAME EQ ('RHDCRUAL' 'ADSOGEN1' 'RHDCOLM2') DROP
027 MOVE 'Y' TO REPORT-SW $ SET REPORT FLAG
027 CNTRCNTL + 1 CNTRCNTL $ increment counters
027 WWRKSEQN + 1 WWRKSEQN
027 MOVE WWRKSEQN TO WRKSEQN
027 27 + REC-LEN WRKLNGTH $ ADD HDR LENGTH TO
027 $ EXISTING JRNL LENGTH
027 MOVE TRANSACT-IDC TO WRKRUID
027 MOVE REC-LEN TO TEMP-REC-LEN
027 $ MOVE RAW JOURNAL
027 $ DIRECTLY TO O/P
027 $ BUFFER
027 CALL US45(REC-LEN WRKJTR TEMP-REC-LEN 693 ' ')
027 TAKE $ WRITE THE BUFFER
$
$ THE PLAYERS:
$
$ REC-LEN: THE RDW OF THE PHYSICAL JOURNAL RECORD
$
$ COMPUTED: THE NET AMOUNT OF RECORD DATA ON THIS JOURNAL
$ RECORD (RDW - 68 BYTES OVERHEAD)
$
$ IMAGE-LEN: THE CONCEPTUAL LENGTH OF THE RECORD DATA ON THIS
$ JOURNAL RECORD IF IT WERE NOT SPANNED (WHICH IT MAY
$ OR MAY NOT BE)(IF A JOURNAL EVENT IS SPANNED, ALL
$ PIECES WOULD HAVE THE SAME IMAGE-LEN)
$
$ PREFIX-LEN: THE LENGTH OF THE PREFIX BYTES INCLUDED IN THE
$ IMAGE-LEN VALUE (THE SAME VALUE APPEARS FOR ALL
$ PIECES OF A SCANNED JOURNAL EVENT , EVEN WHEN THE
$ NON-FIRST PIECE(S) DO NOT INCLUDE THE PREFIX
$
$ SPAN-OFFSET: THE NUMBER OF CHARACTERS FOR THIS JOURNAL EVENT
$ ALREADY INCLUDED ON A PREVIOUS JOURNAL RECORD
$ (PIECE 1 OF SPANNED EVENT WOULD ALWAYS HAVE A 0
$ SPAN-OFFSET VALUE, SUBSEQUENT PIECES MUST HAVE A
$ NON-ZERO SPAN-OFFSET VALUE
$
$ SLIDE-AMT: THE NUMBER OF BYTES THE RECORD DATA WITHIN THE
$ CURRENT JOURNAL RECORD WILL BE LEFT SHIFTED TO
$ FILL THE SPACE FREED BY REMOVING THE PREFIX BYTES
$ FROM THE RECORD DATA PORTION OF THE JRNL RECORD
$
027020 IF TYPE NE ('BFOR' 'AFTR') DROP $ IF AN UNWANTED TYPE, DROP IT
$
027 $ COMPUTE THE AMOUNT OF ACTUAL
027 COMPUTE REC-LEN - 68 COMPUTED $ RECORD DATA ON THIS RECORD
$
027 $ IF THE CONCEPTUAL RECORD DATA
027 IF IMAGE-LEN LE PREFIX-LEN DROP $ CONTAINS ONLY POINTERS, DROP
$
027 $ IF A NON-SPANNED (OR PART 1
027 $ OF A SPANNED) EVENT, AND THE
027 $ ACTUAL RECORD DATA DOES NOT
027 $ EXCEED THE LENGTH OF THE
027 $ PREFIX BYTES, DROP IT
027 IF (COMPUTED LE PREFIX-LEN) AND (SPAN-OFFSET EQ 0) DROP
$
027 $ CALCULATE HOW MUCH RECORD
027 $ DATA IS CONTAINED ON THIS
027 $ AND ANY PREVIOUS PARTS OF
027 $ THIS JOURNAL EVENT
027 COMPUTED + SPAN-OFFSET TEMP-VAL
$
027 $ IF A SPANNED EVENT, AND THE
027 $ ACCUMULATED RECORD DATA DOES
027 $ NOT EXCEED THE LENGTH OF THE
027 $ PREFIX BYTES, DROP IT
027 IF (SPAN-OFFSET GT 0) AND (TEMP-VAL LE PREFIX-LEN) DROP
$
027 MOVE 'Y' TO REPORT-SW $ SET REPORT FLAG
$
027 $ POPULATE TEMP FIELDS WITH
027 $ THE CORRESPONDING ""REAL""
027 $ VALUES
027 MOVE REC-LEN TO TEMP-REC-LEN
027 MOVE IMAGE-LEN TO TEMP-IMAGE-LEN
027 MOVE PREFIX-LEN TO TEMP-PREFIX-LEN
027 MOVE SPAN-OFFSET TO TEMP-SPAN-OFFSET
$
027 $ INCREMENT THE COUNTERS
027 WWRKSEQN + 1 WWRKSEQN
027 MOVE WWRKSEQN TO WRKSEQN
$
027 $ ADD THE HDR LENGTH TO THE
027 $ EXISTING JRNL RECORD LENGTH
===> Scroll ===> CSR
027 27 + REC-LEN WRKLNGTH
$
027 $ POPULATE THE RUN UNIT ID
027 MOVE TRANSACT-IDC TO WRKRUID
$
027 $ MOVE THE RAW JOURNAL DATA
027 $ INTO THE ""FROM"" AND ""TO""
027 $ BUFFERS
027 CALL US45(REC-LEN WRKJTR-TEMP TEMP-REC-LEN 693 ' ')
027 CALL US45(REC-LEN WRKJTR TEMP-REC-LEN 693 ' ')
$
027 $ SET THE DEFAULT SLIDE AMOUNT
027 $ TO ZERO
027 MOVE 0 TO SLIDE-AMT
$
027 $ IF THIS JOURNAL EVENT IS
027 $ CONTAINED IN THIS RECORD
027 $ (I.E. THE ACTUAL RECORD DATA
027 $ EQUALS THE CONCEPTUAL RECORD
027 IF COMPUTED = IMAGE-LEN 030 $ DATA, GO TO APPROPRIATE CODE
$
027 $ IF THIS RECORD IS PART 1
027 $ OF A MULTI-PART JOURNAL EVENT
027 $ (I.E. PART 1 OF A SPANNED
027 $ RECORD, GO TO THE APPROPRIATE
027 IF SPAN-OFFSET = 0 030 $ CODE
$
027 $ IF NEITHER OF THE ABOVE,
027 $ WE ARE IN PART 2+ OF A SPANNED
027 $ EVENT; GO TO THE APPROPRIATE
027 B 040 $ CODE
$
027 $ IF HERE, WE HAVE PREFIX AND
027 $ SOME OR ALL DATA ON THIS
027 $ JOURNAL RECORD, SET THE
027 $ SLIDE AMOUNT TO THE PREFIX
027 $ LENGTH ITSELF, AND BRANCH
027030 MOVE TEMP-PREFIX-LEN TO SLIDE-AMT
$
027 $ IF HERE, WE MAY HAVE SOME
027 $ PREFIX AND THE SOME OR ALL
027 $ OF THE REMAINDER DATA
$
027 $ IF THE PREFIX WAS ""GOBBLED""
027 $ ON A PREVIOUS JOURNAL RECORD
027 $ THEN WE SLIDE NOTHING, BRANCH
027040 IF TEMP-SPAN-OFFSET GE TEMP-PREFIX-LEN 100
$
027 $ IF HERE, THERE IS SOME BUT
027 $ NOT ALL OF THE PREFIX
027 $ REMAINING TO BE GOBBLED - WE
027 $ SLIDE ONLY THE REMAINING, NOT
027 $ THE ENTIRE PREFIX LENGTH
027 TEMP-PREFIX-LEN - TEMP-SPAN-OFFSET SLIDE-AMT
$
027 $ DETERMINE WHERE IN THE ""FROM""
027 $ BUFFER WHERE TO START SLIDING
027100 65 + SLIDE-AMT SUB1
$
027 $ ADJUST COMPUTED AND RDW FOR
027 $ THE SLIDE AMOUNT
027 COMPUTED - SLIDE-AMT TEMP-COMPUTED
027 TEMP-REC-LEN - SLIDE-AMT TEMP-REC-LEN
$
027 $ DO THE SLIDE
027 CALL US45 (JT-BYTE.SUB1 J-BYTE.65 TEMP-COMPUTED 629 ' ')
$
027 $ MODIFY THE JOURNAL RDW
027 CALL US33 (TEMP-REC-LEN 8 X-LENGTHC 2)
$
027 $ UNCONDITIONALLY SET THE
027 $ PREFIX LENGTH TO ZERO
027 CALL US43 (X'0000' X-PREFIX 2)
$
027 $ IF WE PROCESSED DATA FOR THIS
027 $ EVENT IN A PREVIOUS RECORD,
027 $ BRANCH TO APPROPRIATE CODE
027 IF TEMP-SPAN-OFFSET GT TEMP-PREFIX-LEN 110
$
027 $ IF HERE, THE RECORD WAS MARKED
027 $ AS SPANNED, BUT THE PREVIOUS
027 $ RECORD WAS ONLY PREFIX(AND AS
027 $ SUCH DROPPED), THEN THIS
027 $ RECORD BECOMES PART 1, AND WE
027 $ CAN DROP THE SPANNED COUNT
027 CALL US43 (X'0000' X-OFFSET 2)
027 B 120
$
027 $ IF HERE, WE ADJUST THE SPAN
027 $ OFFSET BY THE AMOUNT OF THE
027 $ PREFIX GOBBLED IN THIS OR A
027 $ PREVIOUS RECORD
027110 TEMP-SPAN-OFFSET - TEMP-PREFIX-LEN TEMP-SPAN-OFFSET
027 CALL US33 (TEMP-SPAN-OFFSET 8 X-OFFSETC 2)
$
027 $ ADJUST THE CONCEPTUAL LENGTH
027 $ BY THE TOTAL PREFIX LENGTH
027120 TEMP-IMAGE-LEN - PREFIX-LEN TEMP-IMAGE-LEN
027 CALL US33 (TEMP-IMAGE-LEN 8 X-IMAGEC 2)
$
027 $ ADJUST THE O/P RDW BY THE
027 $ PHYSICAL SLIDE AMOUNT
027 WRKLNGTH - SLIDE-AMT WRKLNGTH
$
027 $ WRITE THE OUTPUT
027 TAKE
990 USER-OUT-COUNT 0
990 CTRL-OUT-COUNT 0
990 RECORD-OUT-COUNT.100 0
990 TOTAL-IN-COUNT 0
990 SUB1 0
99OUT 080 D NS(XXXX)
99SORT NOSORT
99510001 ' TOTAL USER RECORDS OUT= '
99510028 USER-OUT-COUNT FM 'ZZZZZZZ9'
99520001 ' TOTAL CTRL RECORDS OUT= '
99520028 CTRL-OUT-COUNT FM 'ZZZZZZZ9'
99530001 ' TOTAL '
99530010 X-RECORD-ID.SUB1 FM '9999'
99530014 ' RECORDS OUT= '
99530028 RECORD-OUT-COUNT.SUB1 FM 'ZZZZZZZ9'
99540001 ' TOTAL RECORDS INPUT = '
99540028 TOTAL-IN-COUNT FM 'ZZZZZZZ9'
$
997 IF EOF EQ 900 $ if at end, print totals
997 TOTAL-IN-COUNT + 1 TOTAL-IN-COUNT $ incr in count
$
$ if not accepted by prev
997 IF REPORT-SW NE 'Y' DROP $ process, drop it
$
997 IF TYPE EQ 'USER' 010 $ if type user ...
$
997 IF TYPE EQ ('BGIN' 'ENDJ' 'ABRT' 'COMT') 020 $ if a ctrl type ..
$
997 IF TYPE EQ ('BFOR' 'AFTR') 030 $ if a bfor/aftr ...
$
997 DROP $ if none of the above ...
$
997010 USER-OUT-COUNT + 1 USER-OUT-COUNT $ increment counts
997 DROP $ get out
$
997020 CTRL-OUT-COUNT + 1 CTRL-OUT-COUNT $ increment counts
997 DROP $ get out
$
997030 MOVE 0 TO SUB1 $ loop throught table
997031 SUB1 + 1 SUB1 $ looking for match
$
997 IF SUB1 GT 100 STOP $ if at end .. an error
997 IF X-RECORD-ID.SUB1 EQ 9999 STOP $ if no match, an error
$
997 $ if this entry is not a
997 IF USER-REC-ID NE X-RECORD-ID.SUB1 031 $ match, try the next
$
997 $ if a match, increment
997 RECORD-OUT-COUNT.SUB1 + 1 RECORD-OUT-COUNT.SUB1
997 DROP $ get out
$
997 $ print the user & ctrl
997900 RELS (1,2) $ counts
$
997 MOVE 0 TO SUB1 $ loop through to
997901 SUB1 + 1 SUB1 $ PRINT RECORD TYPE TOTLS
997 IF SUB1 GT 100 STOP $ IF AT END ERROR
997 IF X-RECORD-ID.SUB1 EQ 9999 910 $ EOF MARKER? PRNT IN TOT
997 RELS 3 $ PRINT THIS LINE
997 B 901 $ LOOK AT NEXT
997910 RELS 4 $ PRINT IN TOTALS
997 DROP $ SAY GOODBYE



this was very specific to the needs of the application, but this may
provide help in looking at a journal archive to pull out data
ps - i had LOTS of help from Cal Domingue (forgive misspelling) in figuring
out the journal internals ...














This is Chris Hoelscher and I approved this message!

Chris Hoelscher
Senior IDMS & DB2 Database Administrator
Humana Inc
502-476-2538
choelscher@humana.com



The information transmitted is intended only for the person or entity to
which it is addressed and may contain CONFIDENTIAL material. If you receive
this material/information in error, please contact the sender and delete or
destroy the material/information.
?????
Ä?????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????"
IDMS Public Discussion Forum
IDMS-L@LISTSERV.IUASSN.COM
SMTP
IDMS-L@LISTSERV.IUASSN.COM
IDMS-L@LISTSERV.IUASSN.COM
SMTP








Normal

Normal
Re: [IDMSVENDOR-L] Journal extracts to flat files
"okay - here is the code:

step 1 - I use the standard CUPRIT-supplied journal input exit to flatten
the journal records (the reason I picked CULPRIT - CA has written the hard
part for you)
I onlty need 5000 characters per record (maybe less, but this would CYA) -
so here is the code:

DATABASE DICTNAME=APPL
INPUT 32760 32760 UM(CULLJRNL)
REC INPUT-RECORD 1 5000
REC $
REC $ jrnl definitions copied from JREPORT 000
REC $
REC REC-LEN 1 2 1
REC TYPE 5 4
REC GMT 9 8
REC SEQ 17 8 1
REC QUAL 25 8 1 $qualifier:
REC QUAL-CV 25 8 $CV: node
REC QUAL-LOCAL 25 8 1 $Local: GMT
REC CVNO 33 1
REC VERS 34 1
REC RSV1 35 2 $Reserved
REC $ BGIN,COMT,ENDJ,ABRT,RTSV, Plus AREA,BFOR,AFTR RECORDS ********
REC TRANSACT-ID 37 4 1
REC TRANSACT-IDC 37 4
REC $ BGIN,COMT,ENDJ,ABRT,RTSV, Plus AREA RECORDS ******************
REC VIB 41 4 1
REC $ BGIN,COMT,ENDJ,ABRT,RTSV RECORDS******************************
REC PROGRAM-NAME 45 8
REC DTESTAMP 53 8
REC DTESTAMPX 53 8 1
REC OLDTIM 61 8 2 $not used
REC UPDATE-QUIESE 69 2 1
REC QUIESCE 71 2 1
REC SAVEPOINT-SEQ 73 8 1 $RTSV only.
REC TASK-ID 73 8 $Local Task id.
REC LT-P1 73 4
REC LT-P2 77 4 1
REC $ COMT,ENDJ,ABRT RECORDS ONLY **********************************
REC UPDATED 81 4 1
REC DB-STATS 85 60
REC READ 85 4 1
REC WRITTEN 89 4 1
REC PAGE-REQUESTS 93 4 1
REC CALC-ON 97 4 1
REC CALC-NOT-ON 101 4 1
REC VIA-ON 105 4 1
REC VIA-NOT-ON 109 4 1
REC REC-REQUESTED 113 4 1
REC CURR-OF-TR 117 4 1
REC CALLS 121 4 1
REC FGMT-STORED 125 4 1
REC FGMT-RETURNED 129 4 1
REC LOCKS-REQUESTED 133 4 1
REC SHARED-LOCKS-HELD 137 4 1
REC EXCLUSIVE-LOCKS-HELD 141 4 1
REC TR-ID-CV 145 4 1 $TRANSACTION ID.
REC TASK-ID-CV 149 4 1 $TCE address.
REC LOCAL-TASK-ID-CV 153 8
REC LT-PART1 153 4
REC LT-PART2 157 4 1
REC LT-PART2A 157 3 1 $ IDMS/2549
REC LT-PART2B 160 1 1 $ IDMS/2549
REC IX-STATS 161 40
REC IX-SR8-SPLITS 161 4 1
REC IX-SR8-SPAWNS 165 4 1
REC IX-SR8-STORED 169 4 1
REC IX-SR8-ERASED 173 4 1
REC IX-SR7-STORED 177 4 1
REC IX-SR7-ERASED 181 4 1
REC IX-BTREE-SEARCHES 185 4 1
REC IX-BTREE-LEVELS-SEARCHED 189 4 1
REC IX-ORPHANS-ADOPTED 193 4 1
REC IX-LEVELS-SEARCHED-BEST 197 2 1
REC IX-LEVELS-SEARCHED-WORST 199 2 1
REC $ TIME RECORD ONLY *********************************************
REC T-DATESTMP 37 8 1
REC $ AREA RECORD ONLY *********************************************
REC AREA 45 18
REC RESERVED2 63 2
REC LOW-PAGE 65 4 1
REC HIGH-PAGE 69 4 1
REC MODE 73 2 1
REC ACCESS 75 2 1
REC $ BFOR & AFTR RECORDS ONLY *************************************
REC IDMS-VSAM-FLAG 41 1 1
REC AREA-TYPE 41 1 1
REC VERB-NUM 42 1 1
REC VERB 42 1 1
REC PAGE-GROUP 43 2 1
REC DBK-FORMAT 45 4 1
REC DBK-LINES 48 1 1
REC DB-KEY 49 4 1
REC DB-KEY1 49 3 1 $IDMS/1209
REC DB-KEY2 52 1 1 $IDMS/1209
REC DB-KEY-A 49 4 $Hex compares IDMS/2721
REC USER-REC-ID 53 2 1
REC USER-REC-ID-A 53 2 $Hex compares IDMS/1893
REC PG-DISPL 55 2 1
REC IMAGE-LEN 57 2 1
REC PREFIX-LEN 59 2 1
REC DISPLACEMENT 61 2 1
REC SPAN-OFFSET 63 2 1
REC USER-RECORD 65 2 1
01OUT 5000 D PS DD=OFA
01SORT NOSORT
01510001 INPUT-RECORD SZ=5000
017 $ if a user journal record, pass it on
017 IF TYPE EQ ('USER') TAKE
017 $ if a r/u related jrnl record, pass it on
017 IF TYPE EQ ('BGIN' 'ENDJ' 'ABRT' 'COMT') TAKE
017 $ if not a bfor/aftr. get rid of it
017 IF TYPE NE ('BFOR' 'AFTR') DROP
017 $ IF NOT one of the specified record IDs,
017 $ drop it


then - take this input and apply it as follows:

IN 5000 F PS DD=INF
REC $
REC $ jrnl definitions copied from JREPORT 000
REC $
REC REC-LEN 1 2 1
REC TYPE 5 4
REC GMT 9 8
REC SEQ 17 8 1
REC QUAL 25 8 1 $qualifier:
REC QUAL-CV 25 8 $CV: node
REC QUAL-LOCAL 25 8 1 $Local: GMT
REC CVNO 33 1
REC VERS 34 1
REC RSV1 35 2 $Reserved
REC $ BGIN,COMT,ENDJ,ABRT,RTSV, Plus AREA,BFOR,AFTR RECORDS ********
REC TRANSACT-ID 37 4 1
REC TRANSACT-IDC 37 4
REC $ BGIN,COMT,ENDJ,ABRT,RTSV, Plus AREA RECORDS ******************
REC VIB 41 4 1
REC $ BGIN,COMT,ENDJ,ABRT,RTSV RECORDS******************************
REC PROGRAM-NAME 45 8
REC DTESTAMP 53 8
REC DTESTAMPX 53 8 1
REC OLDTIM 61 8 2 $not used
REC UPDATE-QUIESE 69 2 1
REC QUIESCE 71 2 1
REC SAVEPOINT-SEQ 73 8 1 $RTSV only.
REC TASK-ID 73 8 $Local Task id.
REC LT-P1 73 4
REC LT-P2 77 4 1
REC $ COMT,ENDJ,ABRT RECORDS ONLY **********************************
REC UPDATED 81 4 1
REC DB-STATS 85 60
REC READ 85 4 1
REC WRITTEN 89 4 1
REC PAGE-REQUESTS 93 4 1
REC CALC-ON 97 4 1
REC CALC-NOT-ON 101 4 1
REC VIA-ON 105 4 1
REC VIA-NOT-ON 109 4 1
REC REC-REQUESTED 113 4 1
REC CURR-OF-TR 117 4 1
REC CALLS 121 4 1
REC FGMT-STORED 125 4 1
REC FGMT-RETURNED 129 4 1
REC LOCKS-REQUESTED 133 4 1
REC SHARED-LOCKS-HELD 137 4 1
REC EXCLUSIVE-LOCKS-HELD 141 4 1
REC TR-ID-CV 145 4 1 $TRANSACTION ID.
REC TASK-ID-CV 149 4 1 $TCE address.
REC LOCAL-TASK-ID-CV 153 8
REC LT-PART1 153 4
REC LT-PART2 157 4 1
REC LT-PART2A 157 3 1 $ IDMS/2549
REC LT-PART2B 160 1 1 $ IDMS/2549
REC IX-STATS 161 40
REC IX-SR8-SPLITS 161 4 1
REC IX-SR8-SPAWNS 165 4 1
REC IX-SR8-STORED 169 4 1
REC IX-SR8-ERASED 173 4 1
REC IX-SR7-STORED 177 4 1
REC IX-SR7-ERASED 181 4 1
REC IX-BTREE-SEARCHES 185 4 1
REC IX-BTREE-LEVELS-SEARCHED 189 4 1
REC IX-ORPHANS-ADOPTED 193 4 1
REC IX-LEVELS-SEARCHED-BEST 197 2 1
REC IX-LEVELS-SEARCHED-WORST 199 2 1
REC $ TIME RECORD ONLY *********************************************
REC T-DATESTMP 37 8 1
REC $ AREA RECORD ONLY *********************************************
REC AREA 45 18
REC RESERVED2 63 2
REC LOW-PAGE 65 4 1
REC HIGH-PAGE 69 4 1
REC MODE 73 2 1
REC ACCESS 75 2 1
REC $ BFOR & AFTR RECORDS ONLY *************************************
REC IDMS-VSAM-FLAG 41 1 1
REC AREA-TYPE 41 1 1
REC VERB-NUM 42 1 1
REC VERB 42 1 1
REC PAGE-GROUP 43 2 1
REC DBK-FORMAT 45 4 1
REC DBK-LINES 48 1 1
REC DB-KEY 49 4 1
REC DB-KEY1 49 3 1 $IDMS/1209
REC DB-KEY2 52 1 1 $IDMS/1209
REC DB-KEY-A 49 4 $Hex compares IDMS/2721
REC USER-REC-ID 53 2 1
REC USER-REC-ID-A 53 2 $Hex compares IDMS/1893
REC PG-DISPL 55 2 1
REC IMAGE-LEN 57 2 1
REC PREFIX-LEN 59 2 1
REC DISPLACEMENT 61 2 1
REC SPAN-OFFSET 63 2 1
REC USER-RECORD 65 2 1
IN 5000 F PS MB=DUMMY
REC $ USED TO HOLD THE TYPE USER JOURNAL IMAGE
REC USRJTR 001 5000
IN 5000 F PS MB=DUMMY
REC $ USED TO HOLD THE ""FROM"" JOURNAL IMAGE
REC WRKJTR-TEMP 001 5000
REC JT-BYTES 001 GROUP JT 1.5000
REC JT-BYTE 001 001 ELMNT JT
IN 5000 F PS MB=DUMMY
REC $ USED TO HOLD THE ""TO"" JOURNAL IMAGE
REC WRKJTR 001 5000
REC J-BYTES 001 GROUP JX 1.5000
REC J-BYTE 001 001 ELMNT JX
REC X-LENGTH 001 002 1
REC X-LENGTHC 001 002
REC X-IMAGE 057 002 1
REC X-IMAGEC 057 002
REC X-PREFIX 059 002 1
REC X-PREFIXC 059 002
REC X-OFFSET 063 002 1
REC X-OFFSETC 063 002
GW0 REPORT-SW 'N'
010 WRKLNGTH 0
010 WRKDATE 0
010 WRKTIME 0
010 CNTRUSER 0
010 WUSRSEQN 0
010 USRSEQN 0
010 TEMP-REC-LEN 0
010 FIRST-TIME 'Y'
010 TEMP-DATE 0
01OUT 561 D PS DD=OFA
01SORT NOSORT
01510001 WRKLNGTH FB SZ=002
01510003 X'0000'
01510005 WRKDATE FM '99999'
01510010 WRKTIME FM '9999999'
01510017 '0'
01510018 USRSEQN FP SZ=006
01510024 USRJTR SZ=538
017 MOVE 'N' TO REPORT-SW $ RESET THE REPORT FLAG
017 IF FIRST-TIME NE 'Y' 010 $ SKIP IF NOT FIRST
017 CALL US10( '2' TEMP-DATE 0 0 0 0) $ GET DATE/TIME
017 CALL US15( TEMP-DATE 'P' 'MDY' 'YDD' WRKDATE )
017 CALL US10( '7' 0 0 0 0 WRKTIME)
017 MOVE 'N' TO FIRST-TIME
017010 IF TYPE NE 'USER' DROP $ SKIP IF NOT USER TYPE REC
017 MOVE 'Y' TO REPORT-SW $ SET REPORT FLAG
017 CNTRUSER + 1 CNTRUSER $ INCREMENT COUNTERS
017 WUSRSEQN + 1 WUSRSEQN
017 MOVE WUSRSEQN TO USRSEQN $ LOAD OUTPUT FIELDS
017 23 + REC-LEN WRKLNGTH $ ADD HDR LENGTH TO
017 $ EXISTING JRNL HDR LENGTH
017 MOVE REC-LEN TO TEMP-REC-LEN
017 CALL US45(REC-LEN USRJTR TEMP-REC-LEN 538 ' ') $move data
017 TAKE $ write data
020 WRKLNGTH 0
020 WRKDATE 0
020 WRKTIME 0
020 WRKRUID 'XXXX'
020 CNTRCNTL 0
020 WWRKSEQN 0
020 WRKSEQN 0
020 TEMP-REC-LEN 0
020 TEMP-COMPUTED 0
020 FIRST-TIME 'Y'
020 TEMP-DATE 0
020 COMPUTED 0
020 TEMP-VAL 0
020 SUB1 0
020 SLIDE-AMT 0
020 TEMP-IMAGE-LEN 0
020 TEMP-SPAN-OFFSET 0
020 TEMP-PREFIX-LEN 0
02OUT 720 D PS DD=OFB
02SORT NOSORT
02510001 WRKLNGTH FB SZ=002
02510003 X'0000'
02510005 WRKDATE FM '99999'
02510010 WRKTIME FM '9999999'
02510017 '0'
02510018 WRKRUID SZ=004
02510022 WRKSEQN FP SZ=006
02510028 WRKJTR SZ=693
027 IF FIRST-TIME NE 'Y' 010 $ skip if not first time
027 CALL US10( '2' TEMP-DATE 0 0 0 0) $ get date/time
027 CALL US15( TEMP-DATE 'P' 'MDY' 'YDD' WRKDATE )
027 CALL US10( '7' 0 0 0 0 WRKTIME)
027 MOVE 'N' TO FIRST-TIME
027010 IF TYPE NE ('BGIN' 'ENDJ' 'ABRT' 'COMT') 020 $ branch
027 IF PROGRAM-NAME EQ ('RHDCRUAL' 'ADSOGEN1' 'RHDCOLM2') DROP
027 MOVE 'Y' TO REPORT-SW $ SET REPORT FLAG
027 CNTRCNTL + 1 CNTRCNTL $ increment counters
027 WWRKSEQN + 1 WWRKSEQN
027 MOVE WWRKSEQN TO WRKSEQN
027 27 + REC-LEN WRKLNGTH $ ADD HDR LENGTH TO
027 $ EXISTING JRNL LENGTH
027 MOVE TRANSACT-IDC TO WRKRUID
027 MOVE REC-LEN TO TEMP-REC-LEN
027 $ MOVE RAW JOURNAL
027 $ DIRECTLY TO O/P
027 $ BUFFER
027 CALL US45(REC-LEN WRKJTR TEMP-REC-LEN 693 ' ')
027 TAKE $ WRITE THE BUFFER
$
$ THE PLAYERS:
$
$ REC-LEN: THE RDW OF THE PHYSICAL JOURNAL RECORD
$
$ COMPUTED: THE NET AMOUNT OF RECORD DATA ON THIS JOURNAL
$ RECORD (RDW - 68 BYTES OVERHEAD)
$
$ IMAGE-LEN: THE CONCEPTUAL LENGTH OF THE RECORD DATA ON THIS
$ JOURNAL RECORD IF IT WERE NOT SPANNED (WHICH IT MAY
$ OR MAY NOT BE)(IF A JOURNAL EVENT IS SPANNED, ALL
$ PIECES WOULD HAVE THE SAME IMAGE-LEN)
$
$ PREFIX-LEN: THE LENGTH OF THE PREFIX BYTES INCLUDED IN THE
$ IMAGE-LEN VALUE (THE SAME VALUE APPEARS FOR ALL
$ PIECES OF A SCANNED JOURNAL EVENT , EVEN WHEN THE
$ NON-FIRST PIECE(S) DO NOT INCLUDE THE PREFIX
$
$ SPAN-OFFSET: THE NUMBER OF CHARACTERS FOR THIS JOURNAL EVENT
$ ALREADY INCLUDED ON A PREVIOUS JOURNAL RECORD
$ (PIECE 1 OF SPANNED EVENT WOULD ALWAYS HAVE A 0
$ SPAN-OFFSET VALUE, SUBSEQUENT PIECES MUST HAVE A
$ NON-ZERO SPAN-OFFSET VALUE
$
$ SLIDE-AMT: THE NUMBER OF BYTES THE RECORD DATA WITHIN THE
$ CURRENT JOURNAL RECORD WILL BE LEFT SHIFTED TO
$ FILL THE SPACE FREED BY REMOVING THE PREFIX BYTES
$ FROM THE RECORD DATA PORTION OF THE JRNL RECORD
$
027020 IF TYPE NE ('BFOR' 'AFTR') DROP $ IF AN UNWANTED TYPE, DROP IT
$
027 $ COMPUTE THE AMOUNT OF ACTUAL
027 COMPUTE REC-LEN - 68 COMPUTED $ RECORD DATA ON THIS RECORD
$
027 $ IF THE CONCEPTUAL RECORD DATA
027 IF IMAGE-LEN LE PREFIX-LEN DROP $ CONTAINS ONLY POINTERS, DROP
$
027 $ IF A NON-SPANNED (OR PART 1
027 $ OF A SPANNED) EVENT, AND THE
027 $ ACTUAL RECORD DATA DOES NOT
027 $ EXCEED THE LENGTH OF THE
027 $ PREFIX BYTES, DROP IT
027 IF (COMPUTED LE PREFIX-LEN) AND (SPAN-OFFSET EQ 0) DROP
$
027 $ CALCULATE HOW MUCH RECORD
027 $ DATA IS CONTAINED ON THIS
027 $ AND ANY PREVIOUS PARTS OF
027 $ THIS JOURNAL EVENT
027 COMPUTED + SPAN-OFFSET TEMP-VAL
$
027 $ IF A SPANNED EVENT, AND THE
027 $ ACCUMULATED RECORD DATA DOES
027 $ NOT EXCEED THE LENGTH OF THE
027 $ PREFIX BYTES, DROP IT
027 IF (SPAN-OFFSET GT 0) AND (TEMP-VAL LE PREFIX-LEN) DROP
$
027 MOVE 'Y' TO REPORT-SW $ SET REPORT FLAG
$
027 $ POPULATE TEMP FIELDS WITH
027 $ THE CORRESPONDING ""REAL""
027 $ VALUES
027 MOVE REC-LEN TO TEMP-REC-LEN
027 MOVE IMAGE-LEN TO TEMP-IMAGE-LEN
027 MOVE PREFIX-LEN TO TEMP-PREFIX-LEN
027 MOVE SPAN-OFFSET TO TEMP-SPAN-OFFSET
$
027 $ INCREMENT THE COUNTERS
027 WWRKSEQN + 1 WWRKSEQN
027 MOVE WWRKSEQN TO WRKSEQN
$
027 $ ADD THE HDR LENGTH TO THE
027 $ EXISTING JRNL RECORD LENGTH
===> Scroll ===> CSR
027 27 + REC-LEN WRKLNGTH
$
027 $ POPULATE THE RUN UNIT ID
027 MOVE TRANSACT-IDC TO WRKRUID
$
027 $ MOVE THE RAW JOURNAL DATA
027 $ INTO THE ""FROM"" AND ""TO""
027 $ BUFFERS
027 CALL US45(REC-LEN WRKJTR-TEMP TEMP-REC-LEN 693 ' ')
027 CALL US45(REC-LEN WRKJTR TEMP-REC-LEN 693 ' ')
$
027 $ SET THE DEFAULT SLIDE AMOUNT
027 $ TO ZERO
027 MOVE 0 TO SLIDE-AMT
$
027 $ IF THIS JOURNAL EVENT IS
027 $ CONTAINED IN THIS RECORD
027 $ (I.E. THE ACTUAL RECORD DATA
027 $ EQUALS THE CONCEPTUAL RECORD
027 IF COMPUTED = IMAGE-LEN 030 $ DATA, GO TO APPROPRIATE CODE
$
027 $ IF THIS RECORD IS PART 1
027 $ OF A MULTI-PART JOURNAL EVENT
027 $ (I.E. PART 1 OF A SPANNED
027 $ RECORD, GO TO THE APPROPRIATE
027 IF SPAN-OFFSET = 0 030 $ CODE
$
027 $ IF NEITHER OF THE ABOVE,
027 $ WE ARE IN PART 2+ OF A SPANNED
027 $ EVENT; GO TO THE APPROPRIATE
027 B 040 $ CODE
$
027 $ IF HERE, WE HAVE PREFIX AND
027 $ SOME OR ALL DATA ON THIS
027 $ JOURNAL RECORD, SET THE
027 $ SLIDE AMOUNT TO THE PREFIX
027 $ LENGTH ITSELF, AND BRANCH
027030 MOVE TEMP-PREFIX-LEN TO SLIDE-AMT
$
027 $ IF HERE, WE MAY HAVE SOME
027 $ PREFIX AND THE SOME OR ALL
027 $ OF THE REMAINDER DATA
$
027 $ IF THE PREFIX WAS ""GOBBLED""
027 $ ON A PREVIOUS JOURNAL RECORD
027 $ THEN WE SLIDE NOTHING, BRANCH
027040 IF TEMP-SPAN-OFFSET GE TEMP-PREFIX-LEN 100
$
027 $ IF HERE, THERE IS SOME BUT
027 $ NOT ALL OF THE PREFIX
027 $ REMAINING TO BE GOBBLED - WE
027 $ SLIDE ONLY THE REMAINING, NOT
027 $ THE ENTIRE PREFIX LENGTH
027 TEMP-PREFIX-LEN - TEMP-SPAN-OFFSET SLIDE-AMT
$
027 $ DETERMINE WHERE IN THE ""FROM""
027 $ BUFFER WHERE TO START SLIDING
027100 65 + SLIDE-AMT SUB1
$
027 $ ADJUST COMPUTED AND RDW FOR
027 $ THE SLIDE AMOUNT
027 COMPUTED - SLIDE-AMT TEMP-COMPUTED
027 TEMP-REC-LEN - SLIDE-AMT TEMP-REC-LEN
$
027 $ DO THE SLIDE
027 CALL US45 (JT-BYTE.SUB1 J-BYTE.65 TEMP-COMPUTED 629 ' ')
$
027 $ MODIFY THE JOURNAL RDW
027 CALL US33 (TEMP-REC-LEN 8 X-LENGTHC 2)
$
027 $ UNCONDITIONALLY SET THE
027 $ PREFIX LENGTH TO ZERO
027 CALL US43 (X'0000' X-PREFIX 2)
$
027 $ IF WE PROCESSED DATA FOR THIS
027 $ EVENT IN A PREVIOUS RECORD,
027 $ BRANCH TO APPROPRIATE CODE
027 IF TEMP-SPAN-OFFSET GT TEMP-PREFIX-LEN 110
$
027 $ IF HERE, THE RECORD WAS MARKED
027 $ AS SPANNED, BUT THE PREVIOUS
027 $ RECORD WAS ONLY PREFIX(AND AS
027 $ SUCH DROPPED), THEN THIS
027 $ RECORD BECOMES PART 1, AND WE
027 $ CAN DROP THE SPANNED COUNT
027 CALL US43 (X'0000' X-OFFSET 2)
027 B 120
$
027 $ IF HERE, WE ADJUST THE SPAN
027 $ OFFSET BY THE AMOUNT OF THE
027 $ PREFIX GOBBLED IN THIS OR A
027 $ PREVIOUS RECORD
027110 TEMP-SPAN-OFFSET - TEMP-PREFIX-LEN TEMP-SPAN-OFFSET
027 CALL US33 (TEMP-SPAN-OFFSET 8 X-OFFSETC 2)
$
027 $ ADJUST THE CONCEPTUAL LENGTH
027 $ BY THE TOTAL PREFIX LENGTH
027120 TEMP-IMAGE-LEN - PREFIX-LEN TEMP-IMAGE-LEN
027 CALL US33 (TEMP-IMAGE-LEN 8 X-IMAGEC 2)
$
027 $ ADJUST THE O/P RDW BY THE
027 $ PHYSICAL SLIDE AMOUNT
027 WRKLNGTH - SLIDE-AMT WRKLNGTH
$
027 $ WRITE THE OUTPUT
027 TAKE
990 USER-OUT-COUNT 0
990 CTRL-OUT-COUNT 0
990 RECORD-OUT-COUNT.100 0
990 TOTAL-IN-COUNT 0
990 SUB1 0
99OUT 080 D NS(XXXX)
99SORT NOSORT
99510001 ' TOTAL USER RECORDS OUT= '
99510028 USER-OUT-COUNT FM 'ZZZZZZZ9'
99520001 ' TOTAL CTRL RECORDS OUT= '
99520028 CTRL-OUT-COUNT FM 'ZZZZZZZ9'
99530001 ' TOTAL '
99530010 X-RECORD-ID.SUB1 FM '9999'
99530014 ' RECORDS OUT= '
99530028 RECORD-OUT-COUNT.SUB1 FM 'ZZZZZZZ9'
99540001 ' TOTAL RECORDS INPUT = '
99540028 TOTAL-IN-COUNT FM 'ZZZZZZZ9'
$
997 IF EOF EQ 900 $ if at end, print totals
997 TOTAL-IN-COUNT + 1 TOTAL-IN-COUNT $ incr in count
$
$ if not accepted by prev
997 IF REPORT-SW NE 'Y' DROP $ process, drop it
$
997 IF TYPE EQ 'USER' 010 $ if type user ...
$
997 IF TYPE EQ ('BGIN' 'ENDJ' 'ABRT' 'COMT') 020 $ if a ctrl type ..
$
997 IF TYPE EQ ('BFOR' 'AFTR') 030 $ if a bfor/aftr ...
$
997 DROP $ if none of the above ...
$
997010 USER-OUT-COUNT + 1 USER-OUT-COUNT $ increment counts
997 DROP $ get out
$
997020 CTRL-OUT-COUNT + 1 CTRL-OUT-COUNT $ increment counts
997 DROP $ get out
$
997030 MOVE 0 TO SUB1 $ loop throught table
997031 SUB1 + 1 SUB1 $ looking for match
$
997 IF SUB1 GT 100 STOP $ if at end .. an error
997 IF X-RECORD-ID.SUB1 EQ 9999 STOP $ if no match, an error
$
997 $ if this entry is not a
997 IF USER-REC-ID NE X-RECORD-ID.SUB1 031 $ match, try the next
$
997 $ if a match, increment
997 RECORD-OUT-COUNT.SUB1 + 1 RECORD-OUT-COUNT.SUB1
997 DROP $ get out
$
997 $ print the user & ctrl
997900 RELS (1,2) $ counts
$
997 MOVE 0 TO SUB1 $ loop through to
997901 SUB1 + 1 SUB1 $ PRINT RECORD TYPE TOTLS
997 IF SUB1 GT 100 STOP $ IF AT END ERROR
997 IF X-RECORD-ID.SUB1 EQ 9999 910 $ EOF MARKER? PRNT IN TOT
997 RELS 3 $ PRINT THIS LINE
997 B 901 $ LOOK AT NEXT
997910 RELS 4 $ PRINT IN TOTALS
997 DROP $ SAY GOODBYE



this was very specific to the needs of the application, but this may
provide help in looking at a journal archive to pull out data
ps - i had LOTS of help from Cal Domingue (forgive misspelling) in figuring
out the journal internals ...














This is Chris Hoelscher and I approved this message!

Chris Hoelscher
Senior IDMS & DB2 Database Administrator
Humana Inc
502-476-2538
choelscher@humana.com



The information transmitted is intended only for the person or entity to which it is addressed and may contain CONFIDENTIAL material. If you receive this material/information in error, please contact the sender and delete or destroy the material/information.
"
IDMS Public Discussion Forum
IDMS-L@LISTSERV.IUASSN.COM
SMTP
IDMS-L@LISTSERV.IUASSN.COM
IDMS-L@LISTSERV.IUASSN.COM
SMTP








Normal

Normal
Re: [IDMSVENDOR-L] Journal extracts to flat files
"yes - i inherited a system that ran a journal exit to extraxct data as the
journal was offloaded - i replace it with a post-offload program
(CA-CULPRIT, imagine that) that read the journal, and extracted data for
loading to another DB (the only reason I touched it was the R14 journal
changes that required changes)

i will see if i can find it


This is Chris Hoelscher and I approved this message!

Chris Hoelscher
Senior IDMS & DB2 Database Administrator
Humana Inc
502-476-2538
choelscher@humana.com



The information transmitted is intended only for the person or entity to which it is addressed and may contain CONFIDENTIAL material. If you receive this material/information in error, please contact the sender and delete or destroy the material/information.
"
IDMS Public Discussion Forum
IDMS-L@LISTSERV.IUASSN.COM
SMTP
IDMS-L@LISTSERV.IUASSN.COM
IDMS-L@LISTSERV.IUASSN.COM
SMTP








Normal

Normal
Re: Java Web Service to IDMS Server
"Hi Hal,

Thanks for the offer. I'll get in touch if the need arises.

Also, thanks to discussions with Dave Dillon (CA Tech Support - another
one of Joh Gocher's friends held in high esteem), I have provided info
to the local bureaucracy on the possibility of hosting the app on
Websphere and issuing an HTTPS request for the app from the Windows
platform. The app would then issue the SQL calls using IDMS Server.

If there are any samples of this process in LISTSERV land, I would
appreciate it.

""I KNOW Jon Gocher. He's a very good friend of mine. I am not a Jon
Gocher."" ---- But, some day I plan to grow up and be just like him...


Take Care,
Bruce
Office: (717) 605-2019
Cell: (610) 468-9506

Outcomes