Journal class: Difference between revisions
m (Created page with "<!-- Journal class --> The Journal class provides an object-oriented interface to CCAJLOG or CCAJRNL datasets and streams, including those that have been aggregated by the MERGEJ...") |
mNo edit summary |
||
(12 intermediate revisions by 4 users not shown) | |||
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 [[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 | ||
CCAJLOG or CCAJRNL datasets and streams, including those that have | <var class="product">Model 204</var> <var>[[DEFINE STREAM command|DEFINE STREAM]]</var> command. | ||
been aggregated by the MERGEJ utility. | |||
A | |||
datastream comprising one or more sequential journals which is created by the | |||
DEFINE STREAM command | |||
To extract information programmatically | 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>. | ||
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 | |||
or you use [[SirScan]], which implicitly calls AppendJournalData. | |||
The Journal class is available in | The <var>Journal</var> class is available in <var class="product">[[Sirius Mods]]</var> Version 7.7 and later. | ||
__TOC__ | |||
The Journal class operates on CCAJRNL or CCAJLOG datasets or streams, | |||
which you make available to your Online by any of the following: | ==Preparing the Model 204 Online== | ||
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: | |||
<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 | <li>A <var class="product">Model 204</var> <var>[[ALLOCATE command|ALLOCATE]]</var> command. | ||
<li>A | <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: | |||
<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 | |||
* 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 | |||
</nowiki></p> | |||
The result is: | The result is: | ||
< | <p class="output"><nowiki>%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) | |||
</nowiki></p> | |||
==List of Journal 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.