Statement syntax: Difference between revisions

From m204wiki
Jump to navigation Jump to search
 
(310 intermediate revisions by 6 users not shown)
Line 1: Line 1:
==Overview==
This page summarizes SOUL syntax and conventions, which are discussed in more detail throughout this wiki. The SOUL statements are listed in alphabetical order.  Many of the section titles or syntax blocks contain links to the wiki page describing the statement or syntax phrase. A [[#Other syntax|later section]] provides other SOUL syntax information, including links to [[#tokens|information about the "tokens"]] of SOUL, such as names in SOUL.
<p>
<p>
This topic summarizes User Language syntax and conventions, many of which are also discussed throughout this manual.</p>
All SOUL statements can be used between a <var>[[BEGIN command|Begin]]</var> (or <var>[[MORE command|More]]</var>) command and an <var>[[End statement|End]]</var> statement. </p>
<p>External Call Facility (ECF) statements are listed under <var>[[#External|External]]</var>.</p>
<p>
<p>
The statements are listed in alphabetical order. Later sections in this topic provide other User Language syntax information. </p>
Various other [[List of Model 204 commands|Model 204 commands]] also have effects on the results of a SOUL request. </p>
<p>
<p>
All of the User Language statements listed can be used between a BEGIN (or MORE) command and an END (or END MORE) statement. </p>
The following notations prefix some of the statements in the presentation of the SOUL syntax: </p>
<p class="code"><nowiki>*
**
+
++
C
</nowiki></p>
<p>
<p>
All system control commands are presented in the
See the [[#Notation conventions|notation conventions]] section for an explanation of these usages, as well as other general comments about understanding the syntax of SOUL.  
[[List of Model 204 commands]]. </p>
</p>
&nbsp; <!-- Separates intro from toc -->
==Notation conventions==
<div id="User Language statements"></div>  <!-- In case there are links -->
<p>
<div id="SOUL statements"></div>  <div id="SOUL syntax"></div>
This page uses the following syntax notation conventions: </p>
<!--To make above link targets go to toc:-->
   
<!--==SOUL statements in alphabetical order==-->
<table>
 
<tr class="head">
===[[Add statement|Add]]===
<th>Syntax notation </th>
<table class="noBorder">
<th>Indicates that...</th>
</tr>
<tr>
<tr>
<td>Single asterisk (*) </td>
<td style="font-family:monoface; padding-right:0px">[[Statement syntax#Notation conventions|(**)]]</td>
<td>Statements can be preceded by an IN clause, if there is no reference to a previous set (label or list). See [[#IN clause syntax|IN clause syntax]] for more discussion.</td>
<td>{{Template:Add fieldname statement syntax}}</td></tr>
</tr>
</table>
 
<tr>
<table class="noBorder">
<td>Two asterisks (**) </td>
<tr><td style="padding:0em">{{Template:Add lob-fieldname statement syntax}} </td></tr>
<td>Construct can appear only within a record loop.</td>
</tr>
<tr>
<td>Plus sign (+) </td>
<td>Construct requires the optional Horizon feature.</td>
</tr>
<tr>
<td nowrap>Two plus signs (++) </td>
<td>Construct requires the optional User Language to Database 2 feature.</td>
</tr>
<tr>
<td>C</td>
<td>The syntax applies to a <var class="product">Model&nbsp;204</var> command as well as a User Language statement, except any %variable options or clauses.
<p>
<var class="product">Model&nbsp;204</var> commands are listed alphabetically and documented in [[List of Model 204 commands]]. </p></td>
</tr>
<tr>
<td>Lowercase italic </td>
<td>Constructs are replaced with variable information.</td>
</tr>
</table>
</table>
===[[Array statement|Array]]===
   
   
<ul>
<p class="syntaxUL">Array <span class="squareb">[</span><span class="term">arrayname</span><span class="squareb">]</span> Occurs <span class="squareb">{</span><span class="term">n</span> <span class="squareb">|</span> Unknown<span class="squareb">}</span>
<li>A field name (%%) variable can be used anywhere fieldname appears. The %%variable can contain its own subscript, separate from the field name subscript.
  Depending On <span class="squareb">{</span><span class="term">itemname</span> <span class="squareb">|</span> <span class="term">%variable</span><span class="squareb">}</span>
<p class="note"><b>Note: </b>
  <span class="squareb">[</span>After <span class="squareb">{</span><span class="term">itemname</span> <span class="squareb">|</span> <span class="term">arrayname</span><span class="squareb">}</span>
The subscript of an array element must be specified before a field name subscript.</p> </li>
  <span class="squareb">|</span> At <span class="squareb">{</span><span class="term">position</span> <span class="squareb">|</span> <span class="term">itemname</span> <span class="squareb">|</span> <span class="term">imagename1</span> <span class="squareb">|</span> <span class="term">arrayname</span><span class="squareb">}</span><span class="squareb">]</span>
   
<li>The lowercase constructs &mdash; retrieval-conditions, print-specifications, expression, subscript, attribute, and type &mdash; are discussed separately following the syntax summaries, beginning with [[#Value specification syntax|Value specification syntax]].  </li>
</ul>
   
==User Language statements==
   
<p class="syntaxUL"><b><sup>(**)</sup></b>ADD fieldname = <span class="squareb">{</span>value <span class="squareb">|</span> (expression)<span class="squareb">}</span>
  ADD lob-name=BUFFER,position,length [RESERVE n [BYTES]]
</p>
</p>
===[[Assert statement|Assert]]===
   
   
<hr>
{{Template:Assert statement syntax}}
 
===[[Report generation#Audit statement|Audit]]===
   
   
<p class="syntaxUL">ARRAY [arrayname] OCCURS <span class="squareb">{</span>n <span class="squareb">|</span> UNKNOWN<span class="squareb">}</span>
<p class="syntaxUL">Audit <span class="term">[[#Print specification syntax|print-specifications]]</span>
DEPENDING ON <span class="squareb">{</span>itemname <span class="squareb">|</span> %variable<span class="squareb">}</span>
[AFTER <span class="squareb">{</span>itemname <span class="squareb">|</span> arrayname<span class="squareb">}</span>
<span class="squareb">|</span> AT <span class="squareb">{</span>position <span class="squareb">|</span> itemname <span class="squareb">|</span> imagename1 <span class="squareb">|</span> arrayname<span class="squareb">}</span>]
</p>
</p>
===[[Audit All Fieldgroup Information statement|Audit All Fieldgroup Information]] (AAFGI)===
<table class="noBorder">
<tr><td style="font-family:monoface; padding-right:0px">[[Statement syntax#Notation conventions|(**)]] </td>
<td>{{Template:AAFGI statement syntax}} </td></tr>
</table>
===[[Report generation#Audit All Information statement|Audit All Information]]===
   
   
<hr>
<table class="noBorder">
<tr><td>{{Template:Audit All Information statement syntax}} </td></tr>
<p class="syntaxUL">AUDIT print-specifications
</table>
</p>
<hr>
<p class="syntaxUL">AUDIT ALL FIELDGROUP INFORMATION [CTOFIELDS]</p>
<hr>
<p class="syntaxUL"><span class="squareb">{</span>AUDIT ALL INFORMATION <span class="squareb">|</span> AAI<span class="squareb">}</span>
</p>


<hr>
===<b id="BACKOUT"></b>Backout===
<table class="noBorder">
<tr><td/>
<td><p class="syntaxUL">[[Backout statement|Backout]]</p> </td></tr>
</table>


<p class="syntaxUL"><b><sup>(C)</sup></b>BACKOUT</p>
===BYPASS===
<hr>
   
   
<p class="syntaxUL">BYPASS <span class="squareb">[</span>PENDING STATEMENT<span class="squareb">]</span> </p>
<p class="syntaxUL">BYPASS <span class="squareb">[</span>PENDING STATEMENT<span class="squareb">]</span> </p>
   
   
<hr>
===CALL===
   
   
<p class="syntaxUL">CALL <span class="squareb">{</span>label <span class="squareb">|</span> subname  
<p class="syntaxUL">CALL <span class="squareb">{</span><span class="term">label</span> <span class="squareb">|</span> <span class="term">subname</span>
  [([expression <span class="squareb">|</span> %variable <span class="squareb">|</span> [LIST] listname] [,...])]<span class="squareb">}</span>
  <span class="squareb">[</span>(<span class="squareb">[</span><span class="term">expression</span> <span class="squareb">|</span> <span class="term">%variable</span> <span class="squareb">|</span> <span class="squareb">[</span>LIST<span class="squareb">]</span> <span class="term">listname</span><span class="squareb">]</span> <span class="squareb">[</span>,...<span class="squareb">]</span>)<span class="squareb">]</span><span class="squareb">}</span>
</p>
</p>
   
   
<hr>
===[[Data maintenance#Change statement|Change]]===
<table class="noBorder">
<tr><td style="font-family:monoface; padding-right:0px">[[Statement syntax#Notation conventions|(**)]] </td>
<td>{{Template:Change fieldname statement syntax (basic)}} </td></tr>
</table>
   
   
<p class="syntaxUL"><b><sup>(**)</sup></b>CHANGE fieldname <span class="squareb">[</span>(subscript)<span class="squareb">]</span> [= value1 <span class="squareb">|</span> (expression)] TO (value2 <span class="squareb">|</span> (expression))
<table class="noBorder">
<tr>
<td style="padding:0em">{{Template:Change lob-fieldname statement syntax}} </td></tr>
</table>
 
===[[Global_features#Using_the_CLEAR_statement|CLEAR]]===
   
   
  CHANGE lob-fieldname,position1,length TO BUFFER,position2,length [RESERVE n [BYTES]]
{{Template:Clear statement syntax}}
</p>
 
===CLEAR LIST===
<table class="noBorder">
<tr><td style="font-family:monoface; padding-right:0px">[[Statement syntax#Notation conventions|(*)]] </td>
<td><p class="syntaxUL">[[Lists#Clearing a list|CLEAR LIST]] <span class="term">listname</span> </p></td></tr>
</table>
 
===CLEAR ON===
   
   
<hr>
{{Template:Clear On statement syntax}}
 
===CLEAR TAG===
   
   
<p class="syntaxUL">CLEAR <span class="squareb">{</span>[[ALL <span class="squareb">|</span> TEMP <span class="squareb">|</span> LISTFDST <span class="squareb">|</span> POSITION] [GLOBAL]] OBJECTS
<p class="syntaxUL">CLEAR TAG <span class="squareb">{</span><span class="term">screenname</span> <span class="squareb">|</span> <span class="term">%screenname</span>:<span class="term">inputname</span><span class="squareb">}</span>
<span class="squareb">|</span> GLOBALS
<span class="squareb">|</span> GLOBAL <span class="squareb">{</span>IMAGE <span class="squareb">|</span> SCREEN <span class="squareb">|</span> MENU <span class="squareb">|</span> LIST <span class="squareb">|</span> FOUNDSET
<span class="squareb">|</span> POSITION [PERM <span class="squareb">|</span> TEMP]<span class="squareb">}</span>
<span class="squareb">{</span>'objectname' <span class="squareb">|</span> %variable<span class="squareb">}</span><span class="squareb">}</span>
</p>
</p>
   
   
<hr>
===[[Close statement (external I/O)|Close]]===
   
   
<p class="syntaxUL"><b><sup>(*)</sup></b>CLEAR LIST listname </p>
<table class="noBorder">
<tr><td>{{Template:Close statement (external I/O) syntax}} </td></tr>
<hr>
</table>
 
<p class="syntaxUL">CLEAR ON
===CLOSE PROCESS===
  <span class="squareb">{</span>ATTENTION <span class="squareb">|</span> ERROR <span class="squareb">|</span> FIELD CONSTRAINT CONFLICT
<table class="noBorder">
  <span class="squareb">|</span> FIND CONFLICT <span class="squareb">|</span> RECORD LOCKING CONFLICT
<tr><td style="font-family:monoface; padding-right:0px">[[Statement syntax#Notation conventions|(+C)]] </td>
<span class="squareb">|</span> MISSING FILE <span class="squareb">|</span> MISSING MEMBER<span class="squareb">}</span>
<td><p class="syntaxUL">CLOSE PROCESS    <BR>    <span class="squareb">{</span><span class="term">cid</span> <span class="squareb">|</span> <span class="term">processname</span> <span class="squareb">|</span> <span class="term">%variable</span><span class="squareb">}</span>    <BR>    <span class="squareb">[</span>SYNCLEVEL <span class="squareb">|</span> FLUSH <span class="squareb">|</span> <span class="term">%variable</span><span class="squareb">]</span> </p></td></tr>
</table>
 
<p class="syntaxUL">CLOSE PROCESS
  <span class="squareb">{</span><span class="term">cid</span> <span class="squareb">|</span> <span class="term">processname</span> <span class="squareb">|</span> <span class="term">%variable</span><span class="squareb">}</span>
  <span class="squareb">[</span>SYNCLEVEL <span class="squareb">|</span> CONFIRM <span class="squareb">|</span> FLUSH <span class="squareb">|</span> ERROR <span class="squareb">|</span> <span class="term">%variable</span><span class="squareb">]</span>
</p>
</p>


<hr>
===[[Commit statement|Commit]]===
   
   
<p class="syntaxUL">CLEAR TAG <span class="squareb">{</span>screenname <span class="squareb">|</span> %screenname:inputname<span class="squareb">}</span>
{{Template:Commit statement syntax}}
</p>
 
===[[Horizon SOUL interface#Confirm statement|Confirm]]===
<hr>
<table class="noBorder">
<tr><td style="font-family:monoface; padding-right:0px">[[Statement syntax#Notation conventions|(+)]] </td>
<p class="syntaxUL">CLOSE
<td>{{Template:Confirm statement syntax}} </td></tr>
<span class="squareb">{</span>DATASET <span class="squareb">{</span>ext-filename <span class="squareb">|</span> %variable<span class="squareb">}</span>
</table>
<span class="squareb">|</span> [EXTERNAL] <span class="squareb">{</span>ext-filename <span class="squareb">|</span> TERMINAL <span class="squareb">|</span> %variable<span class="squareb">}</span><span class="squareb">}</span>  
 
</p>
===[[Horizon SOUL interface#Confirmed statement|Confirmed]]===
<table class="noBorder">
<tr><td style="font-family:monoface; padding-right:0px">[[Statement syntax#Notation conventions|(+)]] </td>
<td>{{Template:Confirmed statement syntax}} </td></tr>
</table>


<hr>
===CONTINUE===
<p class="syntaxUL"><b><sup>(+C)</sup></b>CLOSE PROCESS
    <span class="squareb">{</span>cid <span class="squareb">|</span> processname <span class="squareb">|</span> %variable<span class="squareb">}</span>
    [SYNCLEVEL <span class="squareb">|</span> FLUSH <span class="squareb">|</span> %variable]
</p>
<hr>
<p class="syntaxUL">CLOSE PROCESS
<span class="squareb">{</span>cid <span class="squareb">|</span> processname <span class="squareb">|</span> %variable<span class="squareb">}</span>
[SYNCLEVEL <span class="squareb">|</span> CONFIRM <span class="squareb">|</span> FLUSH <span class="squareb">|</span> ERROR <span class="squareb">|</span> %variable]
</p>
<hr>
<p class="syntaxUL">COMMIT <span class="squareb">[</span>RELEASE<span class="squareb">]</span></p>
<hr>
<p class="syntaxUL"><b><sup>(+)</sup></b>CONFIRM <span class="squareb">{</span>cid <span class="squareb">|</span> processname <span class="squareb">|</span> %variable<span class="squareb">}</span>
        REQSEND %variable
</p>
<hr>
<p class="syntaxUL"><b><sup>(+)</sup></b>CONFIRMED <span class="squareb">{</span>cid <span class="squareb">|</span> processname <span class="squareb">|</span> %variable<span class="squareb">}</span>
</p>
<hr>
   
   
<p class="syntaxUL">CONTINUE</p>
<p class="syntaxUL">CONTINUE</p>
   
   
<hr>
===COUNT OCCURRENCES OF===
<table class="noBorder">
<p class="syntaxUL"><b><sup>(**)</sup></b>COUNT OCCURRENCES OF fieldname</p>
<tr><td style="font-family:monoface; padding-right:0px">[[Statement syntax#Notation conventions|(**)]] </td>
<td><p class="syntaxUL">COUNT OCCURRENCES OF <span class="term">fieldname</span></p></td></tr>
</table>
   
   
<hr>
===COUNT RECORDS===
   
   
<p class="syntaxUL">COUNT RECORDS <span class="squareb">{</span>IN label <span class="squareb">|</span> ON [LIST] listname<span class="squareb">}</span></p>
<p class="syntaxUL">COUNT RECORDS <span class="squareb">{</span>IN <span class="term">label</span> <span class="squareb">|</span> ON <span class="squareb">[</span>LIST<span class="squareb">]</span> <span class="term">listname</span><span class="squareb">}</span></p>
   
   
<hr>
===<b id="declare"></b>[[Declare statement|Declare]]===
   
   
<p class="syntaxUL"><span class="squareb">[</span>DECLARE<span class="squareb">]</span> declaration
<p class="syntaxUL"><span class="squareb">[</span>[[Using variables and values in computation#Declaring|Declare]]<span class="squareb">]</span> <span class="term">declaration</span>
</p>
</p>
   
   
<div style="margin-left: 20px; background-color: #fBfBfB;">
<p>
<p>
where <var class="term">declaration</var> is one of the following: </p>
where <var class="term">declaration</var> is one of the following: </p>
<div style="margin-left: 20px; background-color: #fBfBfB;">
<ul style="font-family: Consolas,monospace; display:table;">
<li>Label <i>labelname</i> <span class="squareb">[</span>Global <span class="squareb">|</span> Common<span class="squareb">]</span>
</li>
   
   
<ul style="font-family: Consolas,monospace">
<li>[[Lists#DECLARE LIST syntax|List]] listname <span class="squareb"> <br> [</span>In <span class="squareb">[</span>File <span class="squareb">|</span> <span class="squareb">[</span>Perm <span class="squareb">|</span> Temp<span class="squareb">]</span> Group<span class="squareb">]</span><span class="squareb">]</span> <i>name</i><span class="squareb">]</span>  <br> At <span class="term">location</span> <span class="squareb">[</span>Global <span class="squareb">|</span> Common<span class="squareb">]</span>
<li>LABEL labelname [GLOBAL <span class="squareb">|</span> COMMON]
</li>
   
   
<li>LIST listname [IN [FILE <span class="squareb">|</span> [PERM <span class="squareb">|</span> TEMP] GROUP]] name] [GLOBAL <span class="squareb">|</span> COMMON]
<li><var>Image</var> block:
{{Template:Image statement syntax}} </li>
   
   
<li>IMAGE imagename [AT <span class="squareb">{</span>itemname <span class="squareb">|</span> imagename1 <span class="squareb">|</span> arrayname<span class="squareb">}</span> <br>
<li>{{Template:Menu statement syntax}} </li>
      <span class="squareb">|</span> GLOBAL [PERMANENT <span class="squareb">|</span> TEMPORARY] </br>
      <span class="squareb">|</span> [PERMANENT <span class="squareb">|</span> TEMPORARY] GLOBAL <span class="squareb">|</span> COMMON]
   
   
<li>MENU menuname [GLOBAL [PERMANENT <span class="squareb">|</span> TEMPORARY] <br>
<li>{{Template:Screen statement syntax}} </li>
      <span class="squareb">|</span> [PERMANENT <span class="squareb">|</span> TEMPORARY] GLOBAL <span class="squareb">|</span> COMMON]
   
   
<li>SCREEN screenname [GLOBAL [PERMANENT <span class="squareb">|</span> TEMPORARY] <br>
<li><i>%variable</i> <span class="squareb">[</span>Is<span class="squareb">]</span> <span class="squareb">{</span>Fixed <span class="squareb">[</span>Dp <i>n</i><span class="squareb">]</span> <span class="squareb">|</span> Float<span class="squareb">}</span> <span class="squareb">[</span>Array (<i>d1</i> <span class="squareb">[</span>,<i>d2</i> <span class="squareb">[</span>,<i>d3</i><span class="squareb">]</span><span class="squareb">]</span>)<span class="squareb">]</span> <br>
        <span class="squareb">|</span> [PERMANENT <span class="squareb">|</span> TEMPORARY] GLOBAL <span class="squareb">|</span> COMMON]
          <span class="squareb">[</span>[[Initial clause in %variable declaration|Initial]](<i>numeric-expression</i>)<span class="squareb">]</span> <span class="squareb">[</span>Static<span class="squareb">]</span> <span class="squareb">[</span>Common<span class="squareb">]</span>
</li>
   
   
<li>%variable [IS] <span class="squareb">{</span>FIXED [DP n] <span class="squareb">|</span> FLOAT<span class="squareb">}</span> [ARRAY (d1 [,d2 [,d3]])] <br>
<li><i>%variable</i> <span class="squareb">[</span>Is<span class="squareb">]</span> String <span class="squareb">[</span>Len <i>n</i><span class="squareb">]</span> <span class="squareb">[</span>Dp <span class="squareb">{</span><i>n</i> <span class="squareb">|</span> *<span class="squareb">}</span><span class="squareb">]</span> <span class="squareb">[</span>Array (<i>d1</i> <span class="squareb">[</span>,<i>d2</i><span class="squareb">[</span>,<i>d3</i><span class="squareb">]</span><span class="squareb">]</span>)<span class="squareb">]</span> <br>
          [INITIAL(numeric-expression)] [STATIC] [COMMON]
           <span class="squareb">[</span>No Field Save<span class="squareb">]</span> <span class="squareb">[</span>Common<span class="squareb">]</span> <br>
           <span class="squareb">[</span>[[Initial clause in %variable declaration|Initial]]('<i>EBCDIC-string</i>' <span class="squareb">|</span> <i>expression</i>)<span class="squareb">]</span> <span class="squareb">[</span>Static<span class="squareb">]</span>
<li>%variable [IS] STRING [LEN n] [DP <span class="squareb">{</span>n <span class="squareb">|</span> *<span class="squareb">}</span>] [ARRAY (d1 [,d2[,d3]])] <br>
</li>
           [NO FIELD SAVE] [COMMON] <br>
           [INITIAL('EBCDIC-string' <span class="squareb">|</span> expression)] [STATIC]
   
   
<li>SUBROUTINE subname [(type [INPUT <span class="squareb">|</span> OUTPUT <span class="squareb">|</span> INPUT OUTPUT] [,...])]
<li>[[Subroutines#DECLARE SUBROUTINE statement|Subroutine]] <i>subname</i>  <br>  <span class="squareb">[</span>(<i>type</i> <span class="squareb">[</span>Input <span class="squareb">|</span> Output <span class="squareb">|</span> Input Output<span class="squareb">]</span> <span class="squareb">[</span>,...<span class="squareb">]</span>)<span class="squareb">]</span> 
</ul>
</div> <!-- declaration indent -->
<div style="margin-left: 40px; background-color: #fBfBfB;">
<p>
<p>
where <var class="term">type</var> is one of the following:</p>
where <var class="term">type</var> is one of the following: </p>
<ul>
<ul>
<li>Scalar %variable of the following format:
<li>Scalar %variable of the following format:
<ul style="font-family: Consolas,monospace">
<p class="code"><span class="squareb">{</span>String <span class="squareb">[</span>Len<span class="squareb">]</span> <i>n</i> <span class="squareb">[</span>DP <span class="squareb">{</span><i>n</i> <span class="squareb">|</span> *<span class="squareb">}</span><span class="squareb">]</span> <span class="squareb">|</span> <span class="squareb">[</span>Fixed <span class="squareb">[</span>Dp <i>n</i><span class="squareb">]</span> <span class="squareb">|</span> Float<span class="squareb">]</span><span class="squareb">}</span> </p>
<li><span class="squareb">{</span>STRING [LEN] n [DP <span class="squareb">{</span>n <span class="squareb">|</span> *<span class="squareb">}</span>] <span class="squareb">|</span> [FIXED [DP n] <span class="squareb">|</span> FLOAT]<span class="squareb">}</span> </li></ul>
</li>
</li>
   
   
<li>Array %variable of the following format:
<li>Array %variable of the following format:
<ul style="font-family: Consolas,monospace">
<p class="code"><span class="squareb">{</span>String <span class="squareb">[</span>Len <i>n</i><span class="squareb">]</span> <span class="squareb">[</span>Dp <span class="squareb">[</span><i>n</i> <span class="squareb">|</span> *<span class="squareb">}</span><span class="squareb">]</span> <span class="squareb">[</span>Array (* <span class="squareb">[</span>,*<span class="squareb">[</span>,*<span class="squareb">]</span><span class="squareb">]</span>) <span class="squareb">[</span>No Field Save<span class="squareb">]</span><span class="squareb">]</span> <br>
<li><span class="squareb">{</span>STRING [LEN n] [DP [n <span class="squareb">|</span> *<span class="squareb">}</span>] [ARRAY (* [,*[,*]]) [NO FIELD SAVE]] <br>
  <span class="squareb">|</span> <span class="squareb">[</span>Fixed <span class="squareb">[</span>Dp <i>n</i><span class="squareb">]</span> <span class="squareb">|</span> Float<span class="squareb">]</span> <span class="squareb">[</span>Array (* <span class="squareb">[</span>,*<span class="squareb">[</span>,*<span class="squareb">]</span><span class="squareb">]</span>)<span class="squareb">]</span><span class="squareb">}</span> </p>
  <span class="squareb">|</span> [FIXED [DP n] <span class="squareb">|</span> FLOAT] [ARRAY (* [,*[,*]])]<span class="squareb">}</span> </li></ul>
</li>
</li>
   
   
<li>A list of records of the following format:
<li>A list of records of the following format:
<ul style="font-family: Consolas,monospace">
<p class="code"><span class="squareb">[</span>List<span class="squareb">]</span> <span class="squareb">[</span>In <span class="squareb">{</span>File <span class="squareb">|</span> <span class="squareb">[</span>Perm <span class="squareb">|</span> Temp<span class="squareb">]</span> Group<span class="squareb">}</span> <i>name</i><span class="squareb">]</span> </p>
<li>[LIST] [IN <span class="squareb">{</span>FILE <span class="squareb">|</span> [PERM <span class="squareb">|</span> TEMP] GROUP<span class="squareb">}</span> name] </li></ul>
</li></ul>
</li>
</ul>
</ul>
   
   
</div> <!-- type indentation -->
</div> <!-- type indentation/background -->
 
===DEFAULT CURSOR===
   
   
<hr>
<p class="syntaxUL">DEFAULT CURSOR <span class="squareb">[</span>READ <span class="squareb">|</span> REREAD <span class="squareb">|</span> PRINT<span class="squareb">]</span>
              <span class="squareb">{</span>ITEMID <span class="term">n</span> <span class="squareb">|</span> <span class="term">itemname</span> <span class="squareb">|</span> ROW <span class="term">n</span> COLUMN <span class="term">m</span><span class="squareb">}</span>
</p>
   
   
<p class="syntaxUL">DEFAULT CURSOR [READ <span class="squareb">|</span> REREAD <span class="squareb">|</span> PRINT]  
===DEFAULT===
              <span class="squareb">{</span>ITEMID n <span class="squareb">|</span> itemname <span class="squareb">|</span> ROW n COLUMN m<span class="squareb">}</span>
</p>
<p class="syntaxUL">DEFAULT <span class="squareb">{</span>TITLE
        <span class="squareb">|</span> PROMPT
        <span class="squareb">|</span> INPUT <span class="squareb">[</span>DEBLANK <span class="squareb">|</span> NODEBLANK<span class="squareb">]</span> <span class="squareb">[</span>PAD WITH '<span class="term">c</span>'<span class="squareb">]</span> <span class="squareb">[</span>LEN <span class="term">m</span> <span class="squareb">[</span>DP <span class="squareb">[</span><span class="term">k</span> <span class="squareb">|</span> *<span class="squareb">}</span><span class="squareb">]</span><span class="squareb">]</span> <span class="squareb">[</span>UPCASE <span class="squareb">|</span> NOCASE<span class="squareb">]</span>
        <span class="squareb">|</span> <span class="squareb">[</span>TAG <span class="squareb">[</span><span class="term">attributes</span><span class="squareb">]</span> <span class="squareb">[</span>WITH '<span class="term">c</span>'<span class="squareb">]</span><span class="squareb">}</span>
        <span class="squareb">[</span><span class="squareb">[</span>READ<span class="squareb">]</span> <span class="term">attributes</span><span class="squareb">]</span> <span class="squareb">[</span>REREAD <span class="term">attributes</span><span class="squareb">]</span> <span class="squareb">[</span>PRINT <span class="term">attributes</span><span class="squareb">]</span>


<hr>
DEFAULT SKIP <span class="term">n</span> POSITIONS<span class="squareb">[</span>S<span class="squareb">]</span>
            <span class="squareb">[</span>INITIAL <span class="squareb">{</span>NULL <span class="squareb">|</span> <span class="term">character</span> <span class="squareb">|</span> BLANK<span class="squareb">}</span><span class="squareb">]</span>


<p class="syntaxUL">DEFAULT <span class="squareb">{</span>TITLE
DEFAULT <span class="squareb">[</span>TYPE<span class="squareb">]</span>
        <span class="squareb">|</span> PROMPT
<span class="squareb">{</span>STRING <span class="squareb">|</span> BINARY <span class="squareb">|</span> PACKED <span class="squareb">|</span> ZONED <span class="squareb">|</span> FLOAT <span class="squareb">|</span> EFORMAT<span class="squareb">}</span>
        <span class="squareb">|</span> INPUT [DEBLANK <span class="squareb">|</span> NODEBLANK] [PAD WITH 'c'] [LEN m [DP [k <span class="squareb">|</span> *<span class="squareb">}</span>]] [UPCASE <span class="squareb">|</span> NOCASE]  
<span class="squareb">{</span>LEN <span class="squareb">{</span><span class="term">n</span> <span class="squareb">|</span> UNKNOWN<span class="squareb">}</span> <span class="squareb">|</span> BITS <span class="term">n</span> <span class="squareb">|</span> DIGITS <span class="term">n</span><span class="squareb">}</span>
        <span class="squareb">|</span> [TAG [attributes] [WITH 'c']<span class="squareb">}</span>  
<span class="squareb">[</span>DP <span class="squareb">{</span><span class="term">k</span> <span class="squareb">|</span> *<span class="squareb">}</span><span class="squareb">]</span> <span class="squareb">[</span>BP <span class="term">n</span><span class="squareb">]</span>
        [[READ] attributes] [REREAD attributes] [PRINT attributes]
<span class="squareb">[</span>SIGNED <span class="squareb">|</span> UNSIGNED<span class="squareb">]</span> <span class="squareb">[</span>PAD <span class="squareb">{</span>BLANK <span class="squareb">|</span> <span class="term">character</span> <span class="squareb">|</span> NULL<span class="squareb">}</span><span class="squareb">]</span>
<span class="squareb">[</span>STRIP <span class="squareb">|</span> NOSTRIP<span class="squareb">]</span> <span class="squareb">[</span>JUSTIFY <span class="squareb">{</span>LEFT <span class="squareb">|</span> RIGHT<span class="squareb">}</span><span class="squareb">]</span>
<span class="squareb">[</span>INITIAL <span class="squareb">{</span>BLANK <span class="squareb">|</span> ZERO <span class="squareb">|</span> NULL <span class="squareb">|</span> <span class="term">literal</span><span class="squareb">}</span><span class="squareb">]</span>
</p>
</p>


<hr>
===DELETE===
<table class="noBorder">
<tr><td style="font-family:monoface; padding-right:0px">[[Statement syntax#Notation conventions|(**)]] </td>
<td><p class="syntaxUL">[[Data maintenance#DELETE statement|DELETE]] <span class="term">fieldname</span> <span class="squareb">[</span>(<span class="term">[[Processing_multiply_occurring_fields_and_field_groups#DELETE_statement_rules|subscript]]</span>)<span class="squareb">]</span> <span class="squareb">[</span><b></b>= <span class="term">value</span> <span class="squareb">|</span> (<span class="term">expression</span>)<span class="squareb">]</span>
</p></td></tr>
</table>


<p class="syntaxUL">DEFAULT SKIP n POSITIONS[S]  
<table class="noBorder">
            [INITIAL <span class="squareb">{</span>NULL <span class="squareb">|</span> character <span class="squareb">|</span> BLANK<span class="squareb">}</span>]
<tr><td style="font-family:monoface; padding-right:0px">[[Statement syntax#Notation conventions|(**)]] </td>
</p>
<td><p class="syntaxUL">[[Data maintenance#Deleting a field group|DELETE FIELDGROUP]] <span class="squareb">[</span><span class="term">fieldgroupname</span><span class="squareb">]</span> <span class="squareb">[</span>(<span class="term">[[Processing_multiply_occurring_fields_and_field_groups#DELETE_statement_rules|subscript]]</span>)<span class="squareb">]</span> <span class="squareb">[</span><b></b>= <span class="term">value</span> <span class="squareb">|</span> (<span class="term">expression</span>)<span class="squareb">]</span>
</p></td></tr>
</table>


<hr>
===DELETE EACH===
<table class="noBorder">
<tr><td style="font-family:monoface; padding-right:0px">[[Statement syntax#Notation conventions|(**)]] </td>
<td><p class="syntaxUL">DELETE EACH <span class="term">fieldname</span></p> </td></tr>
</table>
   
   
<p class="syntaxUL">DEFAULT [TYPE]
===[[Data maintenance#DELETE RECORD statement|DELETE RECORD]]===
<span class="squareb">{</span>STRING <span class="squareb">|</span> BINARY <span class="squareb">|</span> PACKED <span class="squareb">|</span> ZONED <span class="squareb">|</span> FLOAT <span class="squareb">|</span> EFORMAT<span class="squareb">}</span>
<table class="noBorder">
<span class="squareb">{</span>LEN <span class="squareb">{</span>n <span class="squareb">|</span> UNKNOWN<span class="squareb">}</span> <span class="squareb">|</span> BITS n <span class="squareb">|</span> DIGITS n<span class="squareb">}</span>  
<tr><td style="font-family:monoface; padding-right:0px">[[Statement syntax#Notation conventions|(**)]] </td>
[DP <span class="squareb">{</span>k <span class="squareb">|</span> *<span class="squareb">}</span>] [BP n]
<td><p class="syntaxUL">DELETE RECORD </p> </td></tr>
[SIGNED <span class="squareb">|</span> UNSIGNED] [PAD <span class="squareb">{</span>BLANK <span class="squareb">|</span> character <span class="squareb">|</span> NULL<span class="squareb">}</span>]  
</table>
[STRIP <span class="squareb">|</span> NOSTRIP] [JUSTIFY <span class="squareb">{</span>LEFT <span class="squareb">|</span> RIGHT<span class="squareb">}</span>]
[INITIAL <span class="squareb">{</span>BLANK <span class="squareb">|</span> ZERO <span class="squareb">|</span> NULL <span class="squareb">|</span> literal<span class="squareb">}</span>]
</p>


<hr>
===DELETE RECORDS===
   
   
<p class="syntaxUL"><b><sup>(**)</sup></b>DELETE fieldname <span class="squareb">[</span>(subscript)<span class="squareb">]</span> <span class="squareb">[</span><b></b>= value |(expression)<span class="squareb">]</span>
<p class="syntaxUL">DELETE <span class="squareb">[</span>ALL<span class="squareb">]</span> RECORDS <span class="squareb">{</span>IN <span class="term">label</span> <span class="squareb">|</span> ON <span class="squareb">[</span>LIST<span class="squareb">]</span> <span class="term">listname</span><span class="squareb">}</span>
</p>
</p>
<hr>
   
   
<p class="syntaxUL"><b><sup>(**)</sup></b>DELETE EACH fieldname</p>
===END BLOCK===
   
   
<hr>
<p class="syntaxUL">END BLOCK <span class="term">label</span> </p>
   
   
<p class="syntaxUL"><b><sup>(**)</sup></b>DELETE RECORD </p>
===End===
   
   
<hr>
<p class="syntaxUL">END <span class="squareb">{</span>FIND <span class="squareb">|</span> IF <span class="squareb">|</span> FOR <span class="squareb">|</span> ON <span class="squareb">|</span> REPEAT <span class="squareb">|</span> STORE <span class="squareb">|</span> SUBROUTINE<span class="squareb">}</span> [<span class="term">label</span><span class="squareb">]</span>
 
END <span class="squareb">{</span>ARRAY <span class="squareb">|</span> IMAGE <span class="squareb">|</span> MENU <span class="squareb">|</span> SCREEN<span class="squareb">}</span>
 
[[End statement|End]] <span class="squareb">[</span>MORE <span class="squareb">|</span> NORUN <span class="squareb">|</span> USE<span class="squareb">]</span>...</p>
 
===END UPDATE===
   
   
<p class="syntaxUL">DELETE [ALL] RECORDS <span class="squareb">{</span>IN label <span class="squareb">|</span> ON [LIST] listname<span class="squareb">}</span>
<p class="syntaxUL">END UPDATE</p>
</p>
 
===[[External statement|External]]===
   
   
<hr>
{{Template:External statement syntax}}
 
===FILE RECORDS===
   
   
<p class="syntaxUL">END BLOCK label </p>
<p class="syntaxUL">FILE RECORDS <span class="squareb">{</span>IN <span class="term">label</span> <span class="squareb">|</span> ON <span class="squareb">[</span>LIST<span class="squareb">]</span> <span class="term">listname</span><span class="squareb">}</span>
            UNDER <span class="term">fieldname</span> = <span class="squareb">{</span><span class="term">value</span> <span class="squareb">|</span> (<span class="term">expression</span>)<span class="squareb">}</span>
<hr>
<p class="syntaxUL">END <span class="squareb">{</span>FIND <span class="squareb">|</span> IF <span class="squareb">|</span> FOR <span class="squareb">|</span> ON <span class="squareb">|</span> REPEAT <span class="squareb">|</span> STORE <span class="squareb">|</span> SUBROUTINE<span class="squareb">}</span> [label]
</p>
</p>
   
   
<hr>
===[[Find Records statement|Find Records]]===
<table class="noBorder">
<p class="syntaxUL">END <span class="squareb">{</span>ARRAY <span class="squareb">|</span> IMAGE <span class="squareb">|</span> MENU <span class="squareb">|</span> SCREEN<span class="squareb">}</span></p>
<tr><td style="font-family:monoface; padding-right:0px">[[Statement syntax#Notation conventions|(*)]] </td>
<td><p class="syntaxUL"><span class="squareb">{</span>FIND <span class="squareb">[</span><span class="squareb">[</span>ALL<span class="squareb">]</span> RECORDS<span class="squareb">]</span> <span class="squareb">|</span> FD <span class="squareb">}</span>        <br>  <span class="squareb">[</span>IN <span class="term">label</span> <span class="squareb">|</span> ON <span class="squareb">[</span>LIST<span class="squareb">]</span> <span class="term">listname</span><span class="squareb">]</span>        <br>  <span class="squareb">[</span>FOR WHICH <span class="squareb">|</span> WITH<span class="squareb">]</span> <span class="term">[[#Retrieval condition syntax|retrieval-conditions]]</span></p></td></tr>
<hr>
</table>
 
<p class="syntaxUL">END [MORE <span class="squareb">|</span> NORUN <span class="squareb">|</span> USE]...</p>
===[[Find And Reserve statement|Find And Reserve]]===
<table class="noBorder">
<hr>
<tr><td style="font-family:monoface; padding-right:0px">[[Statement syntax#Notation conventions|(*)]] </td>
<td><p class="syntaxUL"><span class="squareb">{</span>FIND AND RESERVE <span class="squareb">[</span><span class="squareb">[</span>ALL<span class="squareb">]</span> RECORDS<span class="squareb">]</span> <span class="squareb">|</span> FDR<span class="squareb">}</span>  <br>  <span class="squareb">[</span>IN <span class="term">label</span> <span class="squareb">|</span> ON <span class="squareb">[</span>LIST<span class="squareb">]</span> <span class="term">listname</span><span class="squareb">]</span>  <br>  <span class="squareb">[</span>FOR WHICH <span class="squareb">|</span> WITH<span class="squareb">]</span> <span class="term">[[#Retrieval condition syntax|retrieval-conditions]]</span> </p></td></tr>
<p class="syntaxUL">END UPDATE</p>
</table>
 
<hr>
===[[Value loops#Find All Values statement|Find Values Of (FDV)]]===
<table class="noBorder">
<p class="syntaxUL">FILE RECORDS <span class="squareb">{</span>IN label <span class="squareb">|</span> ON [LIST] listname<span class="squareb">}</span>  
<tr>
            UNDER fieldname = <span class="squareb">{</span>value <span class="squareb">|</span> (expression)<span class="squareb">}</span>
<td style="padding:0em">{{Template: Find Values Of statement syntax}} </td></tr>
</p>
</table>
 
===FIND AND PRINT COUNT===
<table class="noBorder">
<tr><td style="font-family:monoface; padding-right:0px">[[Statement syntax#Notation conventions|(*)]] </td>
<td><p class="syntaxUL"><span class="squareb">{</span>Find And Print Count <span class="squareb">|</span> FPC<span class="squareb">}</span> <br>  <span class="squareb">[</span><span class="term">[[#Retrieval condition syntax|retrieval-conditions]]</span><span class="squareb">]</span>
</p></td></tr>
</table>


<hr>
===[[Find Records statement|Find Without Locks]]===
<table class="noBorder">
<p class="syntaxUL"><b><sup>(*)</sup></b>FIND [AND RESERVE] [ALL] RECORDS
<tr><td style="font-family:monoface; padding-right:0px">[[Statement syntax#Notation conventions|(*)]] </td>
    [IN label <span class="squareb">|</span> ON [LIST] listname]  
<td><p class="syntaxUL"><span class="squareb">{</span>Find Without Locks <span class="squareb">[</span><span class="squareb">[</span>ALL<span class="squareb">]</span> Records<span class="squareb">]</span> <span class="squareb">|</span> FDWOL<span class="squareb">}</span><br>  <span class="squareb">[</span>In <span class="term">label</span> <span class="squareb">|</span> On <span class="squareb">[</span>LIST<span class="squareb">]</span> <span class="term">listname</span><span class="squareb">]</span>
    [FOR WHICH <span class="squareb">|</span> WITH] retrieval-conditions
  <span class="squareb">[</span>For Which <span class="squareb">|</span> With<span class="squareb">]</span> <span class="term">[[#Retrieval condition syntax|retrieval-conditions]]</span></p></td></tr>
</p>
</table>


<hr>
===FLUSH PROCESS===
<p class="syntaxUL"><b><sup>(*)</sup></b>FIND <span class="squareb">[</span>ALL<span class="squareb">]</span> VALUES OF fieldname
    <span class="squareb">[</span>FROM <span class="squareb">{</span>value1 <span class="squareb">|</span> (expression1)<span class="squareb">}</span><span class="squareb">]</span> <span class="squareb">[</span>TO <span class="squareb">{</span>value2 <span class="squareb">|</span> (expression2)<span class="squareb">}</span><span class="squareb">]</span>
    <span class="squareb">[</span><span class="squareb">[</span>NOT<span class="squareb">]</span> LIKE 'pattern'<span class="squareb">]</span>
</p>
   
   
<hr>
<p class="syntaxUL">FLUSH PROCESS <span class="squareb">{</span><span class="term">cid</span> <span class="squareb">|</span> <span class="term">processname</span> <span class="squareb">|</span> <span class="term">%variable</span><span class="squareb">}</span></p>
   
   
<p class="syntaxUL"><b><sup>(*)</sup></b>FIND AND PRINT COUNT <span class="squareb">[</span>retrieval-conditions<span class="squareb">]</span>
===FOR EACH OCCURRENCE===
</p>
<table class="noBorder">
<tr><td style="font-family:monoface; padding-right:0px">[[Statement syntax#Notation conventions|(**)]] </td>
<td><p class="syntaxUL">FOR <span class="squareb">{</span>EACH <span class="squareb">|</span> <span class="term">k</span><span class="squareb">}</span> <span class="squareb">{</span>OCCURRENCE <span class="squareb">|</span> OCCURRENCES<span class="squareb">}</span> <span class="term">OF fieldname</span> </p></td></tr>
</table>
   
   
<hr>
===<b id="FOR EACH RECORD"></b>[[Record loops#For Each Record statement|For Each Record]]===
<table class="noBorder">
<tr><td style="font-family:monoface; padding-right:0px">[[Statement syntax#Notation conventions|(*)]] </td>
<td>{{Template:For Each Record statement syntax}}</td></tr>
</table>
<p class="note"><b>Note:</b> For <var class="term">retrieval-conditions</var>, see [[#Retrieval condition syntax|Retrieval condition syntax]], below. </p>
 
===FOR EACH VALUE OF===
<table class="noBorder">
<tr><td style="font-family:monoface; padding-right:0px">[[Statement syntax#Notation conventions|(*)]] </td>
<td><p class="syntaxUL">FOR <span class="squareb">{</span>EACH <span class="squareb">|</span> <span class="term">k</span><span class="squareb">}</span> <span class="squareb">{</span>VALUE <span class="squareb">|</span> VALUES<span class="squareb">}</span> <span class="term">OF fieldname</span> <br>    <span class="squareb">[</span>FROM <span class="squareb">{</span><span class="term">value1</span> <span class="squareb">|</span> (<span class="term">expression1</span>)<span class="squareb">}</span><span class="squareb">]</span> <span class="squareb">[</span>TO <span class="squareb">{</span><span class="term">value2</span> <span class="squareb">|</span> (<span class="term">expression2</span>)<span class="squareb">}</span><span class="squareb">]</span> <span class="squareb">[</span><span class="squareb">[</span>NOT<span class="squareb">]</span> LIKE <span class="term">pattern</span><span class="squareb">]</span> <br>    <span class="squareb">[</span>IN <span class="squareb">[</span>ASCENDING <span class="squareb">|</span> DESCENDING<span class="squareb">]</span> <span class="squareb">[</span>CHARACTER <span class="squareb">|</span> NUMERICAL<span class="squareb">]</span> <span class="squareb">[</span>RIGHT-ADJUSTED<span class="squareb">]</span> ORDER<span class="squareb">]</span>
</p></td></tr>
</table>
   
   
<p class="syntaxUL"><b><sup>(*)</sup></b><span class="squareb">{</span>FIND WITHOUT LOCKS <span class="squareb">|</span> FDWOL<span class="squareb">}</span>
===FOR EACH VALUE IN===
    [ALL] RECORDS [IN label <span class="squareb">|</span> ON [LIST] listname]
    [FOR WHICH <span class="squareb">|</span> WITH] retrieval-conditions
</p>
   
   
<hr>
  <p class="syntaxUL">FOR <span class="squareb">{</span>EACH <span class="squareb">|</span> <span class="term">k</span><span class="squareb">}</span> <span class="squareb">{</span>VALUE <span class="squareb">|</span> VALUES<span class="squareb">}</span> IN <span class="term">label</span> </p>
   
   
<p class="syntaxUL">FLUSH PROCESS <span class="squareb">{</span>cid <span class="squareb">|</span> processname <span class="squareb">|</span> %variable<span class="squareb">}</span></p>
===FOR RECORD NUMBER===
<table class="noBorder">
<tr><td style="font-family:monoface; padding-right:0px">[[Statement syntax#Notation conventions|(*)]] </td>
<td><p class="syntaxUL">FOR RECORD NUMBER <span class="squareb">{</span><span class="term">value</span> <span class="squareb">|</span> (<span class="term">expression</span>)<span class="squareb">}</span>
</p></td></tr>
</table>
   
   
<hr>
===FOR RECORD NUMBER IN===
   
   
<p class="syntaxUL"><b><sup>(**)</sup></b>FOR <span class="squareb">{</span>EACH <span class="squareb">|</span> k<span class="squareb">}</span> <span class="squareb">{</span>OCCURRENCE <span class="squareb">|</span> OCCURRENCES<span class="squareb">}</span> OF fieldname
<p class="syntaxUL">FOR RECORD NUMBER <span class="squareb">{</span><span class="term">value</span> <span class="squareb">|</span> IN <span class="term">label</span><span class="squareb">}</span> <span class="squareb">[</span>OPTIMIZING FNV<span class="squareb">]</span>
</p>
</p>


<hr>
===[[For %i statement|For %var From %exp1 To %exp2 By %exp3]]===
<table class="noBorder">
<tr>
<td style="padding:0em">{{Template:For %i statement syntax}} </td></tr>
</table>
   
   
<p class="syntaxUL"><b><sup>(*)</sup></b>FOR <span class="squareb">{</span>EACH <span class="squareb">|</span> k<span class="squareb">}</span> <span class="squareb">{</span>RECORD <span class="squareb">|</span> RECORDS<span class="squareb">}</span>
<p class="note"><b>Note:</b> The <var>By</var> clause, when omitted, defaults to a value of 1. </p>
    [IN label <span class="squareb">|</span> ON [LIST] listname]
    IN [ASCENDING <span class="squareb">|</span> DESCENDING] [SORTKEY] ORDER [BY [EACH] fieldname]
    [FROM <span class="squareb">{</span>value1 <span class="squareb">|</span> (expression1)<span class="squareb">}</span>] [TO <span class="squareb">{</span>value2 <span class="squareb">|</span> (expression2)<span class="squareb">}</span>] [BY <span class="squareb">{</span>%variable <span class="squareb">|</span> literal<span class="squareb">}</span>]
    [OPTIMIZING FNV]
    [<span class="squareb">{</span>WHERE <span class="squareb">|</span> WITH<span class="squareb">}</span> retrieval-conditions]
</p>


<hr>
===[[Images#Identify statement|Identify]]===
   
   
<p class="syntaxUL"><b><sup>(*)</sup></b>FOR <span class="squareb">{</span>EACH <span class="squareb">|</span> k<span class="squareb">}</span> <span class="squareb">{</span>VALUE <span class="squareb">|</span> VALUES<span class="squareb">}</span> OF fieldname
<table class="noBorder" display="table-column">
    [FROM <span class="squareb">{</span>value1 <span class="squareb">|</span> (expression1)<span class="squareb">}</span>] [TO <span class="squareb">{</span>value2 <span class="squareb">|</span> (expression2)<span class="squareb">}</span>] [[NOT] LIKE pattern]
<tr><td>{{Template:Identify statement syntax}} </td></tr>
    [IN [ASCENDING <span class="squareb">|</span> DESCENDING] [CHARACTER <span class="squareb">|</span> NUMERICAL] [RIGHT-ADJUSTED] ORDER]
</table>
</p>


<hr>
===<b id="IF...THEN...ELSE"></b><b id="ifStmt"></b>[[If statement|If]]...Then...ElseIf...Else===
<table class="noBorder">
  <p class="syntaxUL">FOR <span class="squareb">{</span>EACH <span class="squareb">|</span> k<span class="squareb">}</span> <span class="squareb">{</span>VALUE <span class="squareb">|</span> VALUES<span class="squareb">}</span> IN label </p>
<tr><td style="font-family:monoface; padding-right:0px">[[Statement syntax#Notation conventions|(C)]] </td>
   
<td><p class="syntaxUL">If <span class="term">expression</span> Then <span class="squareb">[</span><span class="term">statement</span><span class="squareb">]</span>  <br>  <span class="squareb">[</span><span class="term">statement</span><span class="squareb">]</span> <br>  <span class="squareb">...</span><br><span class="squareb">[</span><br>ElseIf <span class="term">expression</span> Then <span class="squareb">[</span><span class="term">statement</span><span class="squareb">]</span> <br>  <span class="squareb">[</span><span class="term">statement</span><span class="squareb">]</span> <br>  <span class="squareb">...</span><br><span class="squareb">] ...</span><br><span class="squareb">[</span><br>Else <span class="squareb">[</span><span class="term">statement</span><span class="squareb">]</span> <br> <span class="squareb">[</span><span class="term">statement</span><span class="squareb">]</span> <br>  <span class="squareb">...</span> <br><span class="squareb">]</span> <br>End If
<hr>
</p></td></tr>
   
</table>
<p class="syntaxUL"><b><sup>(*)</sup></b>FOR RECORD NUMBER <span class="squareb">{</span>value <span class="squareb">|</span> (expression)<span class="squareb">}</span>
</p>


<hr>
===[[Image statement or block|Image]]===
<var>Image</var> block:
<p class="syntaxUL">FOR RECORD NUMBER <span class="squareb">{</span>value <span class="squareb">|</span> IN label<span class="squareb">}</span> [OPTIMIZING FNV]
<table class="noBorder">
</p>
<tr><td style="padding:0em">{{Template:Image statement syntax}}</td></tr>
</table>


<hr>
===INCLUDE===
<table class="noBorder">
<p class="syntaxUL">FOR %variable FROM expression1
<tr><td style="font-family:monoface; padding-right:0px">[[Statement syntax#Notation conventions|(*, C)]] </td>
<span class="squareb">{</span>TO expression2 [BY expression3]
<td><p class="syntaxUL">INCLUDE <span class="term">procedurename</span>  </p></td></tr>
<span class="squareb">|</span> [BY expression3] TO expression2<span class="squareb">}</span>
</table>
</p>
<p class="note"><b>Note:</b> The BY clause, when omitted, defaults to a value of 1.</p>
<hr>
<p class="syntaxUL">IDENTIFY
<span class="squareb">{</span>[IMAGE] imagename
  <span class="squareb">|</span> %imagename:itemname LEN <span class="squareb">{</span>n <span class="squareb">|</span> %variable<span class="squareb">}</span>
<span class="squareb">|</span> %imagename:arrayname OCCURS <span class="squareb">{</span>n <span class="squareb">|</span> %variable<span class="squareb">}</span><span class="squareb">}</span>
</p>


<hr>
===INPUT===
   
   
<p class="syntaxUL"><b><sup>(C)</sup></b>IF expression THEN statements
<p class="syntaxUL">INPUT <span class="term">inputname</span> <span class="squareb">[</span>AT <span class="squareb">[</span>COLUMN<span class="squareb">]</span> <span class="term">n</span><span class="squareb">]</span>
    [ELSE statements <span class="squareb">|</span> ELSEIF expression THEN statements]  
<span class="squareb">[</span>TO <span class="squareb">[</span>COLUMN<span class="squareb">]</span> <span class="term">m</span> <span class="squareb">|</span> <span class="squareb">[</span>LEN <span class="term">m</span><span class="squareb">]</span> DP <span class="squareb">{</span><span class="term">k</span> <span class="squareb">|</span> *<span class="squareb">}</span><span class="squareb">]</span><span class="squareb">]</span>
<span class="squareb">[</span>UPCASE <span class="squareb">|</span> NOCASE<span class="squareb">]</span> <span class="squareb">[</span>DEFAULT '<span class="term">value</span>'<span class="squareb">]</span>
<span class="squareb">[</span>DEBLANK <span class="squareb">|</span> NODEBLANK<span class="squareb">]</span> <span class="squareb">[</span>PAD WITH '<span class="term">c</span>'<span class="squareb">]</span>
<span class="squareb">[</span>REQUIRED <span class="squareb">|</span> ALPHA <span class="squareb">|</span> ALPHANUM <span class="squareb">|</span> MUSTFILL
<span class="squareb">|</span> ONEOF <span class="term">literal</span> <span class="squareb">[</span>, <span class="term">literal</span><span class="squareb">]</span>...
<span class="squareb">|</span> <span class="squareb">[</span>NUMERIC<span class="squareb">]</span> <span class="squareb">[</span>RANGE <span class="term">lo</span> <span class="squareb">[</span>TO<span class="squareb">]</span> <span class="term">hi</span> <span class="squareb">[</span>AND <span class="term">lo</span> <span class="squareb">[</span>TO<span class="squareb">]</span> <span class="term">hi</span><span class="squareb">]</span> ...<span class="squareb">]</span>
<span class="squareb">|</span> VERIFY '<span class="term">characters</span>'<span class="squareb">]</span>...
<span class="squareb">[</span><span class="squareb">[</span>READ<span class="squareb">]</span> <span class="term">attributes</span><span class="squareb">]</span> <span class="squareb">[</span>REREAD <span class="term">attributes</span><span class="squareb">]</span> <span class="squareb">[</span>PRINT <span class="term">attributes</span><span class="squareb">]</span>
<span class="squareb">[</span>TAG <span class="squareb">[</span><span class="term">attributes</span><span class="squareb">]</span> <span class="squareb">[</span>WITH '<span class="term">c</span>'<span class="squareb">]</span><span class="squareb">]</span> <span class="squareb">[</span>ITEMID <span class="term">n</span><span class="squareb">]</span>
</p>
</p>


<hr>
===INSERT===
   
   
<p class="syntaxUL">[DECLARE] IMAGE imagename
<p class="syntaxUL">INSERT <span class="term">fieldname</span> <span class="squareb">[</span>(<span class="term">subscript</span>)<span class="squareb">]</span> = <span class="squareb">{</span><span class="term">value</span> <span class="squareb">|</span> (<span class="term">expression</span>)<span class="squareb">}</span>
[GLOBAL [PERMANENT <span class="squareb">|</span> TEMPORARY]
<span class="squareb">|</span> [PERMANENT <span class="squareb">|</span> TEMPORARY] GLOBAL
<span class="squareb">|</span> COMMON [AT [itemname <span class="squareb">|</span> imagename1 |arrayname<span class="squareb">}</span>]]
</p>
</p>
<hr>
   
   
<p class="syntaxUL"><b><sup>(*)</sup></b>INCLUDE procedurename  </p>
===[[Horizon SOUL interface#Invite statement|Invite]]===
<table class="noBorder">
<tr><td style="font-family:monoface; padding-right:0px">[[Statement syntax#Notation conventions|(+)]] </td>
<td>{{Template:Invite statement syntax}} </td></tr>
</table>
   
   
<hr>
===IS===
   
   
<p class="syntaxUL">INPUT inputname [AT [COLUMN] n]
<p class="syntaxUL"><span class="term">itemname</span> IS <span class="squareb">[</span>TYPE<span class="squareb">]</span>
  [TO [COLUMN] m <span class="squareb">|</span> [LEN m] DP <span class="squareb">{</span>k <span class="squareb">|</span> *<span class="squareb">}</span>]]  
<span class="squareb">{</span>STRING <span class="squareb">|</span> BINARY <span class="squareb">|</span> PACKED <span class="squareb">|</span> ZONED <span class="squareb">|</span> FLOAT <span class="squareb">|</span> EFORMAT<span class="squareb">}</span>
  [UPCASE <span class="squareb">|</span> NOCASE] [DEFAULT 'value']  
<span class="squareb">{</span>LEN <span class="squareb">{</span><span class="term">n</span> <span class="squareb">|</span> UNKNOWN<span class="squareb">}</span> <span class="squareb">|</span> BITS <span class="term">n</span> <span class="squareb">|</span> DIGITS <span class="term">n</span>
  [DEBLANK <span class="squareb">|</span> NODEBLANK] [PAD WITH 'c']  
  <span class="squareb">|</span> TO <span class="term">position</span><span class="squareb">}</span>
  [REQUIRED <span class="squareb">|</span> ALPHA <span class="squareb">|</span> ALPHANUM <span class="squareb">|</span> MUSTFILL
<span class="squareb">[</span>DP <span class="squareb">{</span><span class="term">k</span> <span class="squareb">|</span> *<span class="squareb">}</span><span class="squareb">]</span> <span class="squareb">[</span>BP <span class="term">n</span><span class="squareb">]</span> <span class="squareb">[</span>SIGNED <span class="squareb">|</span> UNSIGNED<span class="squareb">]</span>
  <span class="squareb">|</span> ONEOF literal [,literal]...
  <span class="squareb">[</span>PAD <span class="squareb">{</span>BLANK <span class="squareb">|</span> <span class="term">character</span> <span class="squareb">|</span> NULL<span class="squareb">}</span><span class="squareb">]</span> <span class="squareb">[</span>STRIP <span class="squareb">|</span> NOSTRIP<span class="squareb">]</span>
  <span class="squareb">|</span> [NUMERIC] [RANGE lo [TO] hi [AND lo [TO] hi] ...]
  <span class="squareb">[</span>ALIGN<span class="squareb">]</span>
<span class="squareb">|</span> VERIFY 'characters']...
<span class="squareb">[</span>JUSTIFY <span class="squareb">{</span>LEFT <span class="squareb">|</span> RIGHT<span class="squareb">}</span><span class="squareb">]</span>
  [[READ] attributes] [REREAD attributes] [PRINT attributes]  
  <span class="squareb">[</span>INITIAL <span class="squareb">{</span>BLANK <span class="squareb">|</span> ZERO <span class="squareb">|</span> NULL <span class="squareb">|</span> <span class="term">value</span><span class="squareb">}</span><span class="squareb">]</span>
  <span class="squareb">{</span>TAG [attributes] [WITH 'c']] [ITEMID n]
  <span class="squareb">[</span>AFTER <span class="squareb">{</span><span class="term">itemname</span> <span class="squareb">|</span> <span class="term">arrayname</span><span class="squareb">}</span>
  <span class="squareb">|</span> AT <span class="squareb">{</span><span class="term">position</span> <span class="squareb">|</span> <span class="term">itemname</span> <span class="squareb">|</span> <span class="term">imagename1</span> <span class="squareb">|</span> <span class="term">arrayname</span><span class="squareb">}</span><span class="squareb">]</span>
  <span class="squareb">[</span>OCCURS <span class="squareb">{</span><span class="term">n</span> <span class="squareb">[</span>DEPENDING ON <span class="squareb">{</span><span class="term">itemname</span> <span class="squareb">|</span> <span class="term">%variable</span><span class="squareb">}</span><span class="squareb">]</span>
  <span class="squareb">|</span> UNKNOWN<span class="squareb">}</span><span class="squareb">]</span>
</p>
</p>
   
   
<hr>
===JUMP TO===
<p class="syntaxUL">JUMP TO <span class="term">label</span>
   
   
<p class="syntaxUL">INSERT fieldname <span class="squareb">[</span>(subscript)<span class="squareb">]</span> = <span class="squareb">{</span>value <span class="squareb">|</span> (expression)<span class="squareb">}</span>
JUMP TO (<span class="term">label1</span> <span class="squareb">[</span>, <span class="term">label2</span><span class="squareb">]</span> ...) <span class="term">expression</span></p>
</p>


<hr>
===[[Loop End statement|Loop End]]===
   
   
<p class="syntaxUL"><b><sup>(+)</sup></b>INVITE <span class="squareb">{</span>cid <span class="squareb">|</span> processname <span class="squareb">|</span> %variable<span class="squareb">}</span>
<p class="syntaxUL">[[Loop End statement|Loop End]] </p>
    [SYNCLEVEL <span class="squareb">|</span> FLUSH <span class="squareb">|</span> CONFIRM]<var> </var>
 
</p>
===[[Loop Next statement|Loop Next]]===
   
   
<hr>
<p class="syntaxUL">[[Loop Next statement|Loop Next]]</p>
 
<p class="syntaxUL">itemname IS [TYPE]  
===MAX PFKEY===
<span class="squareb">{</span>STRING <span class="squareb">|</span> BINARY <span class="squareb">|</span> PACKED <span class="squareb">|</span> ZONED <span class="squareb">|</span> FLOAT <span class="squareb">|</span> EFORMAT<span class="squareb">}</span>
<p class="syntaxUL">MAX PFKEY <span class="term">n</span> </p>
<span class="squareb">{</span>LEN <span class="squareb">{</span>n <span class="squareb">|</span> UNKNOWN<span class="squareb">}</span> <span class="squareb">|</span> BITS n <span class="squareb">|</span> DIGITS n
 
<span class="squareb">|</span> TO position<span class="squareb">}</span>
===<b id="MENU"></b>[[Menu statement or block|Menu]]===
[DP <span class="squareb">{</span>k <span class="squareb">|</span> *<span class="squareb">}</span>] [BP n] [SIGNED <span class="squareb">|</span> UNSIGNED]
<table class="noBorder">
[PAD <span class="squareb">{</span>BLANK <span class="squareb">|</span> character <span class="squareb">|</span> NULL<span class="squareb">}</span>] [STRIP <span class="squareb">|</span> NOSTRIP]  
<tr>
[ALIGN]  
<td>{{Template: Menu statement syntax}} </td></tr>
[JUSTIFY <span class="squareb">{</span>LEFT <span class="squareb">|</span> RIGHT<span class="squareb">}</span>]
</table>
[INITIAL <span class="squareb">{</span>BLANK <span class="squareb">|</span> ZERO <span class="squareb">|</span> NULL <span class="squareb">|</span> value<span class="squareb">}</span>]
[AFTER <span class="squareb">{</span>itemname <span class="squareb">|</span> arrayname<span class="squareb">}</span>
<span class="squareb">|</span> AT <span class="squareb">{</span>position <span class="squareb">|</span> itemname <span class="squareb">|</span> imagename1 <span class="squareb">|</span> arrayname<span class="squareb">}</span>]
[OCCURS <span class="squareb">{</span>n [DEPENDING ON <span class="squareb">{</span>itemname <span class="squareb">|</span> %variable<span class="squareb">}</span>]
<span class="squareb">|</span> UNKNOWN<span class="squareb">}</span>]
</p>


<hr>
===MODIFY===
   
   
<p class="syntaxUL">JUMP TO label
<p class="syntaxUL">MODIFY <span class="squareb">{</span><span class="term">%menuname</span>:<span class="term">itemname</span> <span class="squareb">|</span> <span class="term">%screenname</span>:<span class="term">itemname</span><span class="squareb">}</span>
<span class="squareb">[</span>TO<span class="squareb">]</span> <span class="term">attributes</span> <span class="squareb">[</span><span class="squareb">[</span>FOR<span class="squareb">]</span> <span class="squareb">{</span>ALL <span class="squareb">|</span> READ <span class="squareb">|</span> REREAD <span class="squareb">|</span> TAB
<span class="squareb">|</span> PRINT<span class="squareb">}</span><span class="squareb">]</span>
</p>
</p>
   
   
<hr>
===MODIFY BUFFER===
   
   
<p class="syntaxUL">JUMP TO (label1 <span class="squareb">[</span>,label2<span class="squareb">]</span> ...) expression
<p class="syntaxUL">MODIFY BUFFER <span class="squareb">[</span>SIZE=<span class="term">n</span>
<span class="squareb">|</span> <span class="term">%variable</span> <span class="squareb">[</span>PRESERVE <span class="squareb">|</span> NOPRESERVE<span class="squareb">]</span><span class="squareb">]</span>
<span class="squareb">[</span>FILL <span class="squareb">[</span>X'<span class="term">nn</span>'<span class="squareb">]</span> <span class="squareb">|</span> CLEAR<span class="squareb">]</span>
</p>
</p>
   
   
<hr>
===NEW PAGE===
<table class="noBorder">
<tr><td style="font-family:monoface; padding-right:0px">[[Statement syntax#Notation conventions|(C)]] </td>
<td><p class="syntaxUL">NEW PAGE  </p></td></tr>
</table>
   
   
<p class="syntaxUL">LOOP END </p>
===[[Note statement|Note]]===
<table class="noBorder">
<hr>
<tr><td style="font-family:monoface; padding-right:0px">[[Statement syntax#Notation conventions|(**)]] </td>
<td><p class="syntaxUL">Note <span class="squareb">{</span><span class="term">fieldname</span> <span class="squareb">[</span>(<span class="term">subscript</span>)<span class="squareb">]</span><span class="squareb">}</span> </p></td></tr>
<p class="syntaxUL">MAX PFKEY n </p>
</table>
<p class="syntaxUL">Note '<span class="term">string</span>'
<hr>
<p class="syntaxUL">[DECLARE] MENU menuname
[GLOBAL [PERMANENT <span class="squareb">|</span> TEMPORARY]
<span class="squareb">|</span> [PERMANENT <span class="squareb">|</span> TEMPORARY] GLOBAL
<span class="squareb">|</span> COMMON]
</p>
</p>


<hr>
===[[On statement|On]]===
   
   
<p class="syntaxUL">MODIFY <span class="squareb">{</span>%menuname:itemname <span class="squareb">|</span> %screenname:itemname<span class="squareb">}</span>
<p class="syntaxUL">[[On statement|On]] <span class="squareb">{</span>Attention <span class="squareb">|</span> Error <span class="squareb">|</span> Field Constraint Conflict
[TO] attributes [[FOR] <span class="squareb">{</span>ALL <span class="squareb">|</span> READ <span class="squareb">|</span> REREAD <span class="squareb">|</span> TAB
  <span class="squareb">|</span> Find Conflict <span class="squareb">|</span> Missing File <span class="squareb">|</span> Missing Member
<span class="squareb">|</span> PRINT<span class="squareb">}</span>]
  <span class="squareb">|</span> Record Locking Conflict<span class="squareb">}</span>
  <span class="term">statements</span>
End On <span class="squareb">[</span><span class="term">label</span><span class="squareb">]</span>
</p>
</p>


<hr>
===Open===
   
   
<p class="syntaxUL">MODIFY BUFFER [SIZE=n
{{Template:Open (External I/O) statement syntax}}
<span class="squareb">|</span> %variable [PRESERVE <span class="squareb">|</span> NOPRESERVE]]
 
[FILL [X'nn'] <span class="squareb">|</span> CLEAR]
<p></p>  <!--Don't ask me why!-->
</p>
<table class="noBorder">
<tr><td style="font-family:monoface; padding-right:0px">[[Statement syntax#Notation conventions|(C)]] </td>
<hr>
<td>{{Template:Open and OpenC statements syntax}} </td></tr>
</table>
 
===OPEN PROCESS===
   
   
<p class="syntaxUL"><b><sup>(C)</sup></b>NEW PAGE  </p>
<p class="syntaxUL">OPEN PROCESS <span class="squareb">{</span><span class="term">processname</span> <span class="squareb">|</span> <span class="term">%variable</span><span class="squareb">}</span>
<span class="squareb">[</span>CID <span class="squareb">{</span><span class="term">name</span> <span class="squareb">|</span> <span class="term">%variable</span><span class="squareb">}</span><span class="squareb">]</span> </p>
<hr>
<p class="syntaxUL"><b><sup>(**)</sup></b>NOTE <var><span class="squareb">{</span></var>fieldname <span class="squareb">[</span>(subscript)<var>]<span class="squareb">}</span></var>
</p>


<hr>
<table class="noBorder">
<tr><td style="font-family:monoface; padding-right:0px">[[Statement syntax#Notation conventions|(+)]] </td>
<td><p class="syntaxUL">OPEN PROCESS <span class="squareb">{</span><span class="term">processname</span> <span class="squareb">|</span> <span class="term">%variable</span><span class="squareb">}</span>  <br>    <span class="squareb">[</span>CID <span class="squareb">{</span><span class="term">name</span> <span class="squareb">|</span> <span class="term">%variable</span><span class="squareb">}</span><span class="squareb">]</span>  <br>    <span class="squareb">{</span><span class="term">outbound-options</span> <span class="squareb">|</span> <span class="term">inbound-options</span><span class="squareb">}</span>
</p></td></tr>
</table>
   
   
<p class="syntaxUL">NOTE 'string' </p>
<div style="margin-left: 30px; background-color: #fBfBfB;">
<hr>
<p class="syntaxUL">ON <span class="squareb">{</span>ATTENTION <span class="squareb">|</span> ERROR <span class="squareb">|</span> FIELD CONSTRAINT CONFLICT
  <span class="squareb">|</span> FIND CONFLICT <span class="squareb">|</span> MISSING FILE <span class="squareb">|</span> MISSING MEMBER
  <span class="squareb">|</span> RECORD LOCKING CONFLICT<span class="squareb">}</span> statements </p>
<hr>
<p class="syntaxUL">OPEN <span class="squareb">{</span>[DATASET <span class="squareb">|</span> EXTERNAL] <span class="squareb">{</span>ext-filename
  <span class="squareb">|</span> %variable<span class="squareb">}</span>
  <span class="squareb">|</span> [EXTERNAL] <span class="squareb">{</span>TERMINAL <span class="squareb">|</span> %variable<span class="squareb">}</span><span class="squareb">}</span>
  FOR <span class="squareb">{</span>INPUT [OUTPUT] <span class="squareb">|</span> OUTPUT [INPUT] <span class="squareb">|</span> INOUT<span class="squareb">}</span>
  [PASSWORD <span class="squareb">{</span>value <span class="squareb">|</span> %variable<span class="squareb">}</span>]
</p>
<hr>
<p class="syntaxUL"><b><sup>(C)</sup></b>OPEN [C] [[PERM <span class="squareb">|</span> TEMP] GROUP <span class="squareb">|</span> FILE]
    <span class="squareb">{</span>name [AT <span class="squareb">{</span>location <span class="squareb">|</span> %variable <span class="squareb">|</span> =<span class="squareb">}</span>] |%variable<span class="squareb">}</span>
    [PASSWORD <span class="squareb">{</span>value <span class="squareb">|</span> %variable<span class="squareb">}</span>]
</p>
<hr>
<p class="syntaxUL">OPEN PROCESS <span class="squareb">{</span>processname <span class="squareb">|</span> %variable<span class="squareb">}</span>
[CID <span class="squareb">{</span>name <span class="squareb">|</span> %variable<span class="squareb">}</span>]
</p>
<hr>
<p class="syntaxUL"><b><sup>(+)</sup></b>OPEN PROCESS <span class="squareb">{</span>processname <span class="squareb">|</span> %variable<span class="squareb">}</span>
    [CID <span class="squareb">{</span>name <span class="squareb">|</span> %variable<span class="squareb">}</span>]
    <span class="squareb">{</span>outbound-options <span class="squareb">|</span> inbound-options<span class="squareb">}</span>
</p>
<div style="margin-left: 20px; background-color: #fBfBfB;">
<p>
<p>
where <var class="term">outbound-options</var> are:</p>
where <var class="term">outbound-options</var> are:</p>
<ul style="font-family: Consolas,monospace">
<ul style="font-family: Consolas,monospace">
<li>[AT DESTINATION] [WITH] [USERID <span class="squareb">{</span>%variable <span class="squareb">|</span> 'string'<span class="squareb">}</span>]
<li><span class="squareb">[</span>AT DESTINATION<span class="squareb">]</span> <span class="squareb">[</span>WITH<span class="squareb">]</span> <span class="squareb">[</span>USERID <span class="squareb">{</span><i>%variable</i> <span class="squareb">|</span> '<i>string</i>'<span class="squareb">}</span><span class="squareb">]</span>
   
   
<li>[PASSWORD <span class="squareb">{</span>%variable <span class="squareb">|</span> 'string'<span class="squareb">}</span>]
<li><span class="squareb">[</span>PASSWORD <span class="squareb">{</span><i>%variable</i> <span class="squareb">|</span> '<i>string</i>'<span class="squareb">}</span><span class="squareb">]</span>
   
   
<li>[<span class="squareb">{</span>ACCOUNT <span class="squareb">|</span> PROFILE <span class="squareb">{</span>%variable <span class="squareb">|</span> 'string'<span class="squareb">}</span>]
<li>[<span class="squareb">{</span>ACCOUNT <span class="squareb">|</span> PROFILE <span class="squareb">{</span>%<i>%variable</i> <span class="squareb">|</span> '<i>string</i>'<span class="squareb">}</span><span class="squareb">]</span>
   
   
<li>[INITIAL <span class="squareb">{</span>DATA 'string' <span class="squareb">|</span> DATA %variable <span class="squareb">|</span> IMAGE imagename] ...]
<li><span class="squareb">[</span>INITIAL <span class="squareb">{</span>DATA '<i>string</i>' <span class="squareb">|</span> DATA <i>%variable</i> <span class="squareb">|</span> IMAGE <i>imagename</i><span class="squareb">]</span> ...<span class="squareb">]</span>
</ul>
</ul>
<p>
<p>
and <var class="term">inbound-options</var> are:</p>
and <var class="term">inbound-options</var> are:</p>
   
   
<ul style="font-family: Consolas,monospace">
<ul style="font-family: Consolas,monospace">
<li>ACCEPT [INITIAL <span class="squareb">{</span>DATA %variable <span class="squareb">|</span> IMAGE image<span class="squareb">}</span> ...] </li>
<li>ACCEPT <span class="squareb">[</span>INITIAL <span class="squareb">{</span>DATA <i>%variable</i> <span class="squareb">|</span> IMAGE <i>image</i><span class="squareb">}</span> ...<span class="squareb">]</span> </li>
</ul>
</ul>
   
   
</div> <!-- end indent of options -->
</div> <!-- end indent of options -->
===[[Pause statement|Pause]]===
   
   
<hr>
{{Template:Pause statement syntax}}
 
<p class="syntaxUL">PAUSE <span class="squareb">[</span>n <span class="squareb">|</span> %variable<span class="squareb">]</span>
===PLACE RECORD ON===
</p>
<table class="noBorder">
<tr><td style="font-family:monoface; padding-right:0px">[[Statement syntax#Notation conventions|(**)]] </td>
<td><p class="syntaxUL">[[Lists#PLACE RECORD and REMOVE RECORD statements|PLACE RECORD ON]] <span class="squareb">[</span>LIST<span class="squareb">]</span> <span class="term">listname</span>
</p></td></tr>
</table>


<hr>
===PLACE RECORDS===
   
   
<p class="syntaxUL"><b><sup>(**)</sup></b>PLACE RECORD ON <span class="squareb">[</span>LIST<span class="squareb">]</span> listname
<p class="syntaxUL">PLACE RECORDS <span class="squareb">{</span>IN <span class="term">label</span> <span class="squareb">|</span> ON <span class="squareb">[</span>LIST<span class="squareb">]</span> <span class="term">listname1</span><span class="squareb">}</span> ON <span class="squareb">[</span>LIST<span class="squareb">]</span> <span class="term">listname2</span>
</p>
</p>
   
   
<hr>
===Position===
   
   
<p class="syntaxUL">PLACE RECORDS <span class="squareb">{</span>IN label <span class="squareb">|</span> ON [LIST] listname1<span class="squareb">}</span> ON [LIST] listname2
<p class="syntaxUL">POSITION <span class="squareb">{</span>FOUNDSET <span class="term">foundsortset_name</span> <span class="squareb">|</span> LIST <span class="term">list_name</span><span class="squareb">}</span> <span class="squareb">[</span>AT<span class="squareb">]</span> <span class="term">position_name</span></p>
</p>
   
   
<hr>
<p class="note"><b>Note:</b> Use the above form of the <var>Position</var> statement with <var>For</var> loop processing; see [[Global features#Position statement|Position statement]].</p>
 
<p class="syntaxUL">POSITION <span class="squareb">{</span>FOUNDSET foundsortset_name <span class="squareb">|</span> LIST list_name<span class="squareb">}</span> [AT] position_name
<p class="syntaxUL">POSITION <span class="squareb">{</span><span class="term">ext-filename</span> <span class="squareb">|</span> <span class="term">%variable</span><span class="squareb">}</span>
</p>
  AT KEY <span class="term">operator</span><span class="squareb">{</span><span class="term">value</span> <span class="squareb">|</span> <span class="term">%variable</span><span class="squareb">}</span></p>
<p class="note"><b>Note:</b> Use this form of the POSITION statement with FOR loop processing; see [[Global features#POSITION statement|POSITION statement]].</p>
 
<p class="note"><b>Note:</b> Use the above form of the <var>Position</var> statement with external file processing using images; see [[Images#Position statement|Position statement]].</p>
<hr>
<p class="syntaxUL">POSITION <span class="squareb">{</span>ext-filename <span class="squareb">|</span> %variable<span class="squareb">}</span>  
  AT KEY operator <span class="squareb">{</span>value <span class="squareb">|</span> %variable<span class="squareb">}</span>
</p>
<p class="note"><b>Note:</b> Use this form of the POSITION statement with external file processing using images; see [[Images#POSITION statement|POSITION statement]].</p>
<hr>
<p class="syntaxUL">PREPARE
<span class="squareb">{</span>[IMAGE] imagename <span class="squareb">|</span> [MENU] menuname
<span class="squareb">|</span> [SCREEN] screenname<span class="squareb">}</span>
</p>


<hr>
===[[Full-screen feature|PREPARE]]===
<p class="syntaxUL">PRINT print specifications  </p>
<hr>
   
   
<p class="syntaxUL"><b><sup>(**)</sup></b><span class="squareb">{</span>PAI <span class="squareb">|</span> PRINT ALL INFORMATION<span class="squareb">}</span>  
<p class="syntaxUL">PREPARE
    INTO array1, array2 [,array3] [FROM start] [COUNT ct]
<span class="squareb">{</span><span class="squareb">[</span>[[Images#PrepareStmtImage|IMAGE]]<span class="squareb">]</span> <span class="term">imagename</span> <span class="squareb">|</span> <span class="squareb">[</span>[[Full-screen feature#PrepareStmtMenu|MENU]]<span class="squareb">]</span> <span class="term">menuname</span>
<span class="squareb">|</span> <span class="squareb">[</span>[[Full-screen feature#PrepareStmtScrn|SCREEN]]<span class="squareb">]</span> <span class="term">screenname</span><span class="squareb">}</span>
</p>
</p>


<hr>
===Print===
   
   
<p class="syntaxUL">PRINT [MENU] menuname [ALERT]
<p class="syntaxUL">Print <span class="term">[[#Print specification syntax|printSpecifications]]</span>   </p>
[TITLE <span class="squareb">{</span>'text' <span class="squareb">|</span> %variable<span class="squareb">}</span> [AT [COLUMN] n]  
[TO [COLUMN] m <span class="squareb">|</span> LEN m] [attributes]]
</p>


<hr>
===Print All Fieldgroup Information (PAFGI)===
<table class="noBorder">
<p class="syntaxUL">PRINT SCREEN screenname [ALERT] [[WITH] CURSOR]
<tr><td style="font-family:monoface; padding-right:0px">[[Statement syntax#Notation conventions|(**)]] </td>
[TITLE <span class="squareb">{</span>'text' <span class="squareb">|</span> %variable<span class="squareb">}</span> [AT [COLUMN] n]
<td>{{Template:PAFGI statement syntax}} </td></tr>
[TO [COLUMN] m <span class="squareb">|</span> LEN m] [attributes]]
</table>
</p>


<hr>
===[[Print All Information statement|Print All Information]] or [[PAI statement|PAI]]===
<table class="noBorder">
<p class="syntaxUL">PROMPT <span class="squareb">{</span>'text' <span class="squareb">|</span> promptname<span class="squareb">}</span> [AT [COLUMN] n]  
<tr><td style="font-family:monoface; padding-right:0px">[[Statement syntax#Notation conventions|(**)]] </td>
[TO [COLUMN] m <span class="squareb">|</span> LEN m] [DP <span class="squareb">{</span>k <span class="squareb">|</span> *<span class="squareb">}</span>]] [DEFAULT 'value']
<td>{{Template:PAI statement syntax}} </td></tr>
[[READ] attributes] [REREAD attributes]
</table>
[PRINT attributes] [ITEMID n]
</p>


<hr>
===PRINT MENU===
   
   
<p class="syntaxUL"><b><sup>(+)</sup></b>QUERY PROCESS <span class="squareb">{</span>cid <span class="squareb">|</span> processname <span class="squareb">|</span> %variable<span class="squareb">}</span> options
<p class="syntaxUL">PRINT <span class="squareb">[</span>MENU<span class="squareb">]</span> <span class="term">menuname</span> <span class="squareb">[</span>ALERT<span class="squareb">]</span>
<span class="squareb">[</span>TITLE <span class="squareb">{</span>'<span class="term">text</span>' <span class="squareb">|</span> <span class="term">%variable</span><span class="squareb">}</span> <span class="squareb">[</span>AT <span class="squareb">[</span>COLUMN<span class="squareb">]</span> <span class="term">n</span><span class="squareb">]</span>
<span class="squareb">[</span>TO <span class="squareb">[</span>COLUMN<span class="squareb">]</span> <span class="term">m</span> <span class="squareb">|</span> LEN <span class="term">m</span><span class="squareb">]</span> <span class="squareb">[</span><span class="term">attributes</span><span class="squareb">]</span><span class="squareb">]</span>
</p>
</p>
   
   
<div style="margin-left: 20px; background-color: #fBfBfB;">
===PRINT SCREEN===
<p>
where options must be one or more of the following:</p>
<ul style="font-family: Consolas,monospace">
<li>STATE %variable
<li>PROCESSGROUP %variable
   
   
<li>REMOTEID %variable
<p class="syntaxUL">PRINT SCREEN <span class="term">screenname</span> <span class="squareb">[</span>ALERT<span class="squareb">]</span> <span class="squareb">[</span><span class="squareb">[</span>WITH<span class="squareb">]</span> CURSOR<span class="squareb">]</span>
  <span class="squareb">[</span>TITLE <span class="squareb">{</span>'<span class="term">text</span>' <span class="squareb">|</span> <span class="term">%variable</span><span class="squareb">}</span> <span class="squareb">[</span>AT <span class="squareb">[</span>COLUMN<span class="squareb">]</span> <span class="term">n</span><span class="squareb">]</span>
<li>SYNCLEVEL %variable
  <span class="squareb">[</span>TO <span class="squareb">[</span>COLUMN<span class="squareb">]</span> <span class="term">m</span> <span class="squareb">|</span> LEN <span class="term">m</span><span class="squareb">]</span> <span class="squareb">[</span><span class="term">attributes</span><span class="squareb">]</span><span class="squareb">]</span>
<li>MODENAME %variable
</ul>
</div> <!-- end options indenting -->
<hr>
<p class="syntaxUL">READ [IMAGE] imagename
  FROM <span class="squareb">{</span>ext-filename <span class="squareb">|</span> TERMINAL <span class="squareb">|</span> %variable<span class="squareb">}</span>  
[PROMPT <span class="squareb">{</span>'text' <span class="squareb">|</span> %variable<span class="squareb">}</span>]
  [NEXT <span class="squareb">|</span> KEY operator <span class="squareb">{</span>value <span class="squareb">|</span> %variable<span class="squareb">}</span>]  
</p>
</p>
<hr>
   
   
<p class="syntaxUL">READ [IMAGE] imagename FROM BUFFER
===[[Horizon SOUL interface#Query Process statement|Query Process]]===
  [POSITION=<span class="squareb">{</span>%pvariable <span class="squareb">|</span> n<span class="squareb">}</span>]
<table class="noBorder">
  [MAXLEN=<span class="squareb">{</span>%lvariable <span class="squareb">|</span> n<span class="squareb">}</span>]
<tr><td style="font-family:monoface; padding-right:0px">[[Statement syntax#Notation conventions|(+)]] </td>
</p>
<td>{{Template:Query Process statement syntax}} </td></tr>
</table>


<hr>
===<b id="READ"></b>[[Read Image statement|Read Image]]===
   
   
<p class="syntaxUL">READ [MENU] menuname [ALERT]
{{Template:Read Image statement syntax}}
[TITLE ['text' <span class="squareb">|</span> %variable<span class="squareb">}</span> [AT [COLUMN] n]
[TO [COLUMN] m <span class="squareb">|</span> LEN m] [attributes]]
</p>
 
<hr>
<p class="syntaxUL">READ <span class="squareb">[</span>SCREEN<span class="squareb">]</span> screenname <span class="squareb">[</span>ALERT<span class="squareb">]</span> <span class="squareb">[</span>NO REREAD<span class="squareb">]</span> <var>[ [</var>WITH<span class="squareb">]</span> CURSOR<span class="squareb">]</span>
[TITLE <span class="squareb">{</span>'text' <span class="squareb">|</span> %variable<span class="squareb">}</span> [AT [COLUMN] n]
[TO [COLUMN] m <span class="squareb">|</span> LEN m] [attributes]]
</p>


<hr>
===READ <i>menuname</i>===
   
   
<p class="syntaxUL">RECEIVE <span class="squareb">{</span>IMAGE imagename <span class="squareb">|</span> %variable<span class="squareb">}</span>  
<p class="syntaxUL">READ <span class="squareb">[</span>MENU<span class="squareb">]</span> <span class="term">menuname</span> <span class="squareb">[</span>ALERT<span class="squareb">]</span>
  FROM <span class="squareb">{</span>cid <span class="squareb">|</span> processname <span class="squareb">|</span> %variable<span class="squareb">}</span> [RESULT %variable]
<span class="squareb">[</span>TITLE <span class="squareb">[</span>'<span class="term">text</span>' <span class="squareb">|</span> <span class="term">%variable</span><span class="squareb">}</span> <span class="squareb">[</span>AT <span class="squareb">[</span>COLUMN<span class="squareb">]</span> <span class="term">n</span><span class="squareb">]</span>
  <span class="squareb">[</span>TO <span class="squareb">[</span>COLUMN<span class="squareb">]</span> <span class="term">m</span> <span class="squareb">|</span> LEN <span class="term">m</span><span class="squareb">]</span> <span class="squareb">[</span><span class="term">attributes</span><span class="squareb">]</span><span class="squareb">]</span>
</p>
</p>
   
   
<hr>
===READ <i>screenname</i>===
   
   
<p class="syntaxUL"><b><sup>(+)</sup></b>RECEIVE <span class="squareb">{</span>IMAGE imagename <span class="squareb">|</span> %variable<span class="squareb">}</span>  
<p class="syntaxUL">READ <span class="squareb">[</span>SCREEN<span class="squareb">]</span> <span class="term">screenname</span> <span class="squareb">[</span>ALERT<span class="squareb">]</span> <span class="squareb">[</span>NO REREAD<span class="squareb">]</span> <span class="squareb">[</span> <span class="squareb">[</span>WITH<span class="squareb">]</span> CURSOR<span class="squareb">]</span>
    FROM <span class="squareb">{</span>cid <span class="squareb">|</span> processname <span class="squareb">|</span> %variable<span class="squareb">}</span>  
<span class="squareb">[</span>TITLE <span class="squareb">{</span>'<span class="term">text</span>' <span class="squareb">|</span> <span class="term">%variable</span><span class="squareb">}</span> <span class="squareb">[</span>AT <span class="squareb">[</span>COLUMN<span class="squareb">]</span> <span class="term">n</span><span class="squareb">]</span>
    RESULT %variable
<span class="squareb">[</span>TO <span class="squareb">[</span>COLUMN<span class="squareb">]</span> <span class="term">m</span> <span class="squareb">|</span> LEN <span class="term">m</span><span class="squareb">]</span> <span class="squareb">[</span><span class="term">attributes</span><span class="squareb">]</span><span class="squareb">]</span>
</p>
</p>
   
   
<hr>
===RECEIVE IMAGE===
   
   
<p class="syntaxUL">RELEASE ALL RECORDS</p>
<p class="syntaxUL">RECEIVE <span class="squareb">{</span>IMAGE <span class="term">imagename</span> <span class="squareb">|</span> <span class="term">%variable</span><span class="squareb">}</span>
FROM <span class="squareb">{</span><span class="term">cid</span> <span class="squareb">|</span> <span class="term">processname</span> <span class="squareb">|</span> <span class="term">%variable</span><span class="squareb">}</span> <span class="squareb">[</span>RESULT <span class="term">%variable</span><span class="squareb">]</span> </p>
 
<table class="noBorder">
<tr><td style="font-family:monoface; padding-right:0px">[[Statement syntax#Notation conventions|(+)]] </td>
<td><p class="syntaxUL">RECEIVE <span class="squareb">{</span>IMAGE <span class="term">imagename</span> <span class="squareb">|</span> <span class="term">%variable</span><span class="squareb">}</span>  <br>  FROM <span class="squareb">{</span><span class="term">cid</span> <span class="squareb">|</span> <span class="term">processname</span> <span class="squareb">|</span> <span class="term">%variable</span><span class="squareb">}</span>  <br>  RESULT <span class="term">%variable</span>
</p></td></tr>
</table>
 
===[[Release All Records statement|Release All Records]]===
   
   
<hr>
{{Template:Release All Records statement syntax}}
 
===[[Release Position statement|Release Position]]===
   
   
<p class="syntaxUL">RELEASE POSITION <span class="squareb">{</span>ext-filename <span class="squareb">|</span> %variable<span class="squareb">}</span>
<table class="noBorder">
</p>
<tr><td>{{Template:Release Position statement syntax}} </td></tr>
</table>
 
===[[Release Records statement|Release Records]]===
   
   
<hr>
{{Template:Release Records statement syntax}}
 
===[[Remember statement|Remember]]===
<table class="noBorder">
<tr><td style="font-family:monoface; padding-right:0px">[[Statement syntax#Notation conventions|(**)]] </td>
<td>{{Template:Remember statement syntax}}</td></tr>
</table>
   
   
<p class="syntaxUL">RELEASE RECORDS <span class="squareb">{</span>IN label <span class="squareb">|</span> ON [LIST] listname<span class="squareb">}</span>
===REMOVE RECORD FROM===
</p>
<table class="noBorder">
<tr><td style="font-family:monoface; padding-right:0px">[[Statement syntax#Notation conventions|(**)]] </td>
<hr>
<td><p class="syntaxUL">[[Lists#PLACE RECORD and REMOVE RECORD statements|REMOVE RECORD FROM]] <span class="squareb">[</span>LIST<span class="squareb">]</span> <span class="term">listname</span>
</p></td></tr>
<p class="syntaxUL"><b><sup>(**)</sup></b>REMEMBER <span class="squareb">[</span>GLOBAL<span class="squareb">]</span> position_name
</table>
    [IN foundsortset_name <span class="squareb">|</span> ON list_name]
 
</p>
===REMOVE RECORDS===
<hr>
   
   
<p class="syntaxUL"><b><sup>(**)</sup></b>REMOVE RECORD FROM <span class="squareb">[</span>LIST<span class="squareb">]</span> listname
<p class="syntaxUL">REMOVE RECORDS <span class="squareb">{</span>IN <span class="term">label</span> <span class="squareb">|</span> ON <span class="squareb">[</span>LIST<span class="squareb">]</span> <span class="term">listname</span><span class="squareb">}</span>
FROM <span class="squareb">[</span>LIST<span class="squareb">]</span> <span class="term">listname2</span>
</p>
</p>
   
   
<hr>
===REPEAT===
   
   
<p class="syntaxUL">REMOVE RECORDS <span class="squareb">{</span>IN label <span class="squareb">|</span> ON [LIST] listname<span class="squareb">}</span>  
<p class="syntaxUL">REPEAT <span class="squareb">[</span>FOREVER <span class="squareb">|</span> <span class="term">n</span> TIMES <span class="squareb">|</span> WHILE <span class="term">expression</span><span class="squareb">]</span>
FROM [LIST] listname2
</p>
</p>
   
   
<hr>
===REREAD===
   
   
<p class="syntaxUL">REPEAT [FOREVER <span class="squareb">|</span> n TIMES <span class="squareb">|</span> WHILE expression]
<p class="syntaxUL">REREAD <span class="squareb">[</span>SCREEN<span class="squareb">]</span> <span class="term">screenname</span> <span class="squareb">[</span>ALERT<span class="squareb">]</span> <span class="squareb">[</span><span class="squareb">[</span>WITH<span class="squareb">]</span> CURSOR<span class="squareb">]</span>
<span class="squareb">[</span>TITLE <span class="squareb">{</span>'<span class="term">text</span>' <span class="squareb">|</span> <span class="term">%variable</span><span class="squareb">}</span> <span class="squareb">[</span>AT <span class="squareb">[</span>COLUMN<span class="squareb">]</span> <span class="term">n</span><span class="squareb">]</span>
<span class="squareb">[</span>TO <span class="squareb">[</span>COLUMN<span class="squareb">]</span> <span class="term">m</span> <span class="squareb">|</span> LEN <span class="term">m</span><span class="squareb">]</span> <span class="squareb">[</span><span class="term">attributes</span><span class="squareb">]</span><span class="squareb">]</span>
</p>
</p>
   
   
<hr>
===RESET===
   
   
<p class="syntaxUL">REREAD [SCREEN] screenname [ALERT] [[WITH] CURSOR]
<p class="syntaxUL">RESET <span class="squareb">{</span>HEADER <span class="squareb">|</span> TRAILER<span class="squareb">}</span> <span class="term">m</span>
[TITLE <span class="squareb">{</span>'text' <span class="squareb">|</span> %variable<span class="squareb">}</span> [AT [COLUMN] n]
[TO [COLUMN] m <span class="squareb">|</span> LEN m] [attributes]]
</p>
</p>


<hr>
===[[Exceptions#Rethrow statement|Rethrow]]===
   
   
<p class="syntaxUL">RESET <span class="squareb">{</span>HEADER <span class="squareb">|</span> TRAILER<span class="squareb">}</span> m
{{Template:Rethrow statement syntax}}
</p>


<hr>
===RETRY===
   
   
<p class="syntaxUL">RETRY <span class="squareb">[</span>PENDING STATEMENT<span class="squareb">]</span>
<p class="syntaxUL">RETRY <span class="squareb">[</span>PENDING STATEMENT<span class="squareb">]</span>
</p>
</p>
 
<hr>
===RETURN===
   
   
<p class="syntaxUL">RETURN
<p class="syntaxUL">RETURN
</p>
</p>


<hr>
===<b id="SCREEN"></b>[[Screen statement or block|Screen]]===
   
   
<p class="syntaxUL">[DECLARE] SCREEN screenname
{{Template:Screen statement syntax}}
[GLOBAL [<u><b>PERM</b>ANENT</u> <span class="squareb">|</span> <b>TEMP</b>ORARY]
<span class="squareb">|</span> [<u><b>PERM</b>ANENT</u> <span class="squareb">|</span> <b>TEMP</b>ORARY] GLOBAL
<span class="squareb">|</span> COMMON]
</p>


<hr>
===SEND===
   
   
<p class="syntaxUL">SEND <span class="squareb">{</span>IMAGE imagename <span class="squareb">|</span> 'string' <span class="squareb">|</span> %variable<span class="squareb">}</span>  
<p class="syntaxUL">SEND <span class="squareb">{</span>IMAGE <span class="term">imagename</span> <span class="squareb">|</span> '<span class="term">string</span>' <span class="squareb">|</span> <span class="term">%variable</span><span class="squareb">}</span>
  TO <span class="squareb">{</span>cid <span class="squareb">|</span> processname <span class="squareb">|</span> %variable<span class="squareb">}</span>  
  TO <span class="squareb">{</span><span class="term">cid</span> <span class="squareb">|</span> <span class="term">processname</span> <span class="squareb">|</span> <span class="term">%variable</span><span class="squareb">}</span>
  [REQSEND %variable]  
  <span class="squareb">[</span>REQSEND <span class="term">%variable</span><span class="squareb">]</span>
  [FLUSH]
  <span class="squareb">[</span>FLUSH<span class="squareb">]</span>
 
 
<b><sup>(+)</sup></b>SEND <span class="squareb">{</span>IMAGE <span class="term">imagename</span> <span class="squareb">|</span> '<span class="term">string</span>' <span class="squareb">|</span> <span class="term">%variable</span><span class="squareb">}</span>
    TO <span class="squareb">{</span><span class="term">cid</span> <span class="squareb">|</span> <span class="term">processname</span> <span class="squareb">|</span> <span class="term">%variable</span><span class="squareb">}</span>
    <span class="squareb">[</span>FLUSH <span class="squareb">|</span> CONFIRM<span class="squareb">]</span>
    <span class="squareb">[</span>REQSEND <span class="term">%variable</span><span class="squareb">]</span>
</p>
</p>


<hr>
===[[Horizon SOUL interface#Send Error statement|Send Error]]===
<table class="noBorder">
<tr><td style="font-family:monoface; padding-right:0px">[[Statement syntax#Notation conventions|(+)]] </td>
<td>{{Template:Send Error statement syntax}} </td></tr>
</table>
===SET===
   
   
<p class="syntaxUL"><b><sup>(+)</sup></b>SEND <span class="squareb">{</span>IMAGE imagename <span class="squareb">|</span> 'string' <span class="squareb">|</span> %variable<span class="squareb">}</span>  
<p class="syntaxUL">SET <span class="squareb">{</span>HEADER <span class="squareb">|</span> TRAILER<span class="squareb">}</span> <span class="term">m</span> <span class="term">[[#Print specification syntax|print-specifications]]</span>
    TO <span class="squareb">{</span>cid <span class="squareb">|</span> processname <span class="squareb">|</span> %variable<span class="squareb">}</span>
    [FLUSH <span class="squareb">|</span> CONFIRM]
    [REQSEND %variable]
</p>
</p>


<hr>
===[[SetText statement|SetText]]===
   
   
<p class="syntaxUL"><b><sup>(+)</sup></b>SEND ERROR TO <span class="squareb">{</span>cid <span class="squareb">|</span> processname <span class="squareb">|</span> %variable<span class="squareb">}</span>
{{Template:SetText statement syntax}}
          REQSEND %variable
</p>


<hr>
===SIGNAL PROCESS===
   
   
<p class="syntaxUL">SET <span class="squareb">{</span>HEADER <span class="squareb">|</span> TRAILER<span class="squareb">}</span> m print-specifications
<p class="syntaxUL">SIGNAL PROCESS
</p>
<span class="squareb">{</span><span class="term">cid</span> <span class="squareb">|</span> [<span class="term">processname</span> <span class="squareb">|</span> <span class="term">%variable</span><span class="squareb">}</span> <span class="squareb">{</span><span class="term">nnn</span> <span class="squareb">|</span> <span class="term">%variable</span><span class="squareb">}</span> </p>
 
<table class="noBorder">
<tr><td style="font-family:monoface; padding-right:0px">[[Statement syntax#Notation conventions|(+)]] </td>
<td><p class="syntaxUL">SIGNAL PROCESS        <br>  <span class="squareb">{</span><span class="term">cid</span> <span class="squareb">|</span> [<span class="term">processname</span> <span class="squareb">|</span> <span class="term">%variable</span><span class="squareb">}</span>
</p></td></tr>
</table>


<hr>
===[[Sirius Case statement|Sirius Case]] directive===
   
   
<p class="syntaxUL">SIGNAL PROCESS
<table class="noBorder">
<span class="squareb">{</span>cid <span class="squareb">|</span> [processname <span class="squareb">|</span> %variable<span class="squareb">}</span> <span class="squareb">{</span>nnn <span class="squareb">|</span> %variable<span class="squareb">}</span>
<tr><td style="font-family:monoface; padding:0px">[[Statement syntax#Notation conventions|(C)]] </td>
</p>
<td>{{Template:Sirius Case statement syntax}} </td></tr>
</table>


<hr>
===SKIP LINES===
   
   
<p class="syntaxUL"><b><sup>(+)</sup></b>SIGNAL PROCESS
<p class="syntaxUL">SKIP <span class="term">n</span> LINE<span class="squareb">[</span>S<span class="squareb">]</span>
    <span class="squareb">{</span>cid <span class="squareb">|</span> [processname <span class="squareb">|</span> %variable<span class="squareb">}</span>
</p>
</p>
   
   
<hr>
===[[Skip Position statement|Skip Position]]===
   
   
<p class="syntaxUL">SKIP n LINE<span class="squareb">[</span>S<span class="squareb">]</span>
<table class="noBorder">
</p>
<tr><td>{{Template:Skip Position statement syntax}} </td></tr>
</table>
<hr>
<p class="syntaxUL">[itemname IS] SKIP n POSITION[S]
[INITIAL <span class="squareb">{</span>NULL <span class="squareb">|</span> character <span class="squareb">|</span> BLANK<span class="squareb">}</span>]
</p>


<hr>
===SORT RECORDS===
   
   
<p class="syntaxUL">SORT [k] RECORDS <span class="squareb">{</span>IN label <span class="squareb">|</span> ON [LIST] listname<span class="squareb">}</span>  
<p class="syntaxUL">SORT [<span class="term">k</span><span class="squareb">]</span> RECORDS <span class="squareb">{</span>IN <span class="term">label</span> <span class="squareb">|</span> ON <span class="squareb">[</span>LIST<span class="squareb">]</span> <span class="term">listname</span><span class="squareb">}</span>
  BY key [AND key] ...
  BY <span class="term">key</span> <span class="squareb">[</span>AND <span class="term">key</span><span class="squareb">]</span> ...
</p>
</p>
   
   
Line 827: Line 773:
where <var class="term">key</var> is:</p>
where <var class="term">key</var> is:</p>
<ul style="font-family: Consolas,monospace">
<ul style="font-family: Consolas,monospace">
<li>key = fieldname <br>
<li><i>key</i> = <i>fieldname</i> <br>
       [VALUE <span class="squareb">{</span>[ASCENDING <span class="squareb">|</span> DESCENDING] <br>
       <span class="squareb">[</span>VALUE <span class="squareb">{</span><span class="squareb">[</span>ASCENDING <span class="squareb">|</span> DESCENDING<span class="squareb">]</span> <br>
       [CHARACTER <span class="squareb">|</span> NUMERICAL] <span class="squareb">|</span> RIGHT-ADJUSTED]<span class="squareb">}</span> ...] </li>
       <span class="squareb">[</span>CHARACTER <span class="squareb">|</span> NUMERICAL<span class="squareb">]</span> <span class="squareb">|</span> RIGHT-ADJUSTED<span class="squareb">]</span><span class="squareb">}</span> ...<span class="squareb">]</span> </li>
</ul>
</ul>
   
   
</div> <!--end key indent -->
</div> <!--end key indent -->
   
   
<hr>
===SORT RECORD KEYS===
   
   
<p class="syntaxUL">SORT [k] RECORD KEYS
<p class="syntaxUL">SORT [<span class="term">k</span><span class="squareb">]</span> RECORD KEYS
  <span class="squareb">{</span>IN label <span class="squareb">|</span> ON [LIST] listname<span class="squareb">}</span>  
  <span class="squareb">{</span>IN <span class="term">label</span> <span class="squareb">|</span> ON <span class="squareb">[</span>LIST<span class="squareb">]</span> <span class="term">listname</span><span class="squareb">}</span>
  BY key [AND key] ...
  BY <span class="term">key</span> <span class="squareb">[</span>AND <span class="term">key</span><span class="squareb">]</span> ...
</p>
</p>
   
   
Line 845: Line 791:
where <var class="term">key</var> is:</p>
where <var class="term">key</var> is:</p>
<ul style="font-family: Consolas,monospace">
<ul style="font-family: Consolas,monospace">
<li>key = fieldname <br>
<li><i>key</i> = <i>fieldname</i> <br>
       [VALUE <span class="squareb">{</span>[ASCENDING <span class="squareb">|</span> DESCENDING] <br>
       <span class="squareb">[</span>VALUE <span class="squareb">{</span><span class="squareb">[</span>ASCENDING <span class="squareb">|</span> DESCENDING<span class="squareb">]</span> <br>
       [CHARACTER <span class="squareb">|</span> NUMERICAL] <span class="squareb">|</span> [RIGHT-ADJUSTED]<span class="squareb">}</span> ...] </li>
       <span class="squareb">[</span>CHARACTER <span class="squareb">|</span> NUMERICAL<span class="squareb">]</span> <span class="squareb">|</span> <span class="squareb">[</span>RIGHT-ADJUSTED<span class="squareb">]</span><span class="squareb">}</span> ...<span class="squareb">]</span> </li>
</ul>
</ul>
   
   
</div>
</div>
   
   
<hr>
===SORT VALUE IN===
   
   
<p class="syntaxUL">SORT VALUE IN label [IN [ASCENDING <span class="squareb">|</span> DESCENDING]  
<p class="syntaxUL">SORT VALUE IN <span class="term">label</span> <span class="squareb">[</span>IN <span class="squareb">[</span>ASCENDING <span class="squareb">|</span> DESCENDING<span class="squareb">]</span>
  [<u>CHARACTER</u> <span class="squareb">|</span> NUMERICAL] <span class="squareb">|</span> [RIGHT-ADJUSTED] ORDER]
  [<u>CHARACTER</u> <span class="squareb">|</span> NUMERICAL<span class="squareb">]</span> <span class="squareb">|</span> <span class="squareb">[</span>RIGHT-ADJUSTED<span class="squareb">]</span> ORDER<span class="squareb">]</span>
</p>
</p>
<hr>
   
   
<p class="syntaxUL">STOP [IF COUNT IN label EXCEEDS n]
===STOP===
</p>
   
   
<hr>
<table class="noBorder">
<tr>
<p class="syntaxUL"><b><sup>(*)</sup></b>STORE RECORD [sort or hash key value]  
<td style="font-family:monoface; padding-right:0px">[[Statement syntax#Notation conventions|(C)]]</td>
  fieldname1=[value1 <span class="squareb">|</span> (expression1)]  
<td><p class="syntaxUL">STOP <span class="squareb">[</span>IF COUNT IN <span class="term">label</span> EXCEEDS <span class="term">n</span><span class="squareb">]</span>
  [fieldname2=(expression)]  
</p></td></tr>
  ...  
</table>
  [THEN CONTINUE  
 
      statement  
===STORE RECORD===
      statement  
<table class="noBorder">
      ...]  
<tr><td style="font-family:monoface; padding-right:0px">[[Statement syntax#Notation conventions|(*)]] </td>
  END STORE
<td><p class="syntaxUL">STORE RECORD [<span class="term">sort or hash key value</span><span class="squareb">]</span>    <br>  <span class="term">fieldname1</span>=[<span class="term">value1</span> <span class="squareb">|</span> (<span class="term">expression1</span>)<span class="squareb">]</span>    <br>  [<span class="term">fieldname2</span>=(<span class="term">expression</span>)<span class="squareb">]</span>    <br>  ...     <br>  <span class="squareb">[</span>THEN CONTINUE     <br>      <span class="term">statement</span>    <br>      <span class="term">statement</span>    <br>      ...<span class="squareb">]</span>    <br>  END STORE
</p>
</p></td></tr>
</table>
   
   
<hr>
===SUBROUTINE===
   
   
<p class="syntaxUL">SUBROUTINE
<p class="syntaxUL">SUBROUTINE
</p>
 
SUBROUTINE <span class="term">subname</span>
<hr>
  <span class="squareb">[</span>(<span class="term">formal-parameter</span> <span class="squareb">[</span>INPUT <span class="squareb">|</span> OUTPUT <span class="squareb">|</span> INPUT OUTPUT<span class="squareb">]</span> <span class="squareb">[</span>,...<span class="squareb">]</span>)<span class="squareb">]</span>
   
<p class="syntaxUL">SUBROUTINE subname
[(formal-parameter [INPUT <span class="squareb">|</span> OUTPUT <span class="squareb">|</span> INPUT OUTPUT] [,...])]
</p>
</p>
   
   
Line 891: Line 832:
where <var class="term">formal-parameter</var> is one of the following:</p>
where <var class="term">formal-parameter</var> is one of the following:</p>
<ul style="font-family: Consolas,monospace">
<ul style="font-family: Consolas,monospace">
<li>%variable [IS STRING [LEN n] [DP <span class="squareb">{</span>n <span class="squareb">|</span> *<span class="squareb">}</span>] [ARRAY (*[,*[,*]]) [NO FS]] <br>
<li><i>%variable</i> <span class="squareb">[</span>IS STRING <span class="squareb">[</span>LEN <i>n</i><span class="squareb">]</span> <span class="squareb">[</span>DP <span class="squareb">{</span><i>n</i> <span class="squareb">|</span> *<span class="squareb">}</span><span class="squareb">]</span> <span class="squareb">[</span>ARRAY (*<span class="squareb">[</span>,*<span class="squareb">[</span>,*<span class="squareb">]</span><span class="squareb">]</span>) <span class="squareb">[</span>NO FS<span class="squareb">]</span><span class="squareb">]</span> <br>
           <span class="squareb">|</span> IS <span class="squareb">{</span>FIXED [DP n] <span class="squareb">|</span> FLOAT<span class="squareb">}</span> [ARRAY (*[,*[,*]])]]
           <span class="squareb">|</span> IS <span class="squareb">{</span>FIXED <span class="squareb">[</span>DP <i>n</i><span class="squareb">]</span> <span class="squareb">|</span> FLOAT<span class="squareb">}</span> <span class="squareb">[</span>ARRAY (*<span class="squareb">[</span>,*<span class="squareb">[</span>,*<span class="squareb">]</span><span class="squareb">]</span>)<span class="squareb">]</span><span class="squareb">]</span>
   
   
<li>LIST listname [IN [FILE <span class="squareb">|</span> [PERM <span class="squareb">|</span> TEMP] GROUP] name]
<li>LIST <i>listname</i> <span class="squareb">[</span>IN <span class="squareb">[</span>FILE <span class="squareb">|</span> <span class="squareb">[</span>PERM <span class="squareb">|</span> TEMP<span class="squareb">]</span> GROUP<span class="squareb">]</span> <i>name</i><span class="squareb">]</span>
</ul>
</ul>
</div>
</div>
===TAG===
   
   
<hr>
<p class="syntaxUL">TAG <span class="term">%screenname</span>:<span class="term">inputname</span> <span class="squareb">[</span><span class="term">attributes</span><span class="squareb">]</span> <span class="squareb">[</span>WITH 'c'<span class="squareb">]</span>
<p class="syntaxUL">TAG %screenname:inputname <span class="squareb">[</span>attributes<span class="squareb">]</span> <span class="squareb">[</span>WITH 'c'<span class="squareb">]</span>
</p>
</p>
   
   
<hr>
===[[Horizon SOUL interface#Test Receipt statement|Test Receipt]]===
<table class="noBorder">
<p class="syntaxUL"><b><sup>(+)</sup></b>TEST [FOR]  
<tr><td style="font-family:monoface; padding-right:0px">[[Statement syntax#Notation conventions|(+)]] </td>
    <span class="squareb">{</span>ANY RECEIPT RETURN %variable
<td>{{Template:Test Receipt statement syntax}} </td></tr>
    <span class="squareb">|</span> RECEIPT <span class="squareb">{</span>cid <span class="squareb">|</span> processname <span class="squareb">|</span> %variable<span class="squareb">}</span><span class="squareb">}</span>
</table>
</p>
 
===TITLE===
<hr>
   
   
<p class="syntaxUL">TITLE <span class="squareb">{</span>'text' <span class="squareb">|</span> promptname<span class="squareb">}</span>  
<p class="syntaxUL">TITLE <span class="squareb">{</span>'<span class="term">text</span>' <span class="squareb">|</span> <span class="term">promptname</span><span class="squareb">}</span>
  [AT [COLUMN] n] [TO [COLUMN] m <span class="squareb">|</span> [LEN m]  
  <span class="squareb">[</span>AT <span class="squareb">[</span>COLUMN<span class="squareb">]</span> <span class="term">n</span><span class="squareb">]</span>  <span class="squareb">[</span>TO <span class="squareb">[</span>COLUMN<span class="squareb">]</span> <span class="term">m</span> <span class="squareb">|</span> <span class="squareb">[</span>LEN <span class="term">m</span><span class="squareb">]</span>
  [DP <span class="squareb">{</span>k <span class="squareb">|</span> *<span class="squareb">}</span>]]  
  <span class="squareb">[</span>DP <span class="squareb">{</span><span class="term">k</span> <span class="squareb">|</span> *<span class="squareb">}</span><span class="squareb">]</span><span class="squareb">]</span>
  [DEFAULT 'value']  
  <span class="squareb">[</span>DEFAULT '<span class="term">value</span>'<span class="squareb">]</span>
  [[READ] attributes] [REREAD attributes] [PRINT attributes]
  <span class="squareb">[</span><span class="squareb">[</span>READ<span class="squareb">]</span> <span class="term">attributes</span><span class="squareb">]</span>  <span class="squareb">[</span>REREAD <span class="term">attributes</span><span class="squareb">]</span>  <span class="squareb">[</span>PRINT <span class="term">attributes</span><span class="squareb">]</span>
</p>
</p>
   
   
<hr>
===<b id="trace"></b>[[Trace statement|Trace]]===
   
   
<p class="syntaxUL">TRANSFER [CONTROL] TO PROCESS <span class="squareb">{</span>processname <span class="squareb">|</span> %variable<span class="squareb">}</span>
{{Template:Trace statement syntax}}
[WITH] [USERID <span class="squareb">{</span>%variable <span class="squareb">|</span> 'string'<span class="squareb">}</span>]
[PASSWORD <span class="squareb">{</span>variable <span class="squareb">|</span> 'string'<span class="squareb">}</span>]
[ACCOUNT <span class="squareb">{</span>%variable <span class="squareb">|</span> 'string'<span class="squareb">}</span>]
[PASSING <span class="squareb">{</span>IMAGE imagename <span class="squareb">|</span> 'string' <span class="squareb">|</span> %variable<span class="squareb">}</span>]
</p>


<hr>
<p class="note"><b>Note:</b> The output of the <var>Trace</var> statement is controlled by the <var>[[ULTRACE parameter|ULTRACE]]</var> parameter.</p>
<p class="syntaxUL">UPDATE RECORD</p>
<hr>
<p class="syntaxUL">VARIABLES ARE
<span class="squareb">{</span>FIXED [DP n] <span class="squareb">|</span> FLOAT
<span class="squareb">|</span> STRING [LEN n] [DP <span class="squareb">{</span>n <span class="squareb">|</span> *<span class="squareb">}</span>]  
<span class="squareb">|</span> UNDEFINED<span class="squareb">}</span>  
</p>


<hr>
===[[Program Communication facilities#TRANSFER statement format and execution|TRANSFER]]===
   
   
<p class="syntaxUL">[DECLARE] %variable [IS]  
<p class="syntaxUL">TRANSFER <span class="squareb">[</span>CONTROL<span class="squareb">]</span> TO PROCESS <span class="squareb">{</span><span class="term">processname</span> <span class="squareb">|</span> <span class="term">%variable</span><span class="squareb">}</span>
  <span class="squareb">{</span>FIXED [DP n] <span class="squareb">|</span> FLOAT<span class="squareb">}</span> [ARRAY (d1[,d2[,d3]])]  
<span class="squareb">[</span>WITH<span class="squareb">]</span> <span class="squareb">[</span>USERID <span class="squareb">{</span><span class="term">string</span> <span class="squareb">|</span> '<span class="term">%variable</span>'<span class="squareb">}</span><span class="squareb">]</span>
  [COMMON]
  <span class="squareb">[</span>PASSWORD <span class="squareb">{</span><span class="term">variable</span> <span class="squareb">|</span> '<span class="term">string</span>'<span class="squareb">}</span><span class="squareb">]</span>
<span class="squareb">[</span>ACCOUNT <span class="squareb">{</span><span class="term">%variable</span> <span class="squareb">|</span> '<span class="term">string</span>'<span class="squareb">}</span><span class="squareb">]</span>
  <span class="squareb">[</span>PASSING <span class="squareb">{</span>IMAGE <span class="term">imagename</span> <span class="squareb">|</span> '<span class="term">string</span>' <span class="squareb">|</span> <span class="term">%variable</span><span class="squareb">}</span><span class="squareb">]</span>
</p>
</p>


<hr>
===UPDATE RECORD===
   
   
<p class="syntaxUL">[DECLARE] %variable [IS]
<p class="syntaxUL">UPDATE RECORD</p>
STRING [LEN n] [DP <span class="squareb">{</span>n <span class="squareb">|</span> *<span class="squareb">}</span>] [ARRAY (d1[,d2[d3]])]
[NO FIELD SAVE] [COMMON]
%variable [(subscript)] = expression
</p>
   
   
<hr>
===VARIABLES ARE===
   
   
<p class="syntaxUL"><b><sup>(+)</sup></b>WAIT [<span class="squareb">{</span>n <span class="squareb">|</span> %variable<span class="squareb">}</span> SEC[S]] [FOR]
<p class="syntaxUL">VARIABLES ARE
    <span class="squareb">{</span>ANY RECEIPT RETURN %variable
<span class="squareb">{</span>FIXED <span class="squareb">[</span>DP <span class="term">n</span><span class="squareb">]</span> <span class="squareb">|</span> FLOAT
    <span class="squareb">|</span> RECEIPT <span class="squareb">{</span>cid <span class="squareb">|</span> processname <span class="squareb">|</span> %variable<span class="squareb">}</span><span class="squareb">}</span>
<span class="squareb">|</span> STRING <span class="squareb">[</span>LEN <span class="term">n</span><span class="squareb">]</span>  <span class="squareb">[</span>DP <span class="squareb">{</span><span class="term">n</span> <span class="squareb">|</span> *<span class="squareb">}</span><span class="squareb">]</span>
<span class="squareb">|</span> UNDEFINED<span class="squareb">}</span>
</p>
</p>
   
   
<hr>
===Declare <i>%variable</i>===
   
   
<p class="syntaxUL">WRITE [IMAGE] imagename
<p class="syntaxUL"><span class="squareb">[</span>DECLARE<span class="squareb">]</span> <span class="term">%variable</span> <span class="squareb">[</span>IS<span class="squareb">]</span>
  ON <span class="squareb">{</span>seq-filename <span class="squareb">|</span> TERMINAL <span class="squareb">|</span> %variable<span class="squareb">}</span>
  <span class="squareb">{</span>FIXED <span class="squareb">[</span>DP <span class="term">n</span><span class="squareb">]</span>  <span class="squareb">|</span> FLOAT<span class="squareb">}</span> <span class="squareb">[</span>ARRAY (<span class="term">d1</span><span class="squareb">[</span>,<span class="term">d2</span><span class="squareb">[</span>,<span class="term">d3</span><span class="squareb">]</span><span class="squareb">]</span>)<span class="squareb">]</span>
<span class="squareb">[</span>COMMON<span class="squareb">]</span>
 
<span class="squareb">[</span>DECLARE<span class="squareb">]</span> <span class="term">%variable</span> <span class="squareb">[</span>IS<span class="squareb">]</span>
STRING <span class="squareb">[</span>LEN <span class="term">n</span><span class="squareb">]</span>  <span class="squareb">[</span>DP <span class="squareb">{</span><span class="term">n</span> <span class="squareb">|</span> *<span class="squareb">}</span><span class="squareb">]</span> <span class="squareb">[</span>ARRAY (<span class="term">d1</span><span class="squareb">[</span>,<span class="term">d2</span>[<span class="term">d3</span><span class="squareb">]</span><span class="squareb">]</span>)<span class="squareb">]</span>
<span class="squareb">[</span>NO FIELD SAVE<span class="squareb">]</span> <span class="squareb">[</span>COMMON<span class="squareb">]</span>
<span class="term">%variable</span> <span class="squareb">[</span>(<span class="term">subscript</span>)<span class="squareb">]</span> = <span class="term">expression</span>
</p>
</p>
===WAIT===
<table class="noBorder">
<tr><td style="font-family:monoface; padding-right:0px">[[Statement syntax#Notation conventions|(+)]] </td>
<td><p class="syntaxUL">WAIT [<span class="squareb">{</span><span class="term">n</span> <span class="squareb">|</span> <span class="term">%variable</span><span class="squareb">}</span> SEC<span class="squareb">[</span>S<span class="squareb">]</span><span class="squareb">]</span> <span class="squareb">[</span>FOR<span class="squareb">]</span>    <br>    <span class="squareb">{</span>ANY RECEIPT RETURN <span class="term">%variable</span>    <br>    <span class="squareb">|</span> RECEIPT <span class="squareb">{</span><span class="term">cid</span> <span class="squareb">|</span> <span class="term">processname</span> <span class="squareb">|</span> <span class="term">%variable</span><span class="squareb">}</span><span class="squareb">}</span>
</p></td></tr>
</table>
   
   
<hr>
===[[Write Image statement|Write Image]]===
   
   
<p class="syntaxUL">WRITE IMAGE imagename ON BUFFER
<table class="noBorder">
  [POSITION=%pvariable <span class="squareb">|</span> n] [MAXLEN=<span class="squareb">{</span>%lvariable <span class="squareb">|</span> n<span class="squareb">}</span>]
<tr><td>{{Template:Write Image statement syntax}} </td></tr>
</p>
</table>
 
==Other syntax==
 
===<b id="tokens"></b>Names, numbers, literals, comments===


<hr>
<ul>
<li>Names (for example, %variables, labels): see [[Model 204 naming conventions]]
<li>Other constructs: see [[Basic request structure]] (which also discusses some rules for statement labels)
</ul>


==Value specification syntax==
===Value specification syntax===
<p>
<p>
For all User Language statements and retrieval conditions, wherever the term <var class="term">value</var> appears in the syntax, it can be any of these:</p>
For all User Language statements and retrieval conditions, wherever the term <var class="term">value</var> appears in the syntax, it can be any of these:</p>
Line 987: Line 931:
<li>%variable</li>
<li>%variable</li>
</ul>
</ul>
 
==Retrieval condition syntax==
===<b id="retrvSyn"></b>Retrieval condition syntax===
<p>
<p>
A <var>FIND</var> statement can be followed by any number of retrieval conditions separated by an end of line or [[LINEND parameter]] character.</p>
A <var>Find</var> or <var>For Each Record Where</var> statement can be followed by any number of retrieval conditions separated by an end of line or [[LINEND parameter]] character.</p>
<p>
<p>
Conditions can be constructed as follows:     </p>
Conditions can be constructed as a series of phrases that are combined "in the usual way" with <var>And</var>, <var>Or</var>, <var>Not</var>, and parentheses (<b>()</b>):
</p>
====Syntax====
<p class="syntax">[Not] <span class="term">phrase</span> [<span class="squareb">{</span>And <span class="squareb">|</span> Or <span class="squareb">|</span> Nor<span class="squareb">}</span> [Not] <span class="term">phrase</span>] ...
<p class="syntax">[NOT] <span class="term">phrase</span> [<span class="squareb">{</span>AND <span class="squareb">|</span> OR <span class="squareb">|</span> NOR<span class="squareb">}</span> [NOT] <span class="term">phrase</span>] ...
</p>
</p>
Where:
<p>
<p>
<var class="term">phrase</var> can be constructed as follows:</p>
Where: </p>
<p>
<var class="term">phrase</var> can be constructed from these options: </p>
<ul style="font-family: Consolas,monospace">
<ul style="font-family: Consolas,monospace">
<li>fieldname = <span class="squareb">[</span>NOT<span class="squareb">]</span> value
<li><var class="term">fieldname</var> = <span class="squareb">[</span>Not<span class="squareb">]</span> <i>value</i> </li>
   
   
<li>fieldname LIKE pattern
<li><var class="term">fieldname</var> Like <i>pattern</i> </li>
   
   
<li>fieldname IS [NOT] <span class="squareb">{</span>PRESENT <span class="squareb">|</span> LIKE 'pattern'<span class="squareb">}</span>
<li><var class="term">fieldname</var> Is [Not] <span class="squareb">{</span>Present <span class="squareb">|</span> Like '<i>pattern</i>'<span class="squareb">}</span> </li>
   
   
<li>fieldname IS [NOT] <span class="squareb">{</span>[NUMERICALLY <span class="squareb">|</span> ALPHABETICALLY] <br>
<li><var class="term">fieldname</var> Is [Not] <span class="squareb">{</span>[Numerically <span class="squareb">|</span> Alphabetically] <br>
  [EQ <span class="squareb">|</span> = <span class="squareb">|</span> NE <span class="squareb">|</span> ,= <span class="squareb">|</span> GREATER THAN <span class="squareb">|</span> GT <span class="squareb">|</span> > <br>
  [Eq <span class="squareb">|</span> = <span class="squareb">|</span> Ne <span class="squareb">|</span> ¬= <span class="squareb">|</span> Greater Than <span class="squareb">|</span> Gt <span class="squareb">|</span> > <span class="squareb">|</span> Less Than <br><span class="squareb">|</span> Lt <span class="squareb">|</span> < <span class="squareb">|</span> Le <span class="squareb">|</span> <= <span class="squareb">|</span> Ge <span class="squareb">|</span> >= <span class="squareb">|</span> Before <span class="squareb">|</span> After] <i>value</i><span class="squareb">}</span> </li>
<span class="squareb">|</span> LESS THAN <span class="squareb">|</span> LT < <span class="squareb">|</span> <= <span class="squareb">|</span> GE <span class="squareb">|</span> >= <span class="squareb">|</span> BEFORE <span class="squareb">|</span> AFTER] value<span class="squareb">}</span>
   
   
<li>fieldname IS [NOT] <span class="squareb">{</span>[NUMERICALLY <span class="squareb">|</span> ALPHABETICALLY] <br>
<li><var class="term">fieldname</var> Is [Not] <span class="squareb">{</span>[Numerically <span class="squareb">|</span> Alphabetically] <br>
  <span class="squareb">{</span>IN RANGE [FROM <span class="squareb">|</span> AFTER] value1 <span class="squareb">{</span>TO <span class="squareb">|</span> [AND] BEFORE<span class="squareb">}</span> <br>
  <span class="squareb">{</span>In Range [From <span class="squareb">|</span> After] <i>value1</i> <span class="squareb">{</span>To <span class="squareb">|</span> [And] Before<span class="squareb">}</span> <br>
  value2 <span class="squareb">|</span> BETWEEN value1 AND value2<span class="squareb">}</span>
  <i>value2</i> <span class="squareb">|</span> Between <i>value1</i> And <i>value2</i><span class="squareb">}</span> </li>
   
   
<li>FILES filename
<li>[[Record retrievals#FILE$ condition|File$]] <span class="squareb">{</span><i>filename</i> <span class="squareb">|</span> =<span class="squareb">}</span> </li>
   
   
<li>FIND$ label
<li>Find$ <var class="term">label</var> </li>
   
   
<li>LISTS$ listname
<li>[[Lists#Using the LIST$ condition|List$]] <i>listname</i> </li>
   
   
<li>LOCATION <span class="squareb">{</span>location <span class="squareb">|</span> =<span class="squareb">}</span>
<li>[[Record retrievals#LOCATION$ condition|Location$]] <span class="squareb">{</span><i>location</i> <span class="squareb">|</span> =<span class="squareb">}</span> </li>
   
   
<li>POINT$ value
<li>[[#Point$|Point$]] <var class="term">value</var> </li>
   
   
<li>SFGE$ value
<li>[[#Sfl$ and Sfge$|Sfge$]] <var class="term">value</var> </li>
   
   
<li>SFL$ value
<li>[[#Sfl$ and Sfge$|Sfl$]] <var class="term">value</var> </li>
</ul>
<p>
<p>
where <i>value</i> can be:</p>
where <var class="term">value</var> can be: </p>
<ul>
<ul>
<li>A literal number or string</li>
<li>A literal number or string</li>
<li>VALUE <span class="squareb">{</span>[IN] <i>label</i><span class="squareb">}</span> <span class="squareb">|</span> (<i>expression</i>)</li>
 
<li>A %variable </li>
<li>A %variable </li>
</ul>
 
<li><var>Value</var> <span class="squareb">{</span>(<i>[[#Use of expressions|expression]]</i>) | [<var>In</var>] <i>label</i><span class="squareb">}</span>
<p>
<var class="term">label</var> points to an existing value set. If an <var>Eq Value In <i>value_set</i></var> clause, value set values are treated as Boolean OR, for example:
</p>
<p class="code"><i>field</i> = <i>value1</i> OR <i>field</i> = <i>value2</i> OR.... </p>
<p>
If an <var>Ne Value In <i>value_set</i></var> clause, values are treated as Boolean AND: </p>
<p class="code"><i>field</i> <> <i>value1</i> AND <i>field</i> <> <i>value2</i> AND.... </p>
<p>
See also [[Basic SOUL statements and commands#Processing a VALUE IN clause|Processing a VALUE IN clause]].</p></li>
</ul>
</ul>
   
   
<p><b>Notes:</b></p>
<p><b>Notes:</b></p>
<ul>
<ul>
<li>The first character (<code>,</code>) of the inequality test (<code>,=</code>) in the fourth of the items in the list above is the EBCDIC "not sign," which has the hexadecimal value <code>5f</code>.
<li>The first character (<code>¬</code>) of the "not-equal" test (<code>¬=</code>) in the fourth of the items in the list of <var class="term">phrase</var> options above is the EBCDIC "not sign," which has the hexadecimal value <code>5f</code>. </li>
   
   
<li>For a description of the pattern in the <code>[IS] LIKE</code> and <code>IS NOT</code> clauses, see the syntax of [[Is Like pattern matching#likeSyntax|Is Like patterns]].
<li>For a description of the pattern in the <var>[Is] Like</var> and <var>Is Not</var> clauses, see the syntax of [[Is Like pattern matching#likeSyntax|Is Like patterns]]. </li>
 
<li>In addition to the discussions in the subsections that follow, see [[Record retrievals]] for a comprehensive description of retrieval conditions. </li>
</ul>
</ul>
 
===Omitting repeated first words===
====Omitting repeated first words====
<p>
<p>
If a sequence of phrases in a particular retrieval condition all have the same first word, that word can be omitted from the latter phrases. For example:</p>
If a sequence of phrases in a particular retrieval condition all have the same first word, that word can be omitted from the latter phrases. For example:</p>
<p class="code">LIST$ A AND NOT LIST$ B
<p class="code">List$ A And Not List$ B
</p>
</p>
<p>
<p>
can be written:</p>
can be written:</p>
<p class="code">LIST$ A AND NOT B
<p class="code">List$ A And Not B
</p>
</p>
<p>
<p>
And:</p>
And:</p>
<p class="code">X IS 13 OR X IS LESS THAN 7
<p class="code">x Is 13 Or x Is Less Than 7
</p>
</p>
<p>
<p>
can be written:</p>
can be written:</p>
<p class="code">X IS 13 OR IS LESS THAN 7
<p class="code">x Is 13 Or Is Less Than 7
</p>
</p>
   
   
===Omitting duplicated equal signs===
====Omitting duplicated equal signs====
<p>
<p>
Duplicated equal signs can be omitted. For example, the expression:</p>
Duplicated equal signs can be omitted. For example, the expression:</p>
<p class="code">A = 3 OR A = 5 OR A = 40
<p class="code">a = 3 Or a = 5 Or a = 40
</p>
</p>
<p>
<p>
is equivalent to:</p>
is equivalent to:</p>
<p class="code">A = 3 OR 5 OR 40
<p class="code">a = 3 Or 5 Or 40
</p>
</p>
   
   
===Use of parentheses===
====Use of parentheses====
<p>
<p>
Parentheses can be placed around any sequence of phrases to clarify the condition or force the evaluation to occur in a particular order. For example:</p>
Parentheses can be placed around any sequence of phrases to clarify the condition or force the evaluation to occur in a particular order. For example:</p>
<p class="code">NOT (A = 2 OR LIST$ Y)
<p class="code">Not (a = 2 Or List$ y)
A = 1 AND (B = 2 OR C = 3)
a = 1 And (b = 2 OR c = 3)
</p>
</p>
   
   
===Use of expressions===
====Use of expressions====
<p>
<p>
Expressions can be used in <var>FIND</var> statements to provide the retrieval condition for the <var>POINT$</var>, <var>SFL$</var>, and <var>SFGE$</var> conditions, as well as for the <var>EQ VALUE</var> clause.</p>
[[Using variables and values in computation#Expressions|Expressions]] can be used in <var>Find</var> and <var>For Each Record</var> statements to provide the retrieval condition for the <var>Point$</var>, <var>Sfl$</var>, and <var>Sfge$</var> conditions, as well as for the <var>Eq Value</var> clause: </p>
   
   
====POINT$====
=====Point$=====
<p class="syntax">Point$ Value(<span class="term">expression</span>)
=====Syntax=====
<p class="syntax">POINT$ VALUE(<span class="term">expression</span>)
</p>
</p>
Where:
Where:
<p>
<p>
<var class="term">expression</var> is a function call, string concatenation, arithmetic operation, User Language construct, or Boolean expression. It is preceded by the keyword <var>VALUE</var>.</p>
<var class="term">expression</var> is a function call, string concatenation, arithmetic operation, SOUL construct, or Boolean expression. It is preceded by the keyword <var>Value</var>. </p>
<p>
=====Example=====
Example: </p>
<p>
<p>
This example finds the first <code>MA</code> record on file, and then counts the number of records from this point in the file:</p>
This example finds the first <code>MA</code> record on file, and then counts the number of records from this point in the file:</p>
Line 1,108: Line 1,062:
</p>
</p>
   
   
====SFL$ and SFGE$====
=====Sfl$ and Sfge$=====
<p class="syntax">Sfl$ Value(<span class="term">expression</span>)
=====Syntax=====
<p class="syntax">SFL$ VALUE(<span class="term">expression</span>)
</p>
</p>
<p>
<p>
or</p>
Or:</p>
<p class="syntax">SFGE$ VALUE(<span calss="term">expression</span>)
<p class="syntax">Sfge$ Value(<span class="term">expression</span>)
</p>
</p>
Where:
Where:
<p>
<p>
<var class="term">expression</var> is a function call, string concatenation, arithmetic operation, User Language construct, or Boolean expression. It is preceded by the keyword <var>VALUE</var>.</p>
<var class="term">expression</var> is a function call, string concatenation, arithmetic operation, SOUL construct, or Boolean expression. It is preceded by the keyword <var>Value</var>. </p>
<p>
=====Example=====
Example:
</p>
<p class="code">FOR %CT FROM 1 TO 10
<p class="code">FOR %CT FROM 1 TO 10
   IN EXPRESS STORE RECORD ($EDITN(%CT,'999'))
   IN EXPRESS STORE RECORD ($EDITN(%CT,'999'))
Line 1,142: Line 1,095:
</p>
</p>
   
   
====EQ VALUE====
=====Eq Value=====
<p class="syntax"><span class="term">fieldname</span> Eq Value(<span class="term">expression</span>)
=====Syntax=====
<p class="syntax"><span class="term">fieldname</span> EQ VALUE(<span class="term">expression</span>)
</p>
</p>
Where:
Where:
<p>
<p>
<var class="term">expression</var> is a function call, string concatenation, arithmetic operation, User Language construct, or Boolean expression.</p>
<var class="term">expression</var> is a function call, string concatenation, arithmetic operation, SOUL construct, or Boolean expression. </p>
<p>
=====Example=====
Example:
</p>
<p class="code">FD: IN FILE PEOPLE FD
<p class="code">FD: IN FILE PEOPLE FD
LAST EQ VALUE($READ('LAST NAME?') )
LAST EQ VALUE($READ('LAST NAME?') )
Line 1,157: Line 1,109:
</p>
</p>


==Print specification syntax==
===Print specification syntax===
<p>
<p>
A   PRINT, SET or AUDIT statement contains print specifications of the following form:</p>
A <var>Print</var>, <var>Set</var>, <var>Audit</var>, or <var>Trace</var> statement contains print specifications of the following form:
</p>
====Syntax====
<p class="syntax">[<span class="term">term</span>] <span class="squareb">[</span>And <span class="squareb">|</span> Tab <span class="squareb">|</span> With]...[[<span class="term">term</span>] [And <span class="squareb">|</span> Tab <span class="squareb">|</span> With] ...] ... [...]
<p class="syntax">[term] <span class="squareb">{</span>AND <span class="squareb">|</span> TAB <span class="squareb">|</span> WITH]...[[term]
[AND <span class="squareb">|</span> TAB <span class="squareb">|</span> WITH] ...] ... [...]
</p>
</p>
Where:
Where:
<p>
<p>
term can be constructed as follows:</p>
<var class="term">term</var> can be constructed as follows:</p>
<p class="syntax"><span class="squareb">{</span>'string' <span class="squareb">|</span> %variable <span class="squareb">|</span> COUNT IN label
<p class="syntax"><span class="squareb">{</span>'<span class="term">string</span>' <span class="squareb">|</span> <span class="term">%variable</span> <span class="squareb">|</span> Count In <span class="term">label</span> <span class="squareb">|</span> Occurrence In <span class="term">label</span> <span class="squareb">|</span> Value in <span class="label">term</span> <span class="squareb">|</span> <span class="term">function</span><span class="squareb">}</span>
  <span class="squareb">[</span>At <span class="squareb">[</span>Column<span class="squareb">]</span> <span class="term">m</span><span class="squareb">]</span> <span class="squareb">[</span>To <span class="squareb">[</span>Column<span class="squareb">]</span> <span class="term">n</span><span class="squareb">]</span> </p>
<span class="squareb">|</span> OCCURRENCE IN label
<p>
Or, if the statement is within a record loop:
<span class="squareb">|</span> VALUE IN label <span class="squareb">|</span> function<span class="squareb">}</span>
  <span class="squareb">[</span>AT <span class="squareb">[</span>COLUMN<span class="squareb">]</span> m<span class="squareb">]</span> <span class="squareb">[</span>TO <span class="squareb">[</span>COLUMN<span class="squareb">]</span> n<span class="squareb">]</span>
</p>
</p>
<p>
<p class="syntax"><span class="squareb">{</span><span class="squareb">{</span>Each <span class="squareb">|</span> <span class="n">term</span><span class="squareb">}</span> <span class="term">fieldname</span> <span class="squareb">|</span> *Record <span class="squareb">|</span> *Id<span class="squareb">}</span>
or, if the statement is within a record loop:</p>
  [At [Column] <span class="term">m</span>] [To [Column] <span class="term">n</span><span class="squareb">}</span>
<p class="syntax"><span class="squareb">{</span><span class="squareb">{</span>EACH <span class="squareb">|</span> n<span class="squareb">}</span> fieldname <span class="squareb">|</span> *RECORD <span class="squareb">|</span> *ID<span class="squareb">}</span>
  [AT [COLUMN] m] [TO [COLUMN] n<span class="squareb">}</span>
</p>
</p>
 
==Expression syntax==
<p class="note"><b>Note:</b> For additional <var>Print</var> statement details regarding multiply occurring fields and field groups, see [[Processing multiply occurring fields and field groups#PRINT and PRINT n statements|Print and Print <i>n</i>]] statements for fields. </p>
 
===Expression syntax===
<p>
<p>
The following syntax can be used in: </p>
The following syntax can be used in: </p>
<ul>
<ul>
<li>Assignment statements </li>
<li>Assignment statements </li>
<li>Conditional IF statements and ELSEIF clauses</li>
<li>Conditional <var>If</var> statements and <var>ElseIf</var> clauses
</ul>
<p>
<p>
In the simplified syntax for an IF statement, which is:</p>
In the simplified syntax for an <var>If</var> statement, which is:</p>
<p class="syntax">IF condition THEN statements
<p class="syntax">If <span class="term">condition</span> Then <span class="term">statements</span>
</p>
</p>
<p>
<p>
condition expands to the syntax described in this section. Be sure to enclose an expression with parentheses. </p>
<var class="term">condition</var> expands to the syntax described in this section. </p></li>
<ul>
<li>Computed JUMP TO statements </li>
<li>Computed <var>Jump To</var> statements </li>
<li>Subscripts </li>
<li>Subscripts </li>
<li>Function arguments     </li>
<li>Function arguments </li>
<li>A value in parenthesis in SOUL "DML" statements, for example:
<p class="code">Add <var class="term">fieldname</var> = (<var class="term">expression</var>)</p>
</ul>
</ul>
   
   
====Syntax====
=====<b id="exprSyntax"></b>Syntax=====
<p class="syntax"><span class="squareb">{</span>operand |(expression)<span class="squareb">}</span>
<p class="syntax"><span class="squareb">{</span>operand | (expression)<span class="squareb">}</span>  [operator <span class="squareb">{</span>operand <span class="squareb">|</span> (expression)<span class="squareb">}</span>] ...
   
[operator <span class="squareb">{</span>operand <span class="squareb">|</span> (expression)<span class="squareb">}</span>] ...
</p>
</p>
Where:
Where:
<p>
<ul>
operand can be constructed as follows:</p>
<li><var class="term">operand</var> can be constructed as follows:
<p class="syntax">[+ <span class="squareb">|</span> - <span class="squareb">|</span> NOT]
<p class="syntax">[+ <span class="squareb">|</span> - <span class="squareb">|</span> Not]
<span class="squareb">{</span>'<span class="term">string</span>' <span class="squareb">|</span> <span class="term">%variable</span> <span class="squareb">|</span> <span class="term">number</span>
<span class="squareb">|</span> <span class="term">fieldname</span> <span class="squareb">[</span>(subscript)<span class="squareb">]</span> Is <span class="squareb">[</span>Not<span class="squareb">]</span> Present
<span class="squareb">|</span> Count In <span class="term">label</span> <span class="squareb">|</span> Occurrence In <span class="term">label</span>
<span class="squareb">|</span> Value In <span class="term">label</span>
<span class="squareb">|</span> <span class="term">function</span><span class="squareb">}</span>
</p></li>
   
   
<span class="squareb">{</span>'string' <span class="squareb">|</span> %variable <span class="squareb">|</span> number
<li><var class="term">expression</var> (Note: enclosed by parentheses) is a function call, string concatenation, arithmetic operation, SOUL construct, or Boolean expression. For further details, see [[Using variables and values in computation#Expressions|Expressions]]. </li>
   
   
<span class="squareb">|</span> fieldname <span class="squareb">[</span>(subscript)<span class="squareb">]</span> IS <span class="squareb">[</span>NOT<span class="squareb">]</span> PRESENT
<li><var class="term">operator</var> may be one of the following:
<table style="table-layout: fixed">
<span class="squareb">|</span> COUNT IN label <span class="squareb">|</span> OCCURRENCE IN label
<span class="squareb">|</span> VALUE IN label
<span class="squareb">|</span> function<span class="squareb">}</span>
</p>
<p>
and operator may be one of the following:</p>
<table>
<tr>
<tr>
<td>+</td>
<td><b>+</b>&nbsp;&nbsp;&nbsp;</td>
<td>=</td>
<td><b>=</b></td>
<td>EQ</td>
<td>EQ</td>
<td>AND</td>
<td>And</td>
</tr>
</tr>
<tr>
<tr>
<td align="right">-</td>
<td><b>-</b></td>
<td>,=</td>
<td><b>,=</b>&nbsp;&nbsp;&nbsp;</td>
<td>NE</td>
<td>NE&nbsp;&nbsp;</td>
<td>OR</td>
<td>AndIf</td>
</tr>
</tr>
<tr>
<tr>
<td>*</td>
<td><b>*</b></td>
<td>></td>
<td><b>></b></td>
<td>GT</td>
<td>GT</td>
<td>WITH</td>
<td>Or</td>
</tr>
</tr>
<tr>
<tr>
<td>/</td>
<td><b>/</b></td>
<td><</td>
<td><b><</b></td>
<td>LT</td>
<td>LT</td>
<td>IS PRESENT</td>
<td>OrIf</td>
</tr>
</tr>
<tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>>=</td>
<td><b>>=</b></td>
<td>GE</td>
<td>GE</td>
<td>IS NOT PRESENT</td>
<td>With (Note: this can also be achieved via [[Implicit concatenation]])</td>
</tr>
</tr>
<tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td><=</td>
<td><b><=</b></td>
<td>LE</td>
<td>LE</td>
<td>IS LIKE</td>
<td>Is [Not] Present (Note: applied either to a field or to an [[Methods#optionalParams|optional or default method parameter]])</td>
</tr>
</tr>
<tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>IS NOT LIKE</td>
<td>Is [Not] Like</td>
</tr>
</tr>
</table>
</table>
<p>
</p>
<blockquote class="note"><b>Notes:</b>
<blockquote class="note"><b>Notes:</b>
<ul>
<ul>
<li>The first character (<code>,</code>) of the inequality test above is the EBCDIC "not sign", which has the hexadecimal value <code>5f</code>.
<li>The first character (<code>,</code>) of the inequality test above is the EBCDIC "not sign," which has the hexadecimal value <code>5f</code>. </li>
<li>For a description of the <code>IS LIKE</code> and <code>IS NOT</code> clauses, see the syntax of [[Is Like pattern matching|Is Like patterns]].
<li>For a description of the <code>Is Like</code> and <code>Is Not</code> clauses, see the syntax of [[Is Like pattern matching|Is Like patterns]]. </li>
<li>The <var>AndIf</var> and <var>OrIf</var> operators are called "short circuit", because, at a given precedence level, if the value of the conditional expression has been fully determined, the remainder at that level is not evaluated.  For example:
<p class="code">%sex eq 'M' and (%ht lt 5.2 orIf %ht gt 6.5)</p>
If the value of <code>%ht</code> is less than 5.2, the final comparison -- <code>%ht gt 6.5</code> -- is <b>never</b> evaluated (that holds regardless of what had been coded as the final comparison).
<p>With the same value of <code>%ht</code>, if the <code>Or</code> operator had been used, then that final comparison is <b>always</b> evaluated.</p>
</li>
<li>For more information about operators, see [[Using variables and values in computation#Operators|Operators]]. </li>
</ul>
</blockquote ></li>
</ul>
</ul>
</blockquote >
 
===In clause syntax===
==IN clause syntax==
<p>
<p>
Statements preceded by an asterisk (*), beginning with [[#User Language statements|User Language statements]], support the IN clause. </p>
The SOUL statements on this page whose syntax display is preceded by an asterisk (<tt>*</tt>) support an <var>In</var> clause. </p>
<p>
<p>
The three basic forms of the IN clause are:       </p>
The three basic forms of the <var>In</var> clause are: </p>
   
   
====Syntax====
<p class="syntax">In [Permanent <span class="squareb">|</span> Temporary ] Group <span class="term">groupname</span>
<ul>
Member [<span class="term">%member</span> <span class="squareb">|</span> [<span class="term">filename</span> [At <span class="squareb">{</span>location <span class="squareb">|</span> =<span class="squareb">}</span>]]</p>
<li><var>IN [PERMANENT <span class="squareb">|</span> TEMPORARY ] GROUP groupname
MEMBER [%member <span class="squareb">|</span> [filename [AT <span class="squareb">{</span>location <span class="squareb">|</span> =<span class="squareb">}</span>]]</var></li>
<p class="syntax">In <span class="term">file1</span> [,<span class="term">file2</span>] ...</p>
</li>
<li><var>IN file1 [,file2] ...</var></li>
<p class="syntax">In <span class="squareb">{</span>$Curfile <span class="squareb">|</span> $Update<span class="squareb">}</span></p>
</li>
<li><var>IN <span class="squareb">{</span>$CURFILE <span class="squareb">|</span> $UPDATE<span class="squareb">}</span></var></li>
<p>
<p>
The form IN $CURFILE can be used only within a record loop.   </p>
The form <var>In $Curfile</var> can be used only within a record loop.</p>
</li>
</ul>
   
   
===IN GROUP MEMBER limitations===
====In Group Member limitations====
<p>
<p>
In addition to the three basic forms of the IN clause shown above the IN GROUP MEMBER clause restricts the following statements to one member file in a group context:</p>
In addition to the three basic forms of the In clause shown above, the <var>In Group Member</var> clause restricts the following statements to one member file in a group context:</p>
<ul>
<ul>
<li>CLEAR LIST</li>
<li><var>Clear List</var></li>
</li>
<li>FIND ALL RECORDS (and its variants)</li>
<li><var>Find All Records</var> (and its variants)</li>
</li>
<li>FIND ALL VALUES</li>
<li><var>Find All Values</var></li>
</li>
<li>FOR RECORD NUMBER (or FRN)</li>
<li><var>For Record Number</var> (or <var>FRN</var>)</li>
</li>
<li>STORE RECORD</li>
<li><var>Store Record</var> </li>
</li>
</ul>
</ul>
<p>
<p>
You cannot use an IN GROUP MEMBER clause with a FOR EACH RECORD statement or with an ADD, CHANGE, or DELETE RECORD statement. Only the previously listed statements call accept an IN GROUP MEMBER clause.</p>
You cannot use an <var>In Group Member</var> clause with a <var>For Each Record</var> statement or with an <var>Add</var>, <var>Change</var>, or <var>Delete Record</var> statement. Only the previously listed statements call accept an <var>In Group Member</var> clause.</p>
   
   
===Using an IN clause in a BEGIN...END block===
====Using an In clause in a Begin...End block====
<p>
<p>
The file name in the IN clause used within a BEGIN...END block is resolved by the compiler. You can either hard code a file name or use some type of dummy string for the file name. The use of a %variable for the file name is not allowed.</p>
The file name in the <var>In</var> clause used within a <var>Begin...End</var> block is resolved by the compiler. You can hard-code a file name or use some type of dummy string for the file name. Using a %variable for the file name is not allowed. </p>
 
==Subscript syntax==
===Subscript syntax===
<p>
<p>
A subscript has the format:     </p>
A subscript has the format: </p>
   
   
====Syntax====
=====Syntax=====
<p class="syntax">(<span class="term">subscript1</span> [,<span class="term">subscript2</span> [,<span class="term">subscript3</span>]] )
<p class="syntax">(<span class="term">subscript1</span> [,<span class="term">subscript2</span> [,<span class="term">subscript3</span>]] )
</p>
</p>
Line 1,329: Line 1,281:
<p>
<p>
<var class="term">subscript1</var>, <var class="term">subscript2</var>, and <var class="term">subscript3</var> can be any expression. </p>
<var class="term">subscript1</var>, <var class="term">subscript2</var>, and <var class="term">subscript3</var> can be any expression. </p>
   
 
==SOUL macros==
There are [[SOUL macro facility|additional facilities]] supporting <var class="product">SOUL</var>
<b>macro statements</b>. Macro statements allow code to be conditionally compiled.
 
As an example, in the following SOUL fragment, the <var>Recordset</var> object declaration would be for the file <code>AVEBURY</code>:
<p class="code">!def henge avebury
...
%sites is object recordset in file ?!HENGE
</p>
 
==Terminal display attributes==
==Terminal display attributes==
<p>
<p>
Line 1,394: Line 1,356:
</tr>
</tr>
</table>
</table>
==Notation conventions==
<p>
This page uses the following syntax notation conventions: </p>
   
   
==Type syntax for the DECLARE SUBROUTINE statement==
<table>
<tr class="head">
<th>Syntax notation </th>
<th>Indicates that...</th>
</tr>
<tr>
<td>Single asterisk (*) </td>
<td>Statements can be preceded by an IN clause, if there is no reference to a previous set (label or list). See [[#IN clause syntax|IN clause syntax]] for more discussion.</td>
</tr>
<tr>
<td>Two asterisks (**) </td>
<td>Construct can appear only within a record loop.</td>
</tr>
<tr>
<td>Plus sign (+) </td>
<td>Construct requires the optional [[Horizon]] feature.</td>
</tr>
<tr>
<td nowrap>Two plus signs (++) </td>
<td>Construct requires the optional User Language to Database 2 feature.</td>
</tr>
<tr>
<td>C</td>
<td>The (first) keyword of the statement is also a <var class="product">Model&nbsp;204</var> command; the command's wiki page will be, for example, 'OPEN command'.
<p>
<p>
The type specification for the DECLARE SUBROUTINE statement has one of the following formats:</p>
<var class="product">Model&nbsp;204</var> commands are listed alphabetically and documented in [[List of Model 204 commands]]. </p></td>
<p class="syntax"><span class="squareb">{</span>STRING [LEN <span class="term">n</span>] [DP <span class="squareb">{</span><span class="term">n</span> <span class="squareb">|</span> *<span class="squareb">}</span>] [ARRAY (*[,*[,*]]) [NO FILE SAVE]]
</tr>
  <span class="squareb">|</span> FIXED [DP <span class="term">n</span>] [ARRAY (*[,*[,*]])]
<span class="squareb">|</span> FLOAT<span class="squareb">}</span>
<tr>
</p>
<td>Lowercase italic </td>
<p>
<td>Constructs are replaced with variable information.</td>
or</p>
</tr>
<p class="syntax">[LIST] [IN [FILE <span class="squareb">|</span> [PERM <span class="squareb">|</span> TEMP] GROUP] <span class="term">name</span>]
</table>
</p>
   
<ul>
<li>A field name (%%) variable can be used anywhere fieldname appears. The %%variable can contain its own subscript, separate from the field name subscript.
<p class="note"><b>Note: </b>
The subscript of an array element must be specified before a field name subscript.</p> </li>
<li>The lowercase constructs &mdash; retrieval-conditions, print-specifications, expression, subscript, attribute, and type &mdash; are discussed separately following the syntax summaries, beginning with [[#Value specification syntax|Value specification syntax]].  </li>
 
<li>For more Model 204 notation conventions, see [[Notation conventions]].</li>
</ul>
   
   
[[Category:SOUL]]
[[Category:SOUL]]

Latest revision as of 19:23, 10 April 2020

This page summarizes SOUL syntax and conventions, which are discussed in more detail throughout this wiki. The SOUL statements are listed in alphabetical order. Many of the section titles or syntax blocks contain links to the wiki page describing the statement or syntax phrase. A later section provides other SOUL syntax information, including links to information about the "tokens" of SOUL, such as names in SOUL.

All SOUL statements can be used between a Begin (or More) command and an End statement.

External Call Facility (ECF) statements are listed under External.

Various other Model 204 commands also have effects on the results of a SOUL request.

The following notations prefix some of the statements in the presentation of the SOUL syntax:

* ** + ++ C

See the notation conventions section for an explanation of these usages, as well as other general comments about understanding the syntax of SOUL.

 

Add

(**)

Add fieldname = {value | (expression)}

Add lob-fieldname=Buffer,position,length [Reserve n [Bytes]]

Array

Array [arrayname] Occurs {n | Unknown} Depending On {itemname | %variable} [After {itemname | arrayname} | At {position | itemname | imagename1 | arrayname}]

Assert

Assert cond [, [Snap] [Info info] [Continue] ]

where cond is, like an If statement, the condition(s) being asserted as true. The statement options indicate how to respond to an assertion failure.

Audit

Audit print-specifications

Audit All Fieldgroup Information (AAFGI)

(**)

{AAFGI | Audit All Fieldgroup Information} [lob-option] [CtoFields]

Audit All Information

{Audit All Information | AAI} [CtoFields]

Backout

Backout

BYPASS

BYPASS [PENDING STATEMENT]

CALL

CALL {label | subname [([expression | %variable | [LIST] listname] [,...])]}

Change

(**)

Change fieldname [(subscript)] [= value |(expression)] To (newvalue |(expression))

Change lob-fieldname,position1,length To Buffer,position2,length[Reserve n [Bytes]]

CLEAR

Clear {[[All | Temp | ListFdst | Position] [Global]] Objects | Globals | Global {Image | Screen | Menu | List | Foundset | Position [Perm | Temp]} {'objectname' | %variable}}

CLEAR LIST

(*)

CLEAR LIST listname

CLEAR ON

CLEAR ON {ATTENTION | ERROR | FIELD CONSTRAINT CONFLICT | FIND CONFLICT | RECORD LOCKING CONFLICT | MISSING FILE | MISSING MEMBER}

CLEAR TAG

CLEAR TAG {screenname | %screenname:inputname}

Close

Close
{Dataset | External} {ext-filename | %variable}
| [External] Terminal

CLOSE PROCESS

(+C)

CLOSE PROCESS
{cid | processname | %variable}
[SYNCLEVEL | FLUSH | %variable]

CLOSE PROCESS {cid | processname | %variable} [SYNCLEVEL | CONFIRM | FLUSH | ERROR | %variable]

Commit

Commit [Release]

Confirm

(+)

Confirm {cid | processname | %variable} REQSEND %variable

Confirmed

(+)

Confirmed {cid | processname | %variable}

CONTINUE

CONTINUE

COUNT OCCURRENCES OF

(**)

COUNT OCCURRENCES OF fieldname

COUNT RECORDS

COUNT RECORDS {IN label | ON [LIST] listname}

Declare

[Declare] declaration

where declaration is one of the following:

  • Label labelname [Global | Common]
  • List listname
    [
    In [File | [Perm | Temp] Group]] name]
    At location [Global | Common]
  • Image block:

    [Declare] Image imagename [Namesave] [global | Common]
    imageComponent
    [imageComponent] ... [Image imagename2 [Namesave] [At {itemname | imagename | arrayname}]
    imageComponent
    [imageComponent] ... ] ...
    End Image

    where global is:

    Global [Permanent | Temporary]
    | [Permanent | Temporary] Global

  • Menu block:

    [Declare] Menu menuName [Global [Permanent | Temporary] | Common] menuLine menuLine ... End Menu

    Menu statement, referring to a menu defined elsewhere in a Menu block:

    [Declare] Menu menuName [Global [Permanent | Temporary] | Common]

  • Screen block:

    [Declare] Screen screenName [Global [Permanent | Temporary] | Common] screenLine screenLine ... End Screen

    Screen statement, referring to a screen defined earlier in a Screen block:

    [Declare] Screen screenName Common

  • %variable [Is] {Fixed [Dp n] | Float} [Array (d1 [,d2 [,d3]])]
    [Initial(numeric-expression)] [Static] [Common]
  • %variable [Is] String [Len n] [Dp {n | *}] [Array (d1 [,d2[,d3]])]
    [No Field Save] [Common]
    [Initial('EBCDIC-string' | expression)] [Static]
  • Subroutine subname
    [(type [Input | Output | Input Output] [,...])]

    where type is one of the following:

    • Scalar %variable of the following format:

      {String [Len] n [DP {n | *}] | [Fixed [Dp n] | Float]}

    • Array %variable of the following format:

      {String [Len n] [Dp [n | *}] [Array (* [,*[,*]]) [No Field Save]]
      | [Fixed [Dp n] | Float] [Array (* [,*[,*]])]}

    • A list of records of the following format:

      [List] [In {File | [Perm | Temp] Group} name]

DEFAULT CURSOR

DEFAULT CURSOR [READ | REREAD | PRINT] {ITEMID n | itemname | ROW n COLUMN m}

DEFAULT

DEFAULT {TITLE | PROMPT | INPUT [DEBLANK | NODEBLANK] [PAD WITH 'c'] [LEN m [DP [k | *}]] [UPCASE | NOCASE] | [TAG [attributes] [WITH 'c']} [[READ] attributes] [REREAD attributes] [PRINT attributes] DEFAULT SKIP n POSITIONS[S] [INITIAL {NULL | character | BLANK}] DEFAULT [TYPE] {STRING | BINARY | PACKED | ZONED | FLOAT | EFORMAT} {LEN {n | UNKNOWN} | BITS n | DIGITS n} [DP {k | *}] [BP n] [SIGNED | UNSIGNED] [PAD {BLANK | character | NULL}] [STRIP | NOSTRIP] [JUSTIFY {LEFT | RIGHT}] [INITIAL {BLANK | ZERO | NULL | literal}]

DELETE

(**)

DELETE fieldname [(subscript)] [= value | (expression)]

(**)

DELETE FIELDGROUP [fieldgroupname] [(subscript)] [= value | (expression)]

DELETE EACH

(**)

DELETE EACH fieldname

DELETE RECORD

(**)

DELETE RECORD

DELETE RECORDS

DELETE [ALL] RECORDS {IN label | ON [LIST] listname}

END BLOCK

END BLOCK label

End

END {FIND | IF | FOR | ON | REPEAT | STORE | SUBROUTINE} [label] END {ARRAY | IMAGE | MENU | SCREEN} End [MORE | NORUN | USE]...

END UPDATE

END UPDATE

External

External { Call callTerms | Delete deleteTerms | Load loadTerms | Module moduleTerms | Name nameTerms | Start startTerms | Stop stopTerms }

FILE RECORDS

FILE RECORDS {IN label | ON [LIST] listname} UNDER fieldname = {value | (expression)}

Find Records

(*)

{FIND [[ALL] RECORDS] | FD }
[IN label | ON [LIST] listname]
[FOR WHICH | WITH] retrieval-conditions

Find And Reserve

(*)

{FIND AND RESERVE [[ALL] RECORDS] | FDR}
[IN label | ON [LIST] listname]
[FOR WHICH | WITH] retrieval-conditions

Find Values Of (FDV)

label:[In { File filename | Group groupname } ]
{ Find [All] Values Of | FDV } fieldname
[From value1 | (expression1)] [To value2 | (expression2)]
[(Not) Like pattern]
[(Not) Value In value_set]

FIND AND PRINT COUNT

(*)

{Find And Print Count | FPC}
[retrieval-conditions]

Find Without Locks

(*)

{Find Without Locks [[ALL] Records] | FDWOL}
[In label | On [LIST] listname] [For Which | With] retrieval-conditions

FLUSH PROCESS

FLUSH PROCESS {cid | processname | %variable}

FOR EACH OCCURRENCE

(**)

FOR {EACH | k} {OCCURRENCE | OCCURRENCES} OF fieldname

For Each Record

(*)

For {Each | n} {Record | Records} [In label | On [List] listname] [In [Ascending | Descending] [Sortkey] Order [By [Each] fieldname]] [From {value1 | (expression1)}] [To {value2 | (expression2)}] [By {%variable | literal}] [Optimizing FNV] [{Where | With} retrieval-conditions]

Note: For retrieval-conditions, see Retrieval condition syntax, below.

FOR EACH VALUE OF

(*)

FOR {EACH | k} {VALUE | VALUES} OF fieldname
[FROM {value1 | (expression1)}] [TO {value2 | (expression2)}] [[NOT] LIKE pattern]
[IN [ASCENDING | DESCENDING] [CHARACTER | NUMERICAL] [RIGHT-ADJUSTED] ORDER]

FOR EACH VALUE IN

FOR {EACH | k} {VALUE | VALUES} IN label

FOR RECORD NUMBER

(*)

FOR RECORD NUMBER {value | (expression)}

FOR RECORD NUMBER IN

FOR RECORD NUMBER {value | IN label} [OPTIMIZING FNV]

For %var From %exp1 To %exp2 By %exp3

For %variable From exp1
To exp2 [By exp3]

Note: The By clause, when omitted, defaults to a value of 1.

Identify

Identify
{ [Image] imagename
| %imagename:itemname Len {n | %variable}
| {%imagename:arrayname | %imagename:itemname} Occurs {n | %variable} }

If...Then...ElseIf...Else

(C)

If expression Then [statement]
[statement]
...
[
ElseIf expression Then [statement]
[statement]
...
] ...
[
Else [statement]
[statement]
...
]
End If

Image

Image block:

[Declare] Image imagename [Namesave] [global | Common]
imageComponent
[imageComponent] ... [Image imagename2 [Namesave] [At {itemname | imagename | arrayname}]
imageComponent
[imageComponent] ... ] ...
End Image

where global is:

Global [Permanent | Temporary]
| [Permanent | Temporary] Global

INCLUDE

(*, C)

INCLUDE procedurename

INPUT

INPUT inputname [AT [COLUMN] n] [TO [COLUMN] m | [LEN m] DP {k | *}]] [UPCASE | NOCASE] [DEFAULT 'value'] [DEBLANK | NODEBLANK] [PAD WITH 'c'] [REQUIRED | ALPHA | ALPHANUM | MUSTFILL | ONEOF literal [, literal]... | [NUMERIC] [RANGE lo [TO] hi [AND lo [TO] hi] ...] | VERIFY 'characters']... [[READ] attributes] [REREAD attributes] [PRINT attributes] [TAG [attributes] [WITH 'c']] [ITEMID n]

INSERT

INSERT fieldname [(subscript)] = {value | (expression)}

Invite

(+)

Invite {cid | processname | %variable}
[SYNCLEVEL | FLUSH | CONFIRM]

IS

itemname IS [TYPE] {STRING | BINARY | PACKED | ZONED | FLOAT | EFORMAT} {LEN {n | UNKNOWN} | BITS n | DIGITS n | TO position} [DP {k | *}] [BP n] [SIGNED | UNSIGNED] [PAD {BLANK | character | NULL}] [STRIP | NOSTRIP] [ALIGN] [JUSTIFY {LEFT | RIGHT}] [INITIAL {BLANK | ZERO | NULL | value}] [AFTER {itemname | arrayname} | AT {position | itemname | imagename1 | arrayname}] [OCCURS {n [DEPENDING ON {itemname | %variable}] | UNKNOWN}]

JUMP TO

JUMP TO label JUMP TO (label1 [, label2] ...) expression

Loop End

Loop End

Loop Next

Loop Next

MAX PFKEY

MAX PFKEY n

Menu

Menu block:

[Declare] Menu menuName [Global [Permanent | Temporary] | Common] menuLine menuLine ... End Menu

Menu statement, referring to a menu defined elsewhere in a Menu block:

[Declare] Menu menuName [Global [Permanent | Temporary] | Common]

MODIFY

MODIFY {%menuname:itemname | %screenname:itemname} [TO] attributes [[FOR] {ALL | READ | REREAD | TAB | PRINT}]

MODIFY BUFFER

MODIFY BUFFER [SIZE=n | %variable [PRESERVE | NOPRESERVE]] [FILL [X'nn'] | CLEAR]

NEW PAGE

(C)

NEW PAGE

Note

(**)

Note {fieldname [(subscript)]}

Note 'string'

On

On {Attention | Error | Field Constraint Conflict | Find Conflict | Missing File | Missing Member | Record Locking Conflict} statements End On [label]

Open

Open { [Dataset | External] {ext-filename | %variable} | [External] {Terminal | %variable} } For {Input [Output] | Output [Input] | InOut} [Password {value | %variable}]

(C)

Open[C] [File | [Perm | Temp] Group]
{name [At {location | %variable | =}] | %variable}
[Password {value | %variable}]

OPEN PROCESS

OPEN PROCESS {processname | %variable} [CID {name | %variable}]

(+)

OPEN PROCESS {processname | %variable}
[CID {name | %variable}]
{outbound-options | inbound-options}

where outbound-options are:

  • [AT DESTINATION] [WITH] [USERID {%variable | 'string'}]
  • [PASSWORD {%variable | 'string'}]
  • [{ACCOUNT | PROFILE {%%variable | 'string'}]
  • [INITIAL {DATA 'string' | DATA %variable | IMAGE imagename] ...]

and inbound-options are:

  • ACCEPT [INITIAL {DATA %variable | IMAGE image} ...]

Pause

Pause [n | %variable]

PLACE RECORD ON

(**)

PLACE RECORD ON [LIST] listname

PLACE RECORDS

PLACE RECORDS {IN label | ON [LIST] listname1} ON [LIST] listname2

Position

POSITION {FOUNDSET foundsortset_name | LIST list_name} [AT] position_name

Note: Use the above form of the Position statement with For loop processing; see Position statement.

POSITION {ext-filename | %variable} AT KEY operator{value | %variable}

Note: Use the above form of the Position statement with external file processing using images; see Position statement.

PREPARE

PREPARE {[IMAGE] imagename | [MENU] menuname | [SCREEN] screenname}

Print

Print printSpecifications

Print All Fieldgroup Information (PAFGI)

(**)

{PAFGI | Print All Fieldgroup Information} [lob-option] [CtoFields]

Print All Information or PAI

(**)

{PAI | Print All Information}
[Lob_Flod | Lob_Data | Lob_Short_Data | Lob_No_Data | Lob_None]
[CtoFields]
[Into array1, array2 [, array3] [From start] [Count ct] ]

PRINT MENU

PRINT [MENU] menuname [ALERT] [TITLE {'text' | %variable} [AT [COLUMN] n] [TO [COLUMN] m | LEN m] [attributes]]

PRINT SCREEN

PRINT SCREEN screenname [ALERT] [[WITH] CURSOR] [TITLE {'text' | %variable} [AT [COLUMN] n] [TO [COLUMN] m | LEN m] [attributes]]

Query Process

(+)

Query Process {cid | processname | %variable} options

where options must be one or more of the following:

  • STATE %variable
  • PROCESSGROUP %variable
  • REMOTEID %variable
  • SYNCLEVEL %variable
  • MODENAME %variable

Read Image

Read [Image] imagename From {ext-filename | Terminal | %variable} [Prompt {'text' | %variable}] [Next | Key operator {value | %variable}]

Read [Image] imagename From Buffer [Position={%pvariable | n}] [Maxlen={%lvariable | n}]

READ menuname

READ [MENU] menuname [ALERT] [TITLE ['text' | %variable} [AT [COLUMN] n] [TO [COLUMN] m | LEN m] [attributes]]

READ screenname

READ [SCREEN] screenname [ALERT] [NO REREAD] [ [WITH] CURSOR] [TITLE {'text' | %variable} [AT [COLUMN] n] [TO [COLUMN] m | LEN m] [attributes]]

RECEIVE IMAGE

RECEIVE {IMAGE imagename | %variable} FROM {cid | processname | %variable} [RESULT %variable]

(+)

RECEIVE {IMAGE imagename | %variable}
FROM {cid | processname | %variable}
RESULT %variable

Release All Records

Release All Records

Release Position

Release Position {ext-filename | %variable}

Release Records

Release Records {In label | On [List] listname}

Remember

(**)

Remember [Global] position_name [In foundsortset_name | On list_name]

REMOVE RECORD FROM

(**)

REMOVE RECORD FROM [LIST] listname

REMOVE RECORDS

REMOVE RECORDS {IN label | ON [LIST] listname} FROM [LIST] listname2

REPEAT

REPEAT [FOREVER | n TIMES | WHILE expression]

REREAD

REREAD [SCREEN] screenname [ALERT] [[WITH] CURSOR] [TITLE {'text' | %variable} [AT [COLUMN] n] [TO [COLUMN] m | LEN m] [attributes]]

RESET

RESET {HEADER | TRAILER} m

Rethrow

Rethrow exceptionName ...

RETRY

RETRY [PENDING STATEMENT]

RETURN

RETURN

Screen

Screen block:

[Declare] Screen screenName [Global [Permanent | Temporary] | Common] screenLine screenLine ... End Screen

Screen statement, referring to a screen defined earlier in a Screen block:

[Declare] Screen screenName Common

SEND

SEND {IMAGE imagename | 'string' | %variable} TO {cid | processname | %variable} [REQSEND %variable] [FLUSH] (+)SEND {IMAGE imagename | 'string' | %variable} TO {cid | processname | %variable} [FLUSH | CONFIRM] [REQSEND %variable]

Send Error

(+)

Send Error To {cid | processname | %variable}
Reqsend %variable

SET

SET {HEADER | TRAILER} m print-specifications

SetText

SetText %variable = string

SIGNAL PROCESS

SIGNAL PROCESS {cid | [processname | %variable} {nnn | %variable}

(+)

SIGNAL PROCESS
{cid | [processname | %variable}

Sirius Case directive

(C)

Sirius Case {ToUpper | Leave}

SKIP LINES

SKIP n LINE[S]

Skip Position

[itemname Is] Skip n Position[s]
[Initial {Null | character | Blank}]

SORT RECORDS

SORT [k] RECORDS {IN label | ON [LIST] listname} BY key [AND key] ...

where key is:

  • key = fieldname
    [VALUE {[ASCENDING | DESCENDING]
    [CHARACTER | NUMERICAL] | RIGHT-ADJUSTED]} ...]

SORT RECORD KEYS

SORT [k] RECORD KEYS {IN label | ON [LIST] listname} BY key [AND key] ...

where key is:

  • key = fieldname
    [VALUE {[ASCENDING | DESCENDING]
    [CHARACTER | NUMERICAL] | [RIGHT-ADJUSTED]} ...]

SORT VALUE IN

SORT VALUE IN label [IN [ASCENDING | DESCENDING] [CHARACTER | NUMERICAL] | [RIGHT-ADJUSTED] ORDER]

STOP

(C)

STOP [IF COUNT IN label EXCEEDS n]

STORE RECORD

(*)

STORE RECORD [sort or hash key value]
fieldname1=[value1 | (expression1)]
[fieldname2=(expression)]
...
[THEN CONTINUE
statement
statement
...]
END STORE

SUBROUTINE

SUBROUTINE SUBROUTINE subname [(formal-parameter [INPUT | OUTPUT | INPUT OUTPUT] [,...])]

where formal-parameter is one of the following:

  • %variable [IS STRING [LEN n] [DP {n | *}] [ARRAY (*[,*[,*]]) [NO FS]]
    | IS {FIXED [DP n] | FLOAT} [ARRAY (*[,*[,*]])]]
  • LIST listname [IN [FILE | [PERM | TEMP] GROUP] name]

TAG

TAG %screenname:inputname [attributes] [WITH 'c']

Test Receipt

(+)

Test [For]
{Any Receipt Return %variable
| Receipt {cid | processname | %variable}}

TITLE

TITLE {'text' | promptname} [AT [COLUMN] n] [TO [COLUMN] m | [LEN m] [DP {k | *}]] [DEFAULT 'value'] [[READ] attributes] [REREAD attributes] [PRINT attributes]

Trace

Trace printSpecifications

Note: The output of the Trace statement is controlled by the ULTRACE parameter.

TRANSFER

TRANSFER [CONTROL] TO PROCESS {processname | %variable} [WITH] [USERID {string | '%variable'}] [PASSWORD {variable | 'string'}] [ACCOUNT {%variable | 'string'}] [PASSING {IMAGE imagename | 'string' | %variable}]

UPDATE RECORD

UPDATE RECORD

VARIABLES ARE

VARIABLES ARE {FIXED [DP n] | FLOAT | STRING [LEN n] [DP {n | *}] | UNDEFINED}

Declare %variable

[DECLARE] %variable [IS] {FIXED [DP n] | FLOAT} [ARRAY (d1[,d2[,d3]])] [COMMON] [DECLARE] %variable [IS] STRING [LEN n] [DP {n | *}] [ARRAY (d1[,d2[d3]])] [NO FIELD SAVE] [COMMON] %variable [(subscript)] = expression

WAIT

(+)

WAIT [{n | %variable} SEC[S]] [FOR]
{ANY RECEIPT RETURN %variable
| RECEIPT {cid | processname | %variable}}

Write Image

Write [Image] imagename On
[Buffer [Position=%pvariable | n] [Maxlen={%lvariable | n}]]
| {seq-filename | Terminal | %variable}

Other syntax

Names, numbers, literals, comments

Value specification syntax

For all User Language statements and retrieval conditions, wherever the term value appears in the syntax, it can be any of these:

  • Literal number or string
  • VALUE IN clause of the form:

    VALUE [IN] label

  • %variable

Retrieval condition syntax

A Find or For Each Record Where statement can be followed by any number of retrieval conditions separated by an end of line or LINEND parameter character.

Conditions can be constructed as a series of phrases that are combined "in the usual way" with And, Or, Not, and parentheses (()):

[Not] phrase [{And | Or | Nor} [Not] phrase] ...

Where:

phrase can be constructed from these options:

  • fieldname = [Not] value
  • fieldname Like pattern
  • fieldname Is [Not] {Present | Like 'pattern'}
  • fieldname Is [Not] {[Numerically | Alphabetically]
    [Eq | = | Ne | ¬= | Greater Than | Gt | > | Less Than
    | Lt | < | Le | <= | Ge | >= | Before | After] value}
  • fieldname Is [Not] {[Numerically | Alphabetically]
    {In Range [From | After] value1 {To | [And] Before}
    value2 | Between value1 And value2}
  • File$ {filename | =}
  • Find$ label
  • List$ listname
  • Location$ {location | =}
  • Point$ value
  • Sfge$ value
  • Sfl$ value

where value can be:

  • A literal number or string
  • A %variable
  • Value {(expression) | [In] label}

    label points to an existing value set. If an Eq Value In value_set clause, value set values are treated as Boolean OR, for example:

    field = value1 OR field = value2 OR....

    If an Ne Value In value_set clause, values are treated as Boolean AND:

    field <> value1 AND field <> value2 AND....

    See also Processing a VALUE IN clause.

Notes:

  • The first character (¬) of the "not-equal" test (¬=) in the fourth of the items in the list of phrase options above is the EBCDIC "not sign," which has the hexadecimal value 5f.
  • For a description of the pattern in the [Is] Like and Is Not clauses, see the syntax of Is Like patterns.
  • In addition to the discussions in the subsections that follow, see Record retrievals for a comprehensive description of retrieval conditions.

Omitting repeated first words

If a sequence of phrases in a particular retrieval condition all have the same first word, that word can be omitted from the latter phrases. For example:

List$ A And Not List$ B

can be written:

List$ A And Not B

And:

x Is 13 Or x Is Less Than 7

can be written:

x Is 13 Or Is Less Than 7

Omitting duplicated equal signs

Duplicated equal signs can be omitted. For example, the expression:

a = 3 Or a = 5 Or a = 40

is equivalent to:

a = 3 Or 5 Or 40

Use of parentheses

Parentheses can be placed around any sequence of phrases to clarify the condition or force the evaluation to occur in a particular order. For example:

Not (a = 2 Or List$ y) a = 1 And (b = 2 OR c = 3)

Use of expressions

Expressions can be used in Find and For Each Record statements to provide the retrieval condition for the Point$, Sfl$, and Sfge$ conditions, as well as for the Eq Value clause:

Point$

Point$ Value(expression)

Where:

expression is a function call, string concatenation, arithmetic operation, SOUL construct, or Boolean expression. It is preceded by the keyword Value.

Example:

This example finds the first MA record on file, and then counts the number of records from this point in the file:

FD1: IN ICSCUST FPC STATE = MA END FIND FOR 1 RECORD IN FD1 PRINT 'CURREC = ' WITH $CURREC PRINT '>= POINT$' FD2: IN ICSCUST FPC POINT$ VALUE($CURREC) END FIND END FOR

Sfl$ and Sfge$

Sfl$ Value(expression)

Or:

Sfge$ Value(expression)

Where:

expression is a function call, string concatenation, arithmetic operation, SOUL construct, or Boolean expression. It is preceded by the keyword Value.

Example:

FOR %CT FROM 1 TO 10 IN EXPRESS STORE RECORD ($EDITN(%CT,'999')) ORD1 = (%REC WITH %CT) ORD2 = (%CT * 2) ORD4 = (%CT * 4) END STORE END FOR COMMIT FOR %CT FROM 1 TO 5 PRINT 'LESS THAN ' WITH %CT FD1: IN EXPRESS FPC SFL$ VALUE($EDITN(%CT,'999')) END FIND PRINT 'GREATER THAN OR EQUAL TO ' WITH %CT FD2: IN EXPRESS FPC SFGE$ VALUE($EDITN(%CT,'999')) END FIND END FOR

Eq Value

fieldname Eq Value(expression)

Where:

expression is a function call, string concatenation, arithmetic operation, SOUL construct, or Boolean expression.

Example:

FD: IN FILE PEOPLE FD LAST EQ VALUE($READ('LAST NAME?') ) END FIND

Print specification syntax

A Print, Set, Audit, or Trace statement contains print specifications of the following form:

[term] [And | Tab | With]...[[term] [And | Tab | With] ...] ... [...]

Where:

term can be constructed as follows:

{'string' | %variable | Count In label | Occurrence In label | Value in term | function} [At [Column] m] [To [Column] n]

Or, if the statement is within a record loop:

{{Each | term} fieldname | *Record | *Id} [At [Column] m] [To [Column] n}

Note: For additional Print statement details regarding multiply occurring fields and field groups, see Print and Print n statements for fields.

Expression syntax

The following syntax can be used in:

  • Assignment statements
  • Conditional If statements and ElseIf clauses

    In the simplified syntax for an If statement, which is:

    If condition Then statements

    condition expands to the syntax described in this section.

  • Computed Jump To statements
  • Subscripts
  • Function arguments
  • A value in parenthesis in SOUL "DML" statements, for example:

    Add fieldname = (expression)

Syntax

{operand | (expression)} [operator {operand | (expression)}] ...

Where:

  • operand can be constructed as follows:

    [+ | - | Not] {'string' | %variable | number | fieldname [(subscript)] Is [Not] Present | Count In label | Occurrence In label | Value In label | function}

  • expression (Note: enclosed by parentheses) is a function call, string concatenation, arithmetic operation, SOUL construct, or Boolean expression. For further details, see Expressions.
  • operator may be one of the following:
    +    = EQ And
    - ,=    NE   AndIf
    * > GT Or
    / < LT OrIf
      >= GE With (Note: this can also be achieved via Implicit concatenation)
      <= LE Is [Not] Present (Note: applied either to a field or to an optional or default method parameter)
          Is [Not] Like

    Notes:

    • The first character (,) of the inequality test above is the EBCDIC "not sign," which has the hexadecimal value 5f.
    • For a description of the Is Like and Is Not clauses, see the syntax of Is Like patterns.
    • The AndIf and OrIf operators are called "short circuit", because, at a given precedence level, if the value of the conditional expression has been fully determined, the remainder at that level is not evaluated. For example:

      %sex eq 'M' and (%ht lt 5.2 orIf %ht gt 6.5)

      If the value of %ht is less than 5.2, the final comparison -- %ht gt 6.5 -- is never evaluated (that holds regardless of what had been coded as the final comparison).

      With the same value of %ht, if the Or operator had been used, then that final comparison is always evaluated.

    • For more information about operators, see Operators.

In clause syntax

The SOUL statements on this page whose syntax display is preceded by an asterisk (*) support an In clause.

The three basic forms of the In clause are:

In [Permanent | Temporary ] Group groupname Member [%member | [filename [At {location | =}]]

In file1 [,file2] ...

In {$Curfile | $Update}

The form In $Curfile can be used only within a record loop.

In Group Member limitations

In addition to the three basic forms of the In clause shown above, the In Group Member clause restricts the following statements to one member file in a group context:

  • Clear List
  • Find All Records (and its variants)
  • Find All Values
  • For Record Number (or FRN)
  • Store Record

You cannot use an In Group Member clause with a For Each Record statement or with an Add, Change, or Delete Record statement. Only the previously listed statements call accept an In Group Member clause.

Using an In clause in a Begin...End block

The file name in the In clause used within a Begin...End block is resolved by the compiler. You can hard-code a file name or use some type of dummy string for the file name. Using a %variable for the file name is not allowed.

Subscript syntax

A subscript has the format:

Syntax

(subscript1 [,subscript2 [,subscript3]] )

Where:

subscript1, subscript2, and subscript3 can be any expression.

SOUL macros

There are additional facilities supporting SOUL macro statements. Macro statements allow code to be conditionally compiled.

As an example, in the following SOUL fragment, the Recordset object declaration would be for the file AVEBURY:

!def henge avebury ... %sites is object recordset in file ?!HENGE

Terminal display attributes

One or more of the following terminal display attributes can replace the term attribute in a full-screen formatting statement, if the display attribute is supported by the installation:

List of attributes
BLINK
BLUE
BRIGHT
DIM
GREEN
INV[IS[BLE]]
NOBLINK
NOREV[ERSE]
NOU[NDER]SCORE
PINK
PROT[ECTED]
RED
REV[ERSE]
TURQUOISE
[UNDER]SCORE
UNPROT[ECTED]
VIS[IBLE]
WHITE
YELLOW

Notation conventions

This page uses the following syntax notation conventions:

Syntax notation Indicates that...
Single asterisk (*) Statements can be preceded by an IN clause, if there is no reference to a previous set (label or list). See IN clause syntax for more discussion.
Two asterisks (**) Construct can appear only within a record loop.
Plus sign (+) Construct requires the optional Horizon feature.
Two plus signs (++) Construct requires the optional User Language to Database 2 feature.
C The (first) keyword of the statement is also a Model 204 command; the command's wiki page will be, for example, 'OPEN command'.

Model 204 commands are listed alphabetically and documented in List of Model 204 commands.

Lowercase italic Constructs are replaced with variable information.
  • A field name (%%) variable can be used anywhere fieldname appears. The %%variable can contain its own subscript, separate from the field name subscript.

    Note: The subscript of an array element must be specified before a field name subscript.

  • The lowercase constructs — retrieval-conditions, print-specifications, expression, subscript, attribute, and type — are discussed separately following the syntax summaries, beginning with Value specification syntax.
  • For more Model 204 notation conventions, see Notation conventions.