$Cms: Difference between revisions

From m204wiki
Jump to navigation Jump to search
m (misc formatting)
Line 2: Line 2:
<span class="pageSubtitle">Determine if online is running under CMS</span>
<span class="pageSubtitle">Determine if online is running under CMS</span>


<p class="warn"><b>Note: </b>Most Sirius $functions have been deprecated in favor of Object Oriented methods. There is currently no OO equivalent for the $Cms function.</p>
<p class="warn"><b>Note:</b> Many $functions have been deprecated in favor of Object Oriented methods. There is currently no OO equivalent for the <var>$Cms</var> function.</p>


This function can be used to determine if the online is running under CMS.  
The <var>$Cms</var> function determines if the Model&nbsp;204 Online is running under CMS.  


The <var>$Cms</var> function accepts no arguments and returns either a 1 if the online is running under CMS or a 0 otherwise.
==Syntax==
==Syntax==
<p class="syntax">%CMS = $Cms
<p class="syntax">%cms = $Cms </p>
</p>
<p>
<p>
</p>
<var>$Cms</var> accepts no arguments; it returns a 1 if the Online is running under CMS, or it returns a 0 otherwise. n</p>
<p>%CMS is set to either 0 or 1.</p>


This function can be used to test if running under CMS before running any operating system specific code. For example, the program
==Usage notes==
<p class="code"> IF $Cms THEN
<var>$Cms</var> can be used before running any operating system specific code. For example, the following code fragment sets [[Global features#Global string variables|global variable]] <code>NEXTPROC</code> to <code>PROC.CMS</code> if running under CMS, or it sets <code>NEXTPROC</code> to <code>PROC.MVS</code>, otherwise:
%RC = $SETG('NEXTPROC', 'PROC.CMS')
<p class="code">if $cms then
ELSE
%rc = $setg('NEXTPROC', 'PROC.CMS')
%RC = $SETG('NEXTPROC', 'PROC.MVS')
else
END IF
%rc = $setg('NEXTPROC', 'PROC.MVS')
end if
</p>
</p>
would set [[Global_features#Global_string_variables|global variable]] NEXTPROC to 'PROC.CMS' if running under CMS and to 'PROC.MVS', otherwise.


==Products authorizing {{PAGENAMEE}}==  
==Products authorizing {{PAGENAMEE}}==  
Line 33: Line 30:
<li>Japanese functions</li>
<li>Japanese functions</li>
<li>[[Media:SirfieldNew.pdf|Sir2000 Field Migration Facility]]</li>
<li>[[Media:SirfieldNew.pdf|Sir2000 Field Migration Facility]]</li>
</ul>
</ul>
<p>
</p>


[[Category:$Functions|$Cms]]
[[Category:$Functions|$Cms]]

Revision as of 17:04, 24 January 2018

Determine if online is running under CMS

Note: Many $functions have been deprecated in favor of Object Oriented methods. There is currently no OO equivalent for the $Cms function.

The $Cms function determines if the Model 204 Online is running under CMS.

Syntax

%cms = $Cms

$Cms accepts no arguments; it returns a 1 if the Online is running under CMS, or it returns a 0 otherwise. n

Usage notes

$Cms can be used before running any operating system specific code. For example, the following code fragment sets global variable NEXTPROC to PROC.CMS if running under CMS, or it sets NEXTPROC to PROC.MVS, otherwise:

if $cms then %rc = $setg('NEXTPROC', 'PROC.CMS') else %rc = $setg('NEXTPROC', 'PROC.MVS') end if

Products authorizing $Cms