Journal class: Difference between revisions

From m204wiki
Jump to navigation Jump to search
mNo edit summary
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
<!-- Journal class -->
<!-- Journal class -->
The <var>Journal</var> class provides an object-oriented interface to CCAJLOG or CCAJRNL datasets and streams, including those that have been aggregated by the <var class="product">[[MERGE]]</var> utility. A <var class="product">[[Model 204]]</var> stream is a datastream comprising one or more sequential journals which is created by the  
The <var>Journal</var> class provides an object-oriented interface to CCAJLOG or CCAJRNL datasets and streams, including those that have been aggregated by the [[Media recovery#Merging journals|MERGEJ utility]]. A <var class="product">[[Model 204]]</var> stream is a datastream comprising one or more sequential journals which is created by the  
<var class="product">Model&nbsp;204</var> <var>DEFINE STREAM</var> command (see the <i>[http://www.cca-int.com/custsupp/documentation/catalog.html Model 204 Command Reference Manual]</i>).
<var class="product">Model&nbsp;204</var> <var>[[DEFINE STREAM command|DEFINE STREAM]]</var> command.
   
   
To extract information programmatically about the contents of a "<var>Journal</var> object", 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</var> object," 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]]</var> Version 7.7 and later.
   
   
The <var>Journal</var> class is available in <var class="product">[[Sirius Mods]]</var> Version 7.7 and later.
__TOC__
__TOC__


Line 15: Line 14:
<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> <var>ALLOCATE</var> command (see the <i>Model 204 Command Reference Manual</i>).
<li>A <var class="product">Model 204</var> <var>[[ALLOCATE command|ALLOCATE]]</var> command.
<li>A <var class="product">Model 204</var> <var>DEFINE STREAM</var> command (see the <i>Model 204 Command Reference Manual</i>).
<li>A <var class="product">Model 204</var> <var>DEFINE STREAM</var> command.
</ul>
</ul>


==Journal example==
==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 <var>MAXREC</var> of the <var>AppendJournalData</var> method to control the amount of journal data that is displayed:
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 <var>MAXREC</var> of the <var>AppendJournalData</var> method to control the amount of journal data that is displayed:
<p class="code"><nowiki>begin
<p class="code"><nowiki>begin
   %list      is object stringlist
   %list      is object stringlist
Line 114: Line 113:


==List of Journal methods==
==List of Journal methods==
The [[List of Journal methods|"List of Journal methods"]] contains a complete list of the class methods.
[[List of Journal methods]] contains a complete list of the class methods.


[[Category:System classes]]
[[Category:System classes]]

Latest revision as of 22:01, 9 October 2014

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.