Journal class: Difference between revisions
mNo edit summary |
mNo edit summary |
||
Line 4: | Line 4: | ||
To extract information programmatically about the contents of a "<var>Journal object</var>", you use the methods of the <var>Journal</var> class. To view such a journal's actual data, you use the <var>[[Stringlist_class|Stringlist]]</var> class <var>[[AppendJournalData (Stringlist function)|AppendJournalData]]</var> function, or you can use <var class="product">[[SirScan]]</var>, which implicitly calls <var>AppendJournalData</var>. | To extract information programmatically about the contents of a "<var>Journal object</var>", you use the methods of the <var>Journal</var> class. To view such a journal's actual data, you use the <var>[[Stringlist_class|Stringlist]]</var> class <var>[[AppendJournalData (Stringlist function)|AppendJournalData]]</var> function, or you can use <var class="product">[[SirScan]]</var>, which implicitly calls <var>AppendJournalData</var>. | ||
The <var>Journal</var> class is available in <var class="product">[[Sirius Mods | The <var>Journal</var> class is available in <var class="product">[[Sirius Mods]]</var> Version 7.7 and later. | ||
The <var>Journal</var> class operates on CCAJRNL or CCAJLOG datasets or streams, which you make available to your Online by any of the following: | The <var>Journal</var> class operates on CCAJRNL or CCAJLOG datasets or streams, which you make available to your Online by any of the following: | ||
Line 11: | Line 11: | ||
<li>A VSE DLBL card. | <li>A VSE DLBL card. | ||
<li>A CMS FILEDEF command. | <li>A CMS FILEDEF command. | ||
<li>A <var class="product">[[Model 204]]</var> ALLOCATE command (see the | <li>A <var class="product">[[Model 204]]</var> ALLOCATE command (see the <i>Model 204 Command Reference Manual</i>). | ||
<li>A <var class="product">[[Model 204]]</var> DEFINE STREAM command (see the | <li>A <var class="product">[[Model 204]]</var> DEFINE STREAM command (see the <i>Model 204 Command Reference Manual</i>). | ||
</ul> | </ul> | ||
Revision as of 19:13, 20 May 2011
The Journal class provides an object-oriented interface to CCAJLOG or CCAJRNL datasets and streams, including those that have been aggregated by the MERGE utility. A Model 204 stream is a datastream comprising one or more sequential journals which is created by the Model 204 DEFINE STREAM command (see the Model 204 Command Reference Manual).
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.
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 (see the Model 204 Command Reference Manual).
- A Model 204 DEFINE STREAM command (see the Model 204 Command Reference Manual).
The "List of Journal methods" lists all the methods in this class.
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)