BadJournal class: Difference between revisions

From m204wiki
Jump to navigation Jump to search
m (1 revision)
m (tags and edits)
Line 1: Line 1:
<!-- BadJournal class -->
<!-- BadJournal class -->
The BadJournal exception class reports
The <var>BadJournal</var> exception class reports errors in CCAJRNL or CCAJLOG datasets or streams, including naming errors, that are encountered by the <var>[[Journal class]]</var> constructor.
errors in CCAJRNL or CCAJLOG datasets or streams, including naming errors,
<p>An instance of the <var>BadJournal</var> exception class may be automatically thrown by the "<var>[[New (Journal constructor)|Journal Class New Constructor]]</var>", or explicitly with the "<var>[[New_(BadJournal_constructor)|BadJournal Class New Constructor]]</var>".</p>
that are encountered by the [[Journal class]] constructor.
   
   
The [[New (Journal constructor)|New]] constructor of the Journal system class
==Examples==
is the system method that automatically throws a BadJournal exception.
<ol><li>The following example shows a "[[Try and Catch]]" of a <var>Journal</var> class, <var>New</var> method, exception. An invalid journal name is specified to generate the <var>BadJournal</var> exception:
For information about catching a thrown exception, see [[??]] refid=tryctch..
<p class="code">begin
  %sl        is object stringlist
The following example shows a Try and Catch of a Journal class, New method,
  %rc        is float
exception.
  %journal  is object journal
An invalid journal name is specified to generate the BadJournal exception:
  %bdjrnl    is object badJournal
<p class="code"> Begin
 
  try printtext {~} is: {%journal = new('OLD~RNL')}
%sl        is object stringlist
   catch badJournal to %bdjrnl
%rc        is float
      print 'Failure!!! Reason code is: ' %bdjrnl:reasonCode
%journal  is object journal
  end try
%bdjrnl    is object BadJournal
 
  %rc = %sl:appendJournalData( -
try printtext {~} is: {%journal = new('OLD~RNL')}
            Options='MAXIO=1000 WIDTH=138 ST AA USER', -
   catch BadJournal to %bdjrnl
            Threads='*', Journal=%journal)
  Print 'Failure!!! Reason code is: ' %bdjrnl:reasonCode
  print %rc
end try
  print %sl:count
  %sl:print
%rc = %sl:appendJournalData( -
end
          Options='MAXIO=1000 WIDTH=138 ST AA USER', -
          Threads='*', Journal=%journal)
Print %rc
Print %sl:count
%sl:print
End
</p>
</p>
<var>[[AppendJournalData_(Stringlist_function)|AppendJournalData]]</var> does not cancel if its <var class="term>Journal</var> parameter is <var>null</var>. The request result shows the reason code stored in the exception object:
The AppendJournalData method does not cancel if its Journal parameter is null.
<p class="output"> %journal = new('OLD~RNL') is: Failure!!! Reason code is: 1
The request result shows the reason code stored in the exception object:
<p class="code"> %journal = new('OLD~RNL') is: Failure!!! Reason code is: 1
  0
  0
  0
  0
</p>
</p>
'''Note:'''
<b><i>Note:</i></b> In order to display the reason code associated with the request, the exception is caught to a <var>BadJournal</var> object variable, against which the <var>[[ReasonCode_(BadJournal_property)|ReasonCode]]</var> method runs.
In order to display the reason code associated with the request,
</ol>
the exception is caught to a BadJournal object variable, against which
the ReasonCode method runs.
   
   
The methods in this class are listed at "[[List of BadJournal methods]]".
==Usage Notes==
<ul><li>The <var>BadJournal</var> class is available as of <var class="product">[[Sirius Mods|"Sirius Mods"]]</var> Version 7.8.
</ul>
 
==See Also==
<ul><li>For information about catching a thrown exception, see "[[Try and Catch]]".
<li>The methods in this class are listed at "[[List of BadJournal methods]]".</ul>
[[Category:System exception classes]]
[[Category:System exception classes]]
The BadJournal class is available as of <var class="product">Sirius Mods</var> version 7.8.

Revision as of 06:36, 10 April 2011

The BadJournal exception class reports errors in CCAJRNL or CCAJLOG datasets or streams, including naming errors, that are encountered by the Journal class constructor.

An instance of the BadJournal exception class may be automatically thrown by the "Journal Class New Constructor", or explicitly with the "BadJournal Class New Constructor".

Examples

  1. The following example shows a "Try and Catch" of a Journal class, New method, exception. An invalid journal name is specified to generate the BadJournal exception:

    begin %sl is object stringlist %rc is float %journal is object journal %bdjrnl is object badJournal try printtext {~} is: {%journal = new('OLD~RNL')} catch badJournal to %bdjrnl print 'Failure!!! Reason code is: ' %bdjrnl:reasonCode end try %rc = %sl:appendJournalData( - Options='MAXIO=1000 WIDTH=138 ST AA USER', - Threads='*', Journal=%journal) print %rc print %sl:count %sl:print end

    AppendJournalData does not cancel if its Journal parameter is null. The request result shows the reason code stored in the exception object:

    %journal = new('OLD~RNL') is: Failure!!! Reason code is: 1 0 0

    Note: In order to display the reason code associated with the request, the exception is caught to a BadJournal object variable, against which the ReasonCode method runs.

Usage Notes

  • The BadJournal class is available as of "Sirius Mods" Version 7.8.

See Also