Journal class

From m204wiki
Jump to navigation Jump to search

The Journal class provides an object-oriented interface to CCAJLOG or CCAJRNL datasets and streams, including those that have been aggregated by the MERGEJ utility. A Model 204 stream is a datastream comprising one or more sequential journals which is created by the Model 204 DEFINE STREAM command.

To extract information programmatically about the contents of a "Journal object," you use the methods of the Journal class. To view such a journal's actual data, you use the Stringlist class AppendJournalData function, or you can use SirScan, which implicitly calls AppendJournalData.

The Journal class is available in Sirius Mods Version 7.7 and later.

Preparing the Model 204 Online

The Journal class operates on CCAJRNL or CCAJLOG datasets or streams, which you make available to your Online by any of the following:

  • An MVS DD card.
  • A VSE DLBL card.
  • A CMS FILEDEF command.
  • A Model 204 ALLOCATE command.
  • A Model 204 DEFINE STREAM command.

Journal example

The following example is a program that displays the properties and contents of a historical CCAJRNL. The request makes use of a low setting of the parameter option MAXREC of the AppendJournalData method to control the amount of journal data that is displayed:

begin %list is object stringlist %rc is float %jStartTime is longstring %jEndTime is longstring %journal is object journal %msg is longstring %sTime is longstring %eTime is longstring %jHold is longstring %parm is longstring %threads is longstring * Get old journal and view its properties %journal = new('OLDJRNL') if %journal eq Null then %msg = 'Journal is invalid or not allocated.' jump to someErrorCondition end if printText {~} is {%journal:isMerged:tostring} printText {~} is {%journal:MergeCount} printText {~} is {%journal:stringFirstDateTime} printText {~} is {%journal:stringLastDateTime} * Set values for appendJournalData call %list = new %parm = 'AA USER MAXREC=100' %threads = '*' %sTime = '1012202370444' %eTime = '1012302373097' * Test for time values that are out of range %jStartTime = %journal:stringFirstDateTime %jEndTime = %journal:stringLastDateTime if %sTime ge %jEndTime:subString(2) Then %jHold = %jEndTime %msg = 'Requested start time is after end of journal.' jump to someErrorCondition elseIf %eTime lt %jStartTime:subString(2) then %jHold = %jStartTime %msg = 'Requested end time is before start of journal.' jump to someErrorCondition end if * Call the method %rc = %list:appendJournalData( - StartTime=%sTime, - EndTime=%eTime, - Options=%parm, - Threads=%threads, - journal=%journal) print %list:count AND 'list items:' if %list:count eq 0 then Print %rc And 'is return code' end if %list:print someErrorCondition: * do some error processing here Print %msg end

The result is:

%journal:isMerged:tostring is False %journal:MergeCount is 0 %journal:stringFirstDateTime is 11012202370444 %journal:stringLastDateTime is 11012509464897 100 list items: 0 ************************************************************************** 0 * MODEL 204 IS PROPRIETARY TO AND A REGISTERED TRADEMARK OF COMPUTER * 0 * CORPORATION OF AMERICA. ALL TITLE, COPYRIGHT AND OTHER PROPRIETARY * 0 * RIGHTS SHALL BE RETAINED BY COMPUTER CORPORATION OF AMERICA. MODEL 204 * 0 * HAS BEEN LICENSED BY THIS CUSTOMER AND THE USE AND PROTECTION OF * 0 * MODEL 204 IS GOVERNED BY THE LICENSE AGREEMENT BETWEEN THE CUSTOMER * 0 * AND COMPUTER CORPORATION OF AMERICA. * 0 * * 0 * COPYRIGHT (C) 2010 COMPUTER CORPORATION OF AMERICA * 0 * ALL RIGHTS RESERVED * 0 ************************************************************************** 0 M204.0060: MODEL 204 INITIALIZATION. VERSION = 7.2.0D EVCP/RSQL VERSION = 7.2.0D 03/01/10 23.11 0 M204.0061: SMF SYSTEM ID = CMS, JOB NAME = ULSPFPRO, STEP NAME = 02?³?2, JES ID = 0 M204.0062: EXECUTE PARAMETERS: SYSOPT=187,LIBUFF=1600,NJBUFF=31, RESTARTU=1,SIRTUNE=0 0 M204.1119: READING PARAMETERS . . . (70+ lines not shown)

List of Journal methods

List of Journal methods contains a complete list of the class methods.