Journal class: Difference between revisions

From m204wiki
Jump to navigation Jump to search
mNo edit summary
m (tags and edits)
Line 1: Line 1:
<!-- Journal class -->
<!-- Journal class -->
The Journal class provides an object-oriented interface to
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 <var class="product">[[Model 204]]</var> DEFINE STREAM command (see the [[Model 204 Command Reference Manual]]).
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 (see the [[Model 204 Command Reference Manual]]).
   
   
To extract information programmatically
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>.
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 (Stringlist function)|AppendJournalData]] function
&mdash;
or you use [[SirScan]], which implicitly calls AppendJournalData.
   
   
The Journal class is available in ''Sirius Mods'' 7.7 and later.
The <var>Journal</var> class is available in <var class="product">[[Sirius Mods|"Sirius Mods"]]</var> Version 7.7 and later.
   
   
The Journal class operates on CCAJRNL or CCAJLOG datasets or streams,
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:
which you make available to your Online by any of the following:
<ul>
<ul>
<li>An MVS DD card.
<li>An MVS DD card.
<li>A VSE DLBL card.
<li>A VSE DLBL card.
<li>A CMS FILEDEF command.
<li>A CMS FILEDEF command.
<li>A ''Model 204'' ALLOCATE command (see the ''Model 204 Command Reference Manual'').
<li>A <var class="product">[[Model 204]]</var> ALLOCATE command (see the [[Model 204 Command Reference Manual]]).
<li>A ''Model 204'' DEFINE STREAM command (see the ''Model 204 Command Reference Manual'').
<li>A <var class="product">[[Model 204]]</var> DEFINE STREAM command (see the [[Model 204 Command Reference Manual]]).
</ul>
</ul>


The [[List of Journal methods]] lists all the methods in this class.
The "[[List of Journal methods]]" lists all the methods in this class.


==Journal example==
==Journal example==
<ol><li>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 class="term">MAXREC</var> of the <var>AppendJournalData</var> method to control the amount of journal data that is displayed:
<p class="code"><nowiki>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
   
   
The following example is a program that displays the properties and contents of a
  * Get old journal and view its properties
historical CCAJRNL.
  %journal = new('OLDJRNL')
The request makes use of a low setting of the parameter option MAXREC of the
  if %journal eq Null then
AppendJournalData method to control the amount of journal data that is displayed:
      %msg = 'Journal is invalid or not allocated.'
<!-- pre style="xmp"-->
      jump to someErrorCondition
    Begin
  end if
    %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'''
  printText {~} is {%journal:isMerged:tostring}
    %journal = new('OLDJRNL')
  printText {~} is {%journal:MergeCount}
    if %journal eq Null then
  printText {~} is {%journal:stringFirstDateTime}
      %msg = 'Journal is invalid or not allocated.'
  printText {~} is {%journal:stringLastDateTime}
      jump to someErrorCondition
    end if
   
   
    printText {~} is {%journal:isMerged:tostring}
  * Set values for appendJournalData call
    printText {~} is {%journal:MergeCount}
  %list = new
    printText {~} is {%journal:stringFirstDateTime}
  %parm = 'AA USER MAXREC=100'
    printText {~} is {%journal:stringLastDateTime}
  %threads = '*'
  %sTime = '1012202370444'
  %eTime = '1012302373097'
   
   
    '''* Set values for appendJournalData call'''
  * Test for time values that are out of range
    %list = new
  %jStartTime = %journal:stringFirstDateTime
    %parm = 'AA USER MAXREC=100'
  %jEndTime  = %journal:stringLastDateTime
    %threads = '*'
  if %sTime ge %jEndTime:subString(2) Then
    %sTime = '1012202370444'
      %jHold = %jEndTime
    %eTime = '1012302373097'
      %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
   
   
    '''* Test for time values that are out of range'''
  * Call the method
    %jStartTime = %journal:stringFirstDateTime
  %rc = %list:appendJournalData(  -
    %jEndTime   = %journal:stringLastDateTime
              StartTime=%sTime,   -
     if %sTime ge %jEndTime:subString(2) Then
              EndTime=%eTime,     -
      %jHold = %jEndTime
              Options=%parm,      -
      %msg = 'Requested start time is after end of journal.'
              Threads=%threads,  -
      jump to someErrorCondition
              journal=%journal)
    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'''
  print %list:count AND 'list items:'
    %rc = %list:appendJournalData(  -
  if %list:count eq 0 then
                StartTime=%sTime,  -
      Print %rc And 'is return code'
                EndTime=%eTime,    -
  end if
                Options=%parm,      -
  %list:print
                Threads=%threads,  -
                journal=%journal)
   
   
    Print %list:count AND 'list items:'
  someErrorCondition:
    If %list:count eq 0 then
        * do some error processing here
      Print %rc And 'is return code'
        Print %msg
    End If
    %list:print
   
   
    someErrorCondition:
end
          * do some error processing here
</nowiki></p>
          Print %msg
    End
<!-- /pre-->
   
   
The result is:
The result is:
<!-- pre style="xmp"-->
<p class="output"><nowiki>  %journal:isMerged:tostring is False
    %journal:isMerged:tostring is False
  %journal:MergeCount is 0
    %journal:MergeCount is 0
  %journal:stringFirstDateTime is 11012202370444
    %journal:stringFirstDateTime is 11012202370444
  %journal:stringLastDateTime is 11012509464897
    %journal:stringLastDateTime is 11012509464897
  100 list items:
    100 list items:
      0 ************************************************************************
        0 ************************************************************************
        **
          **
      0 * MODEL 204 IS PROPRIETARY TO AND A REGISTERED TRADEMARK OF COMPUTER
        0 * MODEL 204 IS PROPRIETARY TO AND A REGISTERED TRADEMARK OF COMPUTER
          *
            *
      0 * CORPORATION OF AMERICA. ALL TITLE, COPYRIGHT AND OTHER PROPRIETARY
        0 * CORPORATION OF AMERICA. ALL TITLE, COPYRIGHT AND OTHER PROPRIETARY
          *
            *
      0 * RIGHTS SHALL BE RETAINED BY COMPUTER CORPORATION OF AMERICA. MODEL
        0 * RIGHTS SHALL BE RETAINED BY COMPUTER CORPORATION OF AMERICA. MODEL
          204 *
          204 *
      0 * HAS BEEN LICENSED BY THIS CUSTOMER AND THE USE AND PROTECTION OF
        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 * MODEL 204 IS GOVERNED BY THE LICENSE AGREEMENT BETWEEN THE CUSTOMER
          *
            *
      0 * AND COMPUTER CORPORATION OF AMERICA.
        0 * AND COMPUTER CORPORATION OF AMERICA.
          *
            *
      0 *
        0 *
          *
            *
      0 * COPYRIGHT (C) 2010 COMPUTER CORPORATION OF AMERICA
        0 * COPYRIGHT (C) 2010 COMPUTER CORPORATION OF AMERICA
          *
            *
      0 * ALL RIGHTS RESERVED
        0 * ALL RIGHTS RESERVED
          *
            *
      0 ************************************************************************
        0 ************************************************************************
        **
          **
      0 M204.0060: MODEL 204 INITIALIZATION.  VERSION = 7.2.0D    EVCP/RSQL
        0 M204.0060: MODEL 204 INITIALIZATION.  VERSION = 7.2.0D    EVCP/RSQL
          VERSION = 7.2.0D  03/01/10 23.11
          VERSION = 7.2.0D  03/01/10 23.11
      0 M204.0061: SMF SYSTEM ID = CMS, JOB NAME = ULSPFPRO, STEP NAME =
        0 M204.0061: SMF SYSTEM ID = CMS, JOB NAME = ULSPFPRO, STEP NAME =
          02?³?2, JES ID =
          02?³?2, JES ID =
      0 M204.0062: EXECUTE PARAMETERS: SYSOPT=187,LIBUFF=1600,NJBUFF=31,
        0 M204.0062: EXECUTE PARAMETERS: SYSOPT=187,LIBUFF=1600,NJBUFF=31,
        RESTARTU=1,SIRTUNE=0
          RESTARTU=1,SIRTUNE=0
      0 M204.1119: READING PARAMETERS
        0 M204.1119: READING PARAMETERS
 
    '''      . . . (70+ lines not shown)'''
          . . . (70+ lines not shown)
<!-- /pre-->
</nowiki></p>
[[Category:System classes]]
[[Category:System classes]]

Revision as of 07:06, 10 April 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:

The "List of Journal methods" lists all the methods in this class.

Journal example

  1. 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)