Statement syntax: Difference between revisions

From m204wiki
Jump to navigation Jump to search
mNo edit summary
Line 1: Line 1:
===Overview===
<p>This chapter summarizes User Language syntax and conventions, many of which are also discussed throughout this manual.</p>
==Overview==
<p>The statements are listed in alphabetical order. Later sections in this chapter provide other User Language syntax information. </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>
This topic summarizes User Language syntax and conventions, many of which are also discussed throughout this manual.</p>
<p>All system control commands are presented in the Rocket <var class="product">Model&nbsp;204</var> Parameter and Command Reference Manual.     </p>
<p>
===Notation conventions===
The statements are listed in alphabetical order. Later sections in this topic provide other User Language syntax information. </p>
<p>This page uses the following syntax notation conventions:   </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>
<p>
All system control commands are presented in the
[[List of Model 204 commands]]. </p>
==Notation conventions==
<p>
This page uses the following syntax notation conventions: </p>
 
<table>
<table>
<tr class="head">
<tr class="head">
Line 11: Line 20:
<th>Indicates that...</th>
<th>Indicates that...</th>
</tr>
</tr>
<tr>
<tr>
<td>Single asterisk (*) </td>
<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>
<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>
<tr>
<tr>
<td>Two asterisks (**) </td>
<td>Two asterisks (**) </td>
<td>Construct can appear only within a record loop.</td>
<td>Construct can appear only within a record loop.</td>
</tr>
</tr>
<tr>
<tr>
<td>Plus sign (+) </td>
<td>Plus sign (+) </td>
<td>Construct requires the optional Horizon feature.</td>
<td>Construct requires the optional Horizon feature.</td>
</tr>
</tr>
<tr>
<tr>
<td>Two plus signs (++) </td>
<td nowrap>Two plus signs (++) </td>
<td>Construct requires the optional User Language to Database 2 feature.</td>
<td>Construct requires the optional User Language to Database 2 feature.</td>
</tr>
</tr>
<tr>
<tr>
<td>C</td>
<td>C</td>
<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>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>
<p>
<p><var class="product">Model&nbsp;204</var> commands are listed alphabetically and documented in Rocket <var class="product">Model&nbsp;204</var> Parameter and Command Reference Manual.</p>
<var class="product">Model&nbsp;204</var> commands are listed alphabetically and documented in [[List of Model 204 commands]]. </p></td>
</td>
</tr>
</tr>
<tr>
<tr>
<td>Lower case italic </td>
<td>Lower case italic </td>
Line 39: Line 53:
</tr>
</tr>
</table>
</table>
<ul>
<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. </li>
<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 lower case 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>
</ul>
<b>Note</b>
<p>The subscript of an array element must be specified before a field name subscript.</p>
==User Language statements==
<ul>
<li>The lower case constructs--retrieval-conditions, print-specifications, expression, subscript, attribute, and type--are discussed separately following the syntax summaries, beginning with [[#Value specification syntax|Value specification syntax]].  </li>
</li>
</ul>
 
===User Language statements===
 
<p class="code">
<p class="code">
<b>**</b>  ADD fieldname = {value | (expression)}  
<b>**</b>  ADD fieldname = {value | (expression)}
 
ADD lob-name=BUFFER,position,length [RESERVE n [BYTES]]
ADD lob-name=BUFFER,position,length [RESERVE n [BYTES]]
</p>
</p>
 
<hr>
<hr>
 
<p class="code">
<p class="code">
ARRAY [arrayname] OCCURS {n | UNKNOWN}  
ARRAY [arrayname] OCCURS {n | UNKNOWN}
 
  DEPENDING ON {itemname | %variable}
  DEPENDING ON {itemname | %variable}
 
  [AFTER {itemname | arrayname}
  [AFTER {itemname | arrayname}
 
  | AT {position | itemname | imagename1 | arrayname}]
  | AT {position | itemname | imagename1 | arrayname}]
</p>
</p>
 
<hr>
<hr>
 
<p class="code">
<p class="code">
AUDIT print-specifications  
AUDIT print-specifications
</p>
</p>
 
<hr>
<hr>
 
<p class="code">
<p class="code">
AUDIT ALL FIELDGROUP INFORMATION [CTOFIELDS]</p>
AUDIT ALL FIELDGROUP INFORMATION [CTOFIELDS]</p>
 
<hr>
<hr>
 
<p class="code">
<p class="code">
AUDIT ALL INFORMATION  
AUDIT ALL INFORMATION
 
AAI
AAI
</p>
</p>
<hr>
<hr>
 
<p class="code">
<p class="code">
<b>C</b>  BACKOUT</p>
<b>C</b>  BACKOUT</p>
 
<hr>
<hr>
 
<p class="code">
<p class="code">
BYPASS <var>[</var>PENDING STATEMENT<var>]</var> </p>  
BYPASS <var>[</var>PENDING STATEMENT<var>]</var> </p>
 
<hr>
<hr>
 
<p class="code">
<p class="code">
CALL {label | subname
CALL {label | subname
 
  [([expression | %variable | [LIST] listname] [,...])]}
  [([expression | %variable | [LIST] listname] [,...])]}
 
</p>
</p>
<hr>
<hr>
 
<p class="code">
<p class="code">
<b>**</b>  CHANGE fieldname <var>[</var>(subscript)<var>]</var> [= value1 |(expression)] TO (value2 | (expression))  
<b>**</b>  CHANGE fieldname <var>[</var>(subscript)<var>]</var> [= value1 |(expression)] TO (value2 | (expression))
 
CHANGE lob-fieldname,position1,length TO BUFFER,position2,length [RESERVE n [BYTES]]
CHANGE lob-fieldname,position1,length TO BUFFER,position2,length [RESERVE n [BYTES]]
</p>
</p>
 
<hr>
<hr>
 
<p class="code">
<p class="code">
CLEAR  
CLEAR
<nowiki>
<nowiki>
  {[[ALL | TEMP | LISTFDST | POSITION] [GLOBAL]]  
  {[[ALL | TEMP | LISTFDST | POSITION] [GLOBAL]]
</nowiki>
</nowiki>
  OBJECTS
  OBJECTS
 
  | GLOBALS
  | GLOBALS
 
  | GLOBAL {IMAGE | SCREEN | MENU | LIST | FOUNDSET
  | GLOBAL {IMAGE | SCREEN | MENU | LIST | FOUNDSET
 
  | POSITION [PERM | TEMP]}
  | POSITION [PERM | TEMP]}
 
  {'objectname' | %variable}}
  {'objectname' | %variable}}
 
</p>
</p>
<hr>
<hr>
 
<p class="code">
<p class="code">
<b>*</b>  CLEAR LIST listname </p>
<b>*</b>  CLEAR LIST listname </p>
 
<hr>
<hr>
 
<p class="code">
<p class="code">
CLEAR ON
CLEAR ON
 
  {ATTENTION | ERROR | FIELD CONSTRAINT CONFLICT
  {ATTENTION | ERROR | FIELD CONSTRAINT CONFLICT
 
  | FIND CONFLICT | RECORD LOCKING CONFLICT
  | FIND CONFLICT | RECORD LOCKING CONFLICT
 
  | MISSING FILE | MISSING MEMBER}
  | MISSING FILE | MISSING MEMBER}
</p>
</p>
<hr>
<hr>
 
<p class="code">CLEAR TAG {screenname | %screenname:inputname}
<p class="code">CLEAR TAG {screenname | %screenname:inputname}
</p>
</p>
 
<hr>
<hr>
 
<p class="code">
<p class="code">
CLOSE
CLOSE
 
  {DATASET {ext-filename | %variable}
  {DATASET {ext-filename | %variable}
 
  | [EXTERNAL] {ext-filename | TERMINAL | %variable}}
  | [EXTERNAL] {ext-filename | TERMINAL | %variable}}
 
</p>
</p>
<hr>
<hr>
 
<p class="code">
<p class="code">
<b>+ C</b>  CLOSE PROCESS  
<b>+ C</b>  CLOSE PROCESS
 
  {cid | processname | %variable}
  {cid | processname | %variable}
 
  [SYNCLEVEL | FLUSH | %variable]
  [SYNCLEVEL | FLUSH | %variable]
</p>
</p>
 
<hr>
<hr>
 
<p class="code">
<p class="code">
CLOSE PROCESS  
CLOSE PROCESS
 
  {cid | processname | %variable}
  {cid | processname | %variable}
 
  [SYNCLEVEL | CONFIRM | FLUSH | ERROR | %variable]
  [SYNCLEVEL | CONFIRM | FLUSH | ERROR | %variable]
</p>
</p>
 
<hr>
<hr>
 
<p class="code">
<p class="code">
COMMIT <var>[</var>RELEASE<var>]</var></p>    
COMMIT <var>[</var>RELEASE<var>]</var></p>
 
<b>____________________________________________________</b>
<hr>
 
<p class="code">
<p class="code">
<b>+</b>  CONFIRM {cid | processname | %variable}  
<b>+</b>  CONFIRM {cid | processname | %variable}
 
         REQSEND %variable
         REQSEND %variable
</p>
</p>
<b>____________________________________________________</b>
<hr>
 
<p class="code">
<p class="code">
<b>+</b>  CONFIRMED {cid | processname | %variable}
<b>+</b>  CONFIRMED {cid | processname | %variable}
</p>
</p>
 
<b>____________________________________________________</b>
<hr>
 
<p class="code">
<p class="code">
CONTINUE</p>
CONTINUE</p>
 
<b>____________________________________________________</b>
<hr>
 
<p class="code">
<p class="code">
<b>**</b>  COUNT OCCURRENCES OF fieldname</p>  
<b>**</b>  COUNT OCCURRENCES OF fieldname</p>
 
<b>____________________________________________________</b>
<hr>
 
<p class="code">
<p class="code">
COUNT RECORDS {IN label | ON [LIST] listname}</p>
COUNT RECORDS {IN label | ON [LIST] listname}</p>
<hr>
<p class="code">
<var>[</var>DECLARE<var>]</var> declaration
</p>


<b>____________________________________________________</b>
<div style="margin-left: 20px">
<p>
where <var class="term">declaration</var> is one of the following: </p>


<p class="code">
<p class="code">
<var>[</var>DECLARE<var>]</var> declaration
</p>
<p>where declaration is one of the following: </p>
<p class="code">
LABEL labelname [GLOBAL | COMMON]
LABEL labelname [GLOBAL | COMMON]
 
  LIST listname [IN [FILE | [PERM | TEMP]  
  LIST listname [IN [FILE | [PERM | TEMP]
 
       GROUP]] name] [GLOBAL | COMMON]
       GROUP]] name] [GLOBAL | COMMON]
 
  IMAGE imagename [AT {itemname | imagename1  
  IMAGE imagename [AT {itemname | imagename1
 
       | arrayname}
       | arrayname}
 
       | GLOBAL [PERMANENT | TEMPORARY]
       | GLOBAL [PERMANENT | TEMPORARY]
 
       | [PERMANENT | TEMPORARY] GLOBAL
       | [PERMANENT | TEMPORARY] GLOBAL
 
       | COMMON]
       | COMMON]
 
  MENU menuname [GLOBAL [PERMANENT | TEMPORARY]
  MENU menuname [GLOBAL [PERMANENT | TEMPORARY]
 
       | [PERMANENT | TEMPORARY] GLOBAL
       | [PERMANENT | TEMPORARY] GLOBAL
 
       | COMMON]
       | COMMON]
 
  SCREEN screenname [GLOBAL [PERMANENT | TEMPORARY]
  SCREEN screenname [GLOBAL [PERMANENT | TEMPORARY]
 
         | [PERMANENT | TEMPORARY] GLOBAL
         | [PERMANENT | TEMPORARY] GLOBAL
 
         | COMMON]
         | COMMON]
 
  %variable [IS] {FIXED [DP n] | FLOAT}
  %variable [IS] {FIXED [DP n] | FLOAT}
 
           [ARRAY (d1 [,d2 [,d3]])]  
           [ARRAY (d1 [,d2 [,d3]])]
 
           [INITIAL(numeric-expression)] [STATIC]
           [INITIAL(numeric-expression)] [STATIC]
 
           [COMMON]  
           [COMMON]
 
  %variable [IS] STRING [LEN n] [DP {n | *}]
  %variable [IS] STRING [LEN n] [DP {n | *}]
 
           [ARRAY (d1 [,d2[,d3]])]
           [ARRAY (d1 [,d2[,d3]])]
 
           [NO FIELD SAVE] [COMMON]
           [NO FIELD SAVE] [COMMON]
 
           [INITIAL('EBCDIC-string' | expression)]
           [INITIAL('EBCDIC-string' | expression)]
 
           [STATIC]
           [STATIC]
 
  SUBROUTINE subname  
  SUBROUTINE subname
 
         [(type [INPUT | OUTPUT | INPUT OUTPUT] [,...])]
         [(type [INPUT | OUTPUT | INPUT OUTPUT] [,...])]
</p>
</p>
<p>type is one of the following:</p>
</div> <!-- declaration indent -->
<div style="margin-left: 40px">
<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:
<p class="code">
<p class="code">
{STRING [LEN] n [DP {n | *}] | [FIXED [DP n]  
{STRING [LEN] n [DP {n | *}] | [FIXED [DP n]
 
| FLOAT]}
| FLOAT]}
</p>
</p>
</li>
</li>
<li>Array %variable of the following format:
<li>Array %variable of the following format:
<p class="code">{STRING [LEN n] [DP [n | *}] [ARRAY (* [,*[,*]])
<p class="code">{STRING [LEN n] [DP [n | *}] [ARRAY (* [,*[,*]])
 
  [NO FIELD SAVE]]
  [NO FIELD SAVE]]
 
  | [FIXED [DP n] | FLOAT] [ARRAY (* [,*[,*]])]}
  | [FIXED [DP n] | FLOAT] [ARRAY (* [,*[,*]])]}
</p>
</p>
</li>
</li>
<li>A list of records of the following format:
<li>A list of records of the following format:
<p class="code">[LIST] [IN {FILE | [PERM | TEMP] GROUP} name]
<p class="code">[LIST] [IN {FILE | [PERM | TEMP] GROUP} name]
Line 294: Line 316:
</li>
</li>
</ul>
</ul>
<b>____________________________________________________</b>
</div> <!-- type indentation -->


<hr>
<p class="code">
<p class="code">
DEFAULT CURSOR [READ | REREAD | PRINT]
DEFAULT CURSOR [READ | REREAD | PRINT]
 
               {ITEMID n | itemname | ROW n COLUMN m}
               {ITEMID n | itemname | ROW n COLUMN m}
</p>
</p>
<b>____________________________________________________</b>
<hr>
<p class="code">
<p class="code">
DEFAULT {TITLE  
DEFAULT {TITLE
 
         | PROMPT  
         | PROMPT
 
         | INPUT [DEBLANK | NODEBLANK] [PAD WITH 'c']
         | INPUT [DEBLANK | NODEBLANK] [PAD WITH 'c']
 
           [LEN m [DP [k | *}]] [UPCASE | NOCASE]
           [LEN m [DP [k | *}]] [UPCASE | NOCASE]
 
         | [TAG [attributes] [WITH 'c']}  
         | [TAG [attributes] [WITH 'c']}
 
         [[READ] attributes]
         [[READ] attributes]
 
         [REREAD attributes]
         [REREAD attributes]
 
         [PRINT attributes]
         [PRINT attributes]
</p>
</p>
<b>____________________________________________________</b>
<hr>
<p class="code">
<p class="code">
DEFAULT SKIP n POSITIONS[S]
DEFAULT SKIP n POSITIONS[S]
 
             [INITIAL {NULL | character | BLANK}]
             [INITIAL {NULL | character | BLANK}]
</p>
</p>
<b>____________________________________________________</b>
<hr>
 
<p class="code">
<p class="code">
DEFAULT [TYPE]
DEFAULT [TYPE]
 
  {STRING | BINARY | PACKED | ZONED | FLOAT | EFORMAT}
  {STRING | BINARY | PACKED | ZONED | FLOAT | EFORMAT}
 
  {LEN {n | UNKNOWN} | BITS n | DIGITS n}
  {LEN {n | UNKNOWN} | BITS n | DIGITS n}
 
  [DP {k | *}] [BP n]
  [DP {k | *}] [BP n]
 
  [SIGNED | UNSIGNED] [PAD {BLANK | character | NULL}]
  [SIGNED | UNSIGNED] [PAD {BLANK | character | NULL}]
 
  [STRIP | NOSTRIP] [JUSTIFY {LEFT | RIGHT}]
  [STRIP | NOSTRIP] [JUSTIFY {LEFT | RIGHT}]
 
  [INITIAL {BLANK | ZERO | NULL | literal}]  
  [INITIAL {BLANK | ZERO | NULL | literal}]
</p>
</p>
<b>____________________________________________________</b>
<hr>
 
<p class="code">
<p class="code">
<b>**</b>  DELETE fieldname <var>[</var>(subscript)<var>]</var> <var>[</var><b></b>= value |(expression)<var>]</var>  
<b>**</b>  DELETE fieldname <var>[</var>(subscript)<var>]</var> <var>[</var><b></b>= value |(expression)<var>]</var>
</p>  
</p>
<b>____________________________________________________</b>
<hr>
 
<p class="code">
<p class="code">
<b>**</b>  DELETE EACH fieldname</p>  
<b>**</b>  DELETE EACH fieldname</p>
 
<b>____________________________________________________</b>
<hr>
 
<p class="code">
<p class="code">
<b>**</b>  DELETE RECORD </p>  
<b>**</b>  DELETE RECORD </p>
 
<b>____________________________________________________</b>
<hr>
 
<p class="code">
<p class="code">
DELETE [ALL] RECORDS {IN label | ON [LIST] listname}
DELETE [ALL] RECORDS {IN label | ON [LIST] listname}
</p>
</p>
 
<b>___________________________________________________</b>
<hr>
 
<p class="code">
<p class="code">
END BLOCK label </p>  
END BLOCK label </p>
 
<b>____________________________________________________</b>
<hr>
 
<p class="code">
<p class="code">
END {FIND | IF | FOR | ON | REPEAT | STORE  
END {FIND | IF | FOR | ON | REPEAT | STORE
 
     | SUBROUTINE} [label]
     | SUBROUTINE} [label]
</p>
</p>
<b>____________________________________________________</b>
<hr>
 
<p class="code">
<p class="code">
END {ARRAY | IMAGE | MENU | SCREEN}</p>
END {ARRAY | IMAGE | MENU | SCREEN}</p>
 
<b>____________________________________________________</b>
<hr>
 
<p class="code">
<p class="code">
END [MORE | NORUN | USE]...</p>
END [MORE | NORUN | USE]...</p>
 
<b>____________________________________________________</b>
<hr>
 
<p class="code">
<p class="code">
END UPDATE</p>
END UPDATE</p>
 
<b>____________________________________________________</b>
<hr>
 
<p class="code">
<p class="code">
FILE RECORDS {IN label | ON [LIST] listname}
FILE RECORDS {IN label | ON [LIST] listname}
 
             UNDER fieldname = {value | (expression)}
             UNDER fieldname = {value | (expression)}
</p>
</p>
<b>____________________________________________________</b>
<hr>
 
<p class="code">
<p class="code">
<b>*</b>  FIND [AND RESERVE] [ALL] RECORDS  
<b>*</b>  FIND [AND RESERVE] [ALL] RECORDS
 
     [IN label | ON [LIST] listname]
     [IN label | ON [LIST] listname]
 
     [FOR WHICH | WITH] retrieval-conditions
     [FOR WHICH | WITH] retrieval-conditions
</p>
</p>
<b>____________________________________________________</b>
<hr>
 
<p class="code">
<p class="code">
<b>*</b>  FIND <var>[</var>ALL<var>]</var> VALUES OF fieldname  
<b>*</b>  FIND <var>[</var>ALL<var>]</var> VALUES OF fieldname
 
<var>            [</var>FROM {value1|(expression1)}<var>]</var> <var>[</var>TO {value2|(expression2)}<var>]</var>  
<var>            [</var>FROM {value1|(expression1)}<var>]</var> <var>[</var>TO {value2|(expression2)}<var>]</var>
 
<var>            [[</var>NOT<var>]</var> LIKE 'pattern'<var>]</var>  
<var>            [[</var>NOT<var>]</var> LIKE 'pattern'<var>]</var>
</p>
</p>
<b>____________________________________________________</b>
<hr>
 
<p class="code">
<p class="code">
<b>*</b>  FIND AND PRINT COUNT <var>[</var>retrieval-conditions<var>]</var>      
<b>*</b>  FIND AND PRINT COUNT <var>[</var>retrieval-conditions<var>]</var>
</p>
</p>
<b>____________________________________________________</b>
<hr>
 
<p class="code">
<p class="code">
<b>*</b>  {FIND WITHOUT LOCKS | FDWOL}
<b>*</b>  {FIND WITHOUT LOCKS | FDWOL}
 
  [ALL] RECORDS [IN label | ON [LIST] listname]
  [ALL] RECORDS [IN label | ON [LIST] listname]
 
  [FOR WHICH | WITH] retrieval-conditions
  [FOR WHICH | WITH] retrieval-conditions
</p>
</p>
<b>____________________________________________________</b>
<hr>
 
<p class="code">
<p class="code">
FLUSH PROCESS {cid | processname | %variable}</p>
FLUSH PROCESS {cid | processname | %variable}</p>
 
<b>____________________________________________________</b>
<hr>
 
<p class="code">
<p class="code">
<b>**</b>  FOR {EACH | k} {OCCURRENCE | OCCURRENCES} OF fieldname
<b>**</b>  FOR {EACH | k} {OCCURRENCE | OCCURRENCES} OF fieldname
</p>
</p>
<b>____________________________________________________</b>
<hr>
 
<p class="code">
<p class="code">
<b>*</b>  FOR {EACH | k} {RECORD | RECORDS}
<b>*</b>  FOR {EACH | k} {RECORD | RECORDS}
 
  [IN label | ON [LIST] listname]
  [IN label | ON [LIST] listname]
 
  IN [ASCENDING | DESCENDING]
  IN [ASCENDING | DESCENDING]
 
  [SORTKEY] ORDER [BY [EACH] fieldname]
  [SORTKEY] ORDER [BY [EACH] fieldname]
 
  [FROM {value1|(expression1)}] [TO {value2|(expression2)}] [BY {%variable | literal}]
  [FROM {value1|(expression1)}] [TO {value2|(expression2)}] [BY {%variable | literal}]
 
  [OPTIMIZING FNV]
  [OPTIMIZING FNV]
 
  [{WHERE | WITH} retrieval-conditions]  
  [{WHERE | WITH} retrieval-conditions]
</p>
</p>
<b>____________________________________________________</b>
<hr>
 
<p class="code">
<p class="code">
<b>*</b>  FOR {EACH | k} {VALUE | VALUES} OF fieldname
<b>*</b>  FOR {EACH | k} {VALUE | VALUES} OF fieldname
 
  [FROM {value1|(expression1)}] [TO {value2|(expression2)}]
  [FROM {value1|(expression1)}] [TO {value2|(expression2)}]
  [[NOT] LIKE pattern]
  [[NOT] LIKE pattern]
 
  [IN [ASCENDING | DESCENDING] [CHARACTER | NUMERICAL]
  [IN [ASCENDING | DESCENDING] [CHARACTER | NUMERICAL]
 
  [RIGHT-ADJUSTED] ORDER]  
  [RIGHT-ADJUSTED] ORDER]
</p>
</p>
<b>____________________________________________________</b>
<hr>
 
<p class="code">
<p class="code">
FOR {EACH | k} {VALUE | VALUES} IN label </p>
FOR {EACH | k} {VALUE | VALUES} IN label </p>
 
<b>____________________________________________________</b>
<hr>
 
<p class="code">
<p class="code">
<b>*</b>  FOR RECORD NUMBER {value | (expression)}
<b>*</b>  FOR RECORD NUMBER {value | (expression)}
</p>
</p>
<b>____________________________________________________</b>
<hr>
 
<p class="code">
<p class="code">
FOR RECORD NUMBER {value | IN label} [OPTIMIZING FNV]
FOR RECORD NUMBER {value | IN label} [OPTIMIZING FNV]
</p>
</p>
<b>____________________________________________________</b>
<hr>
 
<p class="code">
<p class="code">
FOR %variable FROM expression1
FOR %variable FROM expression1
 
  {TO expression2 [BY expression3]
  {TO expression2 [BY expression3]
 
  | [BY expression3] TO expression2}  
  | [BY expression3] TO expression2}
</p>
</p>
<p class="note"><b>Note:</b> The BY clause, when omitted, defaults to a value of 1.</p>
<p class="note"><b>Note:</b> The BY clause, when omitted, defaults to a value of 1.</p>
 
<b>____________________________________________________</b>
<hr>
 
<p class="code">
<p class="code">
IDENTIFY
IDENTIFY
 
  {[IMAGE] imagename
  {[IMAGE] imagename
 
  | %imagename:itemname LEN {n | %variable}
  | %imagename:itemname LEN {n | %variable}
 
  | %imagename:arrayname OCCURS {n | %variable}}   
  | %imagename:arrayname OCCURS {n | %variable}}
 
   
</p>
</p>
<b>____________________________________________________</b>
<hr>
 
<p class="code">
<p class="code">
<b>C</b>  IF expression THEN statements
<b>C</b>  IF expression THEN statements
 
  [ELSE statements | ELSEIF expression THEN statements]
  [ELSE statements | ELSEIF expression THEN statements]
 
</p>
</p>
<b>____________________________________________________</b>
<hr>
 
<p class="code">
<p class="code">
[DECLARE] IMAGE imagename
[DECLARE] IMAGE imagename
 
  [GLOBAL [PERMANENT | TEMPORARY]
  [GLOBAL [PERMANENT | TEMPORARY]
 
  | [PERMANENT | TEMPORARY] GLOBAL
  | [PERMANENT | TEMPORARY] GLOBAL
 
  | COMMON [AT [itemname | imagename1 |arrayname}]]   
  | COMMON [AT [itemname | imagename1 |arrayname}]]
 
   
</p>
</p>
<b>____________________________________________________</b>
<hr>
 
<p class="code">
<p class="code">
<b>*</b>  INCLUDE procedurename  </p>   
<b>*</b>  INCLUDE procedurename  </p>
 
   
<b>____________________________________________________</b>
<hr>
 
<p class="code">
<p class="code">
INPUT inputname [AT [COLUMN] n]
INPUT inputname [AT [COLUMN] n]
 
  [TO [COLUMN] m | [LEN m] DP {k | *}]]
  [TO [COLUMN] m | [LEN m] DP {k | *}]]
 
  [UPCASE | NOCASE] [DEFAULT 'value']
  [UPCASE | NOCASE] [DEFAULT 'value']
 
  [DEBLANK | NODEBLANK] [PAD WITH 'c']
  [DEBLANK | NODEBLANK] [PAD WITH 'c']
 
  [REQUIRED | ALPHA | ALPHANUM | MUSTFILL
  [REQUIRED | ALPHA | ALPHANUM | MUSTFILL
 
  | ONEOF literal [,literal]...
  | ONEOF literal [,literal]...
 
  | [NUMERIC] [RANGE lo [TO] hi [AND lo [TO] hi] ...]
  | [NUMERIC] [RANGE lo [TO] hi [AND lo [TO] hi] ...]
 
  | VERIFY 'characters']...
  | VERIFY 'characters']...
 
  [[READ] attributes] [REREAD attributes]
  [[READ] attributes] [REREAD attributes]
 
  [PRINT attributes]
  [PRINT attributes]
 
  {TAG [attributes] [WITH 'c']] [ITEMID n]  
  {TAG [attributes] [WITH 'c']] [ITEMID n]
</p>
</p>
<b>____________________________________________________</b>
<hr>
 
<p class="code">
<p class="code">
INSERT fieldname <var>[</var>(subscript)<var>]</var> = {value | (expression)}  
INSERT fieldname <var>[</var>(subscript)<var>]</var> = {value | (expression)}
</p>
</p>
<b>____________________________________________________</b>
<hr>
 
<p class="code">
<p class="code">
<b>+</b>  INVITE {cid | processname | %variable}
<b>+</b>  INVITE {cid | processname | %variable}
 
  [SYNCLEVEL | FLUSH | CONFIRM]<var> </var>
  [SYNCLEVEL | FLUSH | CONFIRM]<var> </var>
</p>
</p>
<b>____________________________________________________</b>
<hr>
 
<p class="code">
<p class="code">
itemname IS [TYPE]
itemname IS [TYPE]
 
  {STRING | BINARY | PACKED | ZONED | FLOAT | EFORMAT}
  {STRING | BINARY | PACKED | ZONED | FLOAT | EFORMAT}
 
  {LEN {n | UNKNOWN} | BITS n | DIGITS n  
  {LEN {n | UNKNOWN} | BITS n | DIGITS n
 
  | TO position}
  | TO position}
 
  [DP {k | *}] [BP n] [SIGNED | UNSIGNED]
  [DP {k | *}] [BP n] [SIGNED | UNSIGNED]
 
  [PAD {BLANK | character | NULL}] [STRIP | NOSTRIP]
  [PAD {BLANK | character | NULL}] [STRIP | NOSTRIP]
 
  [ALIGN]
  [ALIGN]
 
  [JUSTIFY {LEFT | RIGHT}]
  [JUSTIFY {LEFT | RIGHT}]
 
  [INITIAL {BLANK | ZERO | NULL | value}]
  [INITIAL {BLANK | ZERO | NULL | value}]
 
  [AFTER {itemname | arrayname}
  [AFTER {itemname | arrayname}
 
  | AT {position | itemname | imagename1 | arrayname}]
  | AT {position | itemname | imagename1 | arrayname}]
 
  [OCCURS {n [DEPENDING ON {itemname | %variable}]
  [OCCURS {n [DEPENDING ON {itemname | %variable}]
 
  | UNKNOWN}]  
  | UNKNOWN}]
</p>
</p>
<b>____________________________________________________</b>
<hr>
 
<p class="code">
<p class="code">
JUMP TO label
JUMP TO label
</p>  
</p>
 
<b>___________________________________________________</b>
<hr>
 
<p class="code">
<p class="code">
JUMP TO (label1 <var>[</var>,label2<var>]</var> ...) expression  
JUMP TO (label1 <var>[</var>,label2<var>]</var> ...) expression
</p>
</p>
 
<b>___________________________________________________</b>
<hr>
 
<p class="code">
<p class="code">
LOOP END </p>  
LOOP END </p>
 
<b>____________________________________________________</b>
<hr>
 
<p class="code">
<p class="code">
MAX PFKEY n </p>  
MAX PFKEY n </p>
 
<b>____________________________________________________</b>
<hr>
 
<p class="code">
<p class="code">
[DECLARE] MENU menuname
[DECLARE] MENU menuname
 
  [GLOBAL [PERMANENT | TEMPORARY]
  [GLOBAL [PERMANENT | TEMPORARY]
 
  | [PERMANENT | TEMPORARY] GLOBAL
  | [PERMANENT | TEMPORARY] GLOBAL
 
  | COMMON]
  | COMMON]
</p>
</p>
<b>____________________________________________________</b>
<hr>
 
<p class="code">
<p class="code">
MODIFY {%menuname:itemname | %screenname:itemname}
MODIFY {%menuname:itemname | %screenname:itemname}
 
  [TO] attributes [[FOR] {ALL | READ | REREAD | TAB  
  [TO] attributes [[FOR] {ALL | READ | REREAD | TAB
 
  | PRINT}]
  | PRINT}]
</p>
</p>
<b>____________________________________________________</b>
<hr>
 
<p class="code">
<p class="code">
MODIFY BUFFER [SIZE=n  
MODIFY BUFFER [SIZE=n
 
   | %variable [PRESERVE | NOPRESERVE]]
   | %variable [PRESERVE | NOPRESERVE]]
 
   [FILL [X'nn'] | CLEAR]
   [FILL [X'nn'] | CLEAR]
 
</p>
</p>
<b>____________________________________________________</b>
<hr>
 
<p class="code">
<p class="code">
<b>C</b>  NEW PAGE  </p>   
<b>C</b>  NEW PAGE  </p>
 
   
<b>____________________________________________________</b>
<hr>
 
<p class="code">
<p class="code">
<b>**</b>  NOTE <var>{</var>fieldname <var>[</var>(subscript)<var>]}</var>
<b>**</b>  NOTE <var>{</var>fieldname <var>[</var>(subscript)<var>]}</var>
</p>
</p>
<b>____________________________________________________</b>
<hr>
 
<p class="code">
<p class="code">
NOTE 'string' </p>  
NOTE 'string' </p>
 
<b>____________________________________________________</b>
<hr>
 
<p class="code">
<p class="code">
ON {ATTENTION | ERROR | FIELD CONSTRAINT CONFLICT
ON {ATTENTION | ERROR | FIELD CONSTRAINT CONFLICT
 
   | FIND CONFLICT | MISSING FILE | MISSING MEMBER
   | FIND CONFLICT | MISSING FILE | MISSING MEMBER
 
   | RECORD LOCKING CONFLICT} statements </p>
   | RECORD LOCKING CONFLICT} statements </p>
 
<b>____________________________________________________</b>
<hr>
 
<p class="code">
<p class="code">
OPEN {[DATASET | EXTERNAL] {ext-filename  
OPEN {[DATASET | EXTERNAL] {ext-filename
 
     | %variable}
     | %variable}
 
     | [EXTERNAL] {TERMINAL | %variable}}
     | [EXTERNAL] {TERMINAL | %variable}}
 
     FOR {INPUT [OUTPUT] | OUTPUT [INPUT] | INOUT}
     FOR {INPUT [OUTPUT] | OUTPUT [INPUT] | INOUT}
 
     [PASSWORD {value | %variable}]
     [PASSWORD {value | %variable}]
</p>
</p>
<b>____________________________________________________</b>
<hr>
 
<p class="code">
<p class="code">
<b>C</b>  OPEN [C] [[PERM | TEMP] GROUP | FILE]
<b>C</b>  OPEN [C] [[PERM | TEMP] GROUP | FILE]
 
  {name [AT {location | %variable | =}] |%variable}
  {name [AT {location | %variable | =}] |%variable}
 
  [PASSWORD {value | %variable}]  
  [PASSWORD {value | %variable}]
</p>
</p>
<b>____________________________________________________</b>
<hr>
 
<p class="code">
<p class="code">
OPEN PROCESS {processname | %variable}
OPEN PROCESS {processname | %variable}
 
  [CID {name | %variable}]  
  [CID {name | %variable}]
</p>
</p>
<b>____________________________________________________</b>
<hr>
 
<p class="code">
<p class="code">
<b>+</b>  OPEN PROCESS {processname | %variable}
<b>+</b>  OPEN PROCESS {processname | %variable}
 
  [CID {name | %variable}]
  [CID {name | %variable}]
 
  {outbound options | inbound options}
  {outbound options | inbound options}
</p>
</p>
<p>where outbound options are:</p>
<p class="code">
[AT DESTINATION] [WITH] [USERID {%variable


<div style="margin-left: 20px">
<p>
where <var class="term">outbound</var> options are:</p>
<p class="code">
[AT DESTINATION] [WITH] [USERID {%variable
  | 'string'}]
  | 'string'}]
 
  [PASSWORD {%variable | 'string'}]
  [PASSWORD {%variable | 'string'}]
 
  [{ACCOUNT | PROFILE {%variable | 'string'}]
  [{ACCOUNT | PROFILE {%variable | 'string'}]
 
  [INITIAL {DATA 'string' | DATA %variable
  [INITIAL {DATA 'string' | DATA %variable
 
  | IMAGE imagename] ...]
  | IMAGE imagename] ...]
</p>
</p>
<p>and inbound options are:</p>
 
<p class="code">  
<p>
ACCEPT [INITIAL {DATA %variable | IMAGE image} ...]  
and <var class="term">inbound</var> options are:</p>
<p class="code">
ACCEPT [INITIAL {DATA %variable | IMAGE image} ...]
</p>
</p>
<b>____________________________________________________</b>
</div> <!-- end indent of options -->


<p class="code">PAUSE <var>[</var>n | %variable<var>]</var>  
<hr>
<p class="code">PAUSE <var>[</var>n | %variable<var>]</var>
</p>
</p>
<b>____________________________________________________</b>
<hr>
 
<p class="code">
<p class="code">
<b>**</b>  PLACE RECORD ON <var>[</var>LIST<var>]</var> listname  
<b>**</b>  PLACE RECORD ON <var>[</var>LIST<var>]</var> listname
</p>
</p>
<b>____________________________________________________</b>
<hr>
 
<p class="code">PLACE RECORDS {IN label | ON [LIST] listname1}
<p class="code">PLACE RECORDS {IN label | ON [LIST] listname1}
 
  ON [LIST] listname2  
  ON [LIST] listname2
</p>
</p>
<b>____________________________________________________</b>
<hr>
 
<p class="code">
<p class="code">
POSITION {FOUNDSET foundsortset_name | LIST list_name}
POSITION {FOUNDSET foundsortset_name | LIST list_name}
 
   [AT] position_name
   [AT] position_name
</p>
</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 this form of the POSITION statement with FOR loop processing; see [[Global features#POSITION statement|POSITION statement]].</p>
<b>____________________________________________________</b>
<hr>
 
<p class="code">
<p class="code">
POSITION {ext-filename | %variable}
POSITION {ext-filename | %variable}
 
  AT KEY operator {value | %variable}  
  AT KEY operator {value | %variable}
</p>
</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>
<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>
<b>____________________________________________________</b>
<hr>
 
<p class="code">
<p class="code">
PREPARE
PREPARE
 
  {[IMAGE] imagename | [MENU] menuname
  {[IMAGE] imagename | [MENU] menuname
 
  | [SCREEN] screenname}  
  | [SCREEN] screenname}
</p>
</p>
<b>____________________________________________________</b>
<hr>
 
<p class="code">PRINT print specifications  </p>  
<p class="code">PRINT print specifications  </p>
 
<b>_______________________________________________________________</b>
<hr>
 
 
<p class="code">
<p class="code">
<b>**</b>  {PAI | PRINT ALL INFORMATION}
<b>**</b>  {PAI | PRINT ALL INFORMATION}
 
  INTO array1, array2 [,array3] [FROM start] [COUNT ct]
  INTO array1, array2 [,array3] [FROM start] [COUNT ct]
</p>
</p>
<b>_______________________________________________________________</b>
<hr>
 
<p class="code">
<p class="code">
PRINT [MENU] menuname [ALERT]  
PRINT [MENU] menuname [ALERT]
 
  [TITLE {'text' | %variable} [AT [COLUMN] n]
  [TITLE {'text' | %variable} [AT [COLUMN] n]
 
  [TO [COLUMN] m | LEN m] [attributes]]
  [TO [COLUMN] m | LEN m] [attributes]]
</p>
</p>
<b>____________________________________________________</b>
<hr>
 
<p class="code">
<p class="code">
PRINT SCREEN screenname [ALERT] [[WITH] CURSOR]
PRINT SCREEN screenname [ALERT] [[WITH] CURSOR]
 
  [TITLE {'text' | %variable} [AT [COLUMN] n]
  [TITLE {'text' | %variable} [AT [COLUMN] n]
 
  [TO [COLUMN] m | LEN m] [attributes]]
  [TO [COLUMN] m | LEN m] [attributes]]
</p>
</p>
<b>____________________________________________________</b>
<hr>
 
<p class="code">
<p class="code">
PROMPT {'text' | promptname} [AT [COLUMN] n]
PROMPT {'text' | promptname} [AT [COLUMN] n]
 
  [TO [COLUMN] m | LEN m] [DP {k | *}]] [DEFAULT 'value']
  [TO [COLUMN] m | LEN m] [DP {k | *}]] [DEFAULT 'value']
 
  [[READ] attributes] [REREAD attributes]
  [[READ] attributes] [REREAD attributes]
 
  [PRINT attributes] [ITEMID n]  
  [PRINT attributes] [ITEMID n]
</p>
</p>
<b>____________________________________________________</b>
<hr>
 
<p class="code">
<p class="code">
<b>+</b>  QUERY PROCESS {cid | processname | %variable} options  
<b>+</b>  QUERY PROCESS {cid | processname | %variable} options
</p>
</p>
<p>where options must be one or more of the following:</p>
 
<div style="margin-left: 20px">
<p>
where options must be one or more of the following:</p>
<p class="code"> STATE %variable
<p class="code"> STATE %variable
 
  PROCESSGROUP %variable
  PROCESSGROUP %variable
 
  REMOTEID %variable
  REMOTEID %variable
 
  SYNCLEVEL %variable
  SYNCLEVEL %variable
 
  MODENAME %variable
  MODENAME %variable
</p>
</p>
 
</div> <!-- end options indenting -->
<b>____________________________________________________</b>
 
<hr>
<p class="code">
<p class="code">
READ [IMAGE] imagename
READ [IMAGE] imagename
 
  FROM {ext-filename | TERMINAL | %variable}
  FROM {ext-filename | TERMINAL | %variable}
 
  [PROMPT {'text' | %variable}]
  [PROMPT {'text' | %variable}]
 
  [NEXT | KEY operator {value | %variable}]  
  [NEXT | KEY operator {value | %variable}]
 
</p>
</p>
<b>____________________________________________________</b>
<hr>
 
<p class="code">
<p class="code">
READ [IMAGE] imagename FROM BUFFER
READ [IMAGE] imagename FROM BUFFER
 
   [POSITION={%pvariable | n}]
   [POSITION={%pvariable | n}]
 
   [MAXLEN={%lvariable | n}]
   [MAXLEN={%lvariable | n}]
 
</p>
</p>
<b>____________________________________________________</b>
<hr>
 
<p class="code">
<p class="code">
READ [MENU] menuname [ALERT]  
READ [MENU] menuname [ALERT]
 
  [TITLE ['text' | %variable} [AT [COLUMN] n]
  [TITLE ['text' | %variable} [AT [COLUMN] n]
 
  [TO [COLUMN] m | LEN m] [attributes]]
  [TO [COLUMN] m | LEN m] [attributes]]
</p>
</p>
<b>____________________________________________________</b>
<hr>
 
<p class="code">
<p class="code">
READ <var>[</var>SCREEN<var>]</var> screenname <var>[</var>ALERT<var>]</var> <var>[</var>NO REREAD<var>]</var> <var>[ [</var>WITH<var>]</var>  
READ <var>[</var>SCREEN<var>]</var> screenname <var>[</var>ALERT<var>]</var> <var>[</var>NO REREAD<var>]</var> <var>[ [</var>WITH<var>]</var>
 
  CURSOR<var>]</var>   
  CURSOR<var>]</var>
 
   
  [TITLE {'text' | %variable} [AT [COLUMN] n]
  [TITLE {'text' | %variable} [AT [COLUMN] n]
 
  [TO [COLUMN] m | LEN m] [attributes]]
  [TO [COLUMN] m | LEN m] [attributes]]
</p>
</p>
<b>____________________________________________________</b>
<hr>
 
<p class="code">
<p class="code">
RECEIVE {IMAGE imagename | %variable}
RECEIVE {IMAGE imagename | %variable}
 
  FROM {cid | processname | %variable} [RESULT %variable]  
  FROM {cid | processname | %variable} [RESULT %variable]
</p>
</p>
<b>____________________________________________________</b>
<hr>
 
<p class="code">
<p class="code">
<b>+</b>  RECEIVE {IMAGE imagename | %variable}
<b>+</b>  RECEIVE {IMAGE imagename | %variable}
 
  FROM {cid | processname | %variable}  
  FROM {cid | processname | %variable}
 
  RESULT %variable  
  RESULT %variable
</p>
</p>
<b>____________________________________________________</b>
<hr>
 
<p class="code">
<p class="code">
RELEASE ALL RECORDS</p>  
RELEASE ALL RECORDS</p>
 
<b>____________________________________________________</b>
<hr>
 
<p class="code">
<p class="code">
RELEASE POSITION {ext-filename | %variable}  
RELEASE POSITION {ext-filename | %variable}
</p>
</p>
 
<b>____________________________________________________</b>
<hr>
 
<p class="code">
<p class="code">
RELEASE RECORDS {IN label | ON [LIST] listname}  
RELEASE RECORDS {IN label | ON [LIST] listname}
</p>
</p>
 
<b>____________________________________________________</b>
<hr>
 
<p class="code">
<p class="code">
<b>**</b>  REMEMBER <var>[</var>GLOBAL<var>]</var> position_name  
<b>**</b>  REMEMBER <var>[</var>GLOBAL<var>]</var> position_name
 
   [IN foundsortset_name | ON list_name]
   [IN foundsortset_name | ON list_name]
</p>
</p>
<b>____________________________________________________</b>
<hr>
 
<p class="code">
<p class="code">
<b>**</b>  REMOVE RECORD FROM <var>[</var>LIST<var>]</var> listname  
<b>**</b>  REMOVE RECORD FROM <var>[</var>LIST<var>]</var> listname
</p>
</p>
<b>____________________________________________________</b>
<hr>
 
<p class="code">
<p class="code">
REMOVE RECORDS {IN label | ON [LIST] listname}
REMOVE RECORDS {IN label | ON [LIST] listname}
 
  FROM [LIST] listname2  
  FROM [LIST] listname2
</p>
</p>
<b>____________________________________________________</b>
<hr>
 
<p class="code">
<p class="code">
REPEAT [FOREVER | n TIMES | WHILE expression]  
REPEAT [FOREVER | n TIMES | WHILE expression]
</p>
</p>
 
<b>___________________________________________________</b>
<b>___________________________________________________</b>
 
<p class="code">
<p class="code">
REREAD [SCREEN] screenname [ALERT] [[WITH] CURSOR]
REREAD [SCREEN] screenname [ALERT] [[WITH] CURSOR]
 
  [TITLE {'text' | %variable} [AT [COLUMN] n]
  [TITLE {'text' | %variable} [AT [COLUMN] n]
 
  [TO [COLUMN] m | LEN m] [attributes]]
  [TO [COLUMN] m | LEN m] [attributes]]
</p>
</p>
<b>____________________________________________________</b>
<hr>
 
<p class="code">
<p class="code">
RESET {HEADER | TRAILER} m  
RESET {HEADER | TRAILER} m
</p>
</p>
<b>____________________________________________________</b>
<hr>
 
<p class="code">
<p class="code">
RETRY <var>[</var>PENDING STATEMENT<var>]</var>  
RETRY <var>[</var>PENDING STATEMENT<var>]</var>
</p>
</p>
<b>____________________________________________________</b>
<hr>
 
<p class="code">
<p class="code">
RETURN  
RETURN
</p>
</p>
<b>____________________________________________________</b>
<hr>
 
<p class="code">
<p class="code">
[DECLARE] SCREEN screenname
[DECLARE] SCREEN screenname
 
  [GLOBAL [<u>PERMANENT</u> | TEMPORARY]
  [GLOBAL [<u>PERMANENT</u> | TEMPORARY]
 
  | [<u>PERMANENT</u> | TEMPORARY] GLOBAL
  | [<u>PERMANENT</u> | TEMPORARY] GLOBAL
 
  | COMMON]
  | COMMON]
</p>
</p>
<b>____________________________________________________</b>
<hr>
 
<p class="code">
<p class="code">
SEND {IMAGE imagename | 'string' | %variable}
SEND {IMAGE imagename | 'string' | %variable}
 
  TO {cid | processname | %variable}
  TO {cid | processname | %variable}
 
  [REQSEND %variable]
  [REQSEND %variable]
 
  [FLUSH]  
  [FLUSH]
</p>
</p>
<b>____________________________________________________</b>
<hr>
 
<p class="code">
<p class="code">
<b>+</b>  SEND {IMAGE imagename | 'string' | %variable}
<b>+</b>  SEND {IMAGE imagename | 'string' | %variable}
 
  TO {cid | processname | %variable}
  TO {cid | processname | %variable}
 
  [FLUSH | CONFIRM]
  [FLUSH | CONFIRM]
 
  [REQSEND %variable]
  [REQSEND %variable]
</p>
</p>
<b>____________________________________________________</b>
<hr>
 
<p class="code">
<p class="code">
<b>+</b>  SEND ERROR TO {cid | processname | %variable}  
<b>+</b>  SEND ERROR TO {cid | processname | %variable}
 
           REQSEND %variable
           REQSEND %variable
</p>
</p>
<b>____________________________________________________</b>
<hr>
 
<p class="code">
<p class="code">
SET {HEADER | TRAILER} m print-specifications  
SET {HEADER | TRAILER} m print-specifications
</p>
</p>
<b>____________________________________________________</b>
<hr>
 
<p class="code">
<p class="code">
SIGNAL PROCESS
SIGNAL PROCESS
 
  {cid | [processname | %variable} {nnn | %variable}
  {cid | [processname | %variable} {nnn | %variable}
</p>
</p>
<b>_______________________________________________________________</b>
<b>_______________________________________________________________</b>
 
<p class="code">
<p class="code">
<b>+</b>  SIGNAL PROCESS
<b>+</b>  SIGNAL PROCESS
 
  {cid | [processname | %variable}
  {cid | [processname | %variable}
 
</p>
</p>
<b>____________________________________________________</b>
<hr>
 
<p class="code">
<p class="code">
SKIP n LINE<var>[</var>S<var>]</var>
SKIP n LINE<var>[</var>S<var>]</var>
</p>  
</p>
 
<b>____________________________________________________</b>
<hr>
 
<p class="code">
<p class="code">
[itemname IS] SKIP n POSITION[S]
[itemname IS] SKIP n POSITION[S]
 
  [INITIAL {NULL | character | BLANK}]  
  [INITIAL {NULL | character | BLANK}]
</p>
</p>
<b>____________________________________________________</b>
<hr>
 
<p class="code">
<p class="code">
SORT [k] RECORDS {IN label | ON [LIST] listname}
SORT [k] RECORDS {IN label | ON [LIST] listname}
 
  BY key [AND key] ...
  BY key [AND key] ...
</p>
</p>
<p>where:</p>
<p class="code"> key = fieldname


<div style="margin-left: 20px">
<p>
where <var class="term">key</var> is:</p>
<p class="code"> key = fieldname
       [VALUE {[ASCENDING | DESCENDING]
       [VALUE {[ASCENDING | DESCENDING]
 
       [CHARACTER | NUMERICAL] | RIGHT-ADJUSTED]} ...]  
       [CHARACTER | NUMERICAL] | RIGHT-ADJUSTED]} ...]
</p>
</p>
<b>____________________________________________________</b>
</div> <!--end key indent -->


<hr>
<p class="code">
<p class="code">
SORT [k] RECORD KEYS
SORT [k] RECORD KEYS
 
  {IN label | ON [LIST] listname}
  {IN label | ON [LIST] listname}
 
  BY key [AND key] ...
  BY key [AND key] ...
</p>
</p>
<p>where:</p>
<p class="code"> key = fieldname


<div style="margin-left: 20px">
<p>
where <var class="term">key</var> is:</p>
<p class="code"> key = fieldname
       [VALUE {[ASCENDING | DESCENDING]
       [VALUE {[ASCENDING | DESCENDING]
 
       [CHARACTER | NUMERICAL] | [RIGHT-ADJUSTED]} ...]  
       [CHARACTER | NUMERICAL] | [RIGHT-ADJUSTED]} ...]
 
</p>
</p>
<b>____________________________________________________</b>
</div>


<hr>
<p class="code">
<p class="code">
SORT VALUE IN label [IN [ASCENDING | DESCENDING]
SORT VALUE IN label [IN [ASCENDING | DESCENDING]
 
  [<u>CHARACTER</u> | NUMERICAL] | [RIGHT-ADJUSTED] ORDER]  
  [<u>CHARACTER</u> | NUMERICAL] | [RIGHT-ADJUSTED] ORDER]
</p>
</p>
<b>____________________________________________________</b>
<hr>
 
<p class="code">
<p class="code">
STOP [IF COUNT IN label EXCEEDS n]
STOP [IF COUNT IN label EXCEEDS n]
</p>  
</p>
 
<b>__________________________________________________</b>
<hr>
 
<p class="code">
<p class="code">
<b>*</b>  STORE RECORD [sort or hash key value]  
<b>*</b>  STORE RECORD [sort or hash key value]
 
   fieldname1=[value1 | (expression1)]
   fieldname1=[value1 | (expression1)]
 
   [fieldname2=(expression)]
   [fieldname2=(expression)]
 
   ...
   ...
 
[THEN CONTINUE
[THEN CONTINUE
 
   statement
   statement
 
   statement
   statement
 
   ...]
   ...]
 
END STORE
END STORE
</p>
</p>
<b>____________________________________________________</b>
<hr>
 
<p class="code">
<p class="code">
SUBROUTINE
SUBROUTINE
</p>
</p>
 
<b>____________________________________________________</b>
<hr>
 
<p class="code">
<p class="code">
SUBROUTINE subname
SUBROUTINE subname
 
  [(formal-parameter [INPUT | OUTPUT | INPUT OUTPUT]
  [(formal-parameter [INPUT | OUTPUT | INPUT OUTPUT]
 
  [,...])]
  [,...])]
</p>
</p>
<p>where formal parameter is one of the following:</p>
 
<p class="code">  
<div style="margin-left: 20px">
<p>
where formal parameter is one of the following:</p>
<p class="code">
%variable [IS STRING [LEN n] [DP {n | *}]
%variable [IS STRING [LEN n] [DP {n | *}]
 
           [ARRAY (*[,*[,*]]) [NO FS]]
           [ARRAY (*[,*[,*]]) [NO FS]]
 
           | IS {FIXED [DP n] | FLOAT}
           | IS {FIXED [DP n] | FLOAT}
 
           [ARRAY (*[,*[,*]])]]
           [ARRAY (*[,*[,*]])]]
 
  LIST listname [IN [FILE | [PERM | TEMP] GROUP] name]
  LIST listname [IN [FILE | [PERM | TEMP] GROUP] name]
</p>
</p>
 
</div>
<b>____________________________________________________</b>
 
<hr>
<p class="code">
<p class="code">
TAG %screenname:inputname <var>[</var>attributes<var>]</var> <var>[</var>WITH 'c'<var>]</var>
TAG %screenname:inputname <var>[</var>attributes<var>]</var> <var>[</var>WITH 'c'<var>]</var>
</p>  
</p>
 
<b>____________________________________________________</b>
<hr>
 
<p class="code">
<p class="code">
<b>+</b>  TEST [FOR]
<b>+</b>  TEST [FOR]
 
  {ANY RECEIPT RETURN %variable
  {ANY RECEIPT RETURN %variable
 
  | RECEIPT {cid | processname | %variable}}  
  | RECEIPT {cid | processname | %variable}}
</p>
</p>
<b>____________________________________________________</b>
<hr>
 
<p class="code">
<p class="code">
TITLE {'text' | promptname}
TITLE {'text' | promptname}
 
  [AT [COLUMN] n] [TO [COLUMN] m | [LEN m]  
  [AT [COLUMN] n] [TO [COLUMN] m | [LEN m]
 
  [DP {k | *}]]
  [DP {k | *}]]
 
  [DEFAULT 'value']
  [DEFAULT 'value']
<nowiki>
<nowiki>
  [[READ] attributes] [REREAD attributes]
  [[READ] attributes] [REREAD attributes]
</nowiki>
</nowiki>
  [PRINT attributes]
  [PRINT attributes]
</p>  
</p>
 
<b>____________________________________________________</b>
<hr>
 
<p class="code">
<p class="code">
TRANSFER [CONTROL] TO PROCESS {processname  
TRANSFER [CONTROL] TO PROCESS {processname
 
  | %variable}
  | %variable}
 
  [WITH] [USERID {%variable | 'string'}]
  [WITH] [USERID {%variable | 'string'}]
 
  [PASSWORD {variable | 'string'}]
  [PASSWORD {variable | 'string'}]
 
  [ACCOUNT {%variable | 'string'}]
  [ACCOUNT {%variable | 'string'}]
 
  [PASSING {IMAGE imagename | 'string' | %variable}]
  [PASSING {IMAGE imagename | 'string' | %variable}]
</p>
</p>
<b>____________________________________________________</b>
<hr>
 
<p class="code">
<p class="code">
UPDATE RECORD</p>
UPDATE RECORD</p>
 
<b>____________________________________________________</b>
<hr>
 
<p class="code">
<p class="code">
VARIABLES ARE   
VARIABLES ARE
 
   
  {FIXED [DP n] | FLOAT
  {FIXED [DP n] | FLOAT
 
  | STRING [LEN n] [DP {n | *}]
  | STRING [LEN n] [DP {n | *}]
 
  | UNDEFINED}  
  | UNDEFINED}
 
</p>
</p>
<b>____________________________________________________</b>
<hr>
 
<p class="code">
<p class="code">
[DECLARE] %variable [IS]
[DECLARE] %variable [IS]
 
  {FIXED [DP n] | FLOAT} [ARRAY (d1[,d2[,d3]])]  
  {FIXED [DP n] | FLOAT} [ARRAY (d1[,d2[,d3]])]
 
  [COMMON]
  [COMMON]
 
</p>
</p>
<b>____________________________________________________</b>
<hr>
 
<p class="code">
<p class="code">
[DECLARE] %variable [IS]
[DECLARE] %variable [IS]
Line 1,197: Line 1,245:
  STRING [LEN n] [DP {n | *}] [ARRAY (d1[,d2[d3]])]
  STRING [LEN n] [DP {n | *}] [ARRAY (d1[,d2[d3]])]
</nowiki>
</nowiki>
  [NO FIELD SAVE] [COMMON]      
  [NO FIELD SAVE] [COMMON]
 
  %variable [(subscript)] = expression
  %variable [(subscript)] = expression
</p>
</p>
<b>____________________________________________________</b>
<hr>
 
<p class="code">
<p class="code">
<b>+</b>  WAIT [{n | %variable} SEC[S]] [FOR]
<b>+</b>  WAIT [{n | %variable} SEC[S]] [FOR]
 
  {ANY RECEIPT RETURN %variable
  {ANY RECEIPT RETURN %variable
 
  | RECEIPT {cid | processname | %variable}}
  | RECEIPT {cid | processname | %variable}}
</p>
</p>
 
<b>____________________________________________________</b>
<hr>
 
<p class="code">
<p class="code">
WRITE [IMAGE] imagename
WRITE [IMAGE] imagename
 
  ON {seq-filename | TERMINAL | %variable}  
  ON {seq-filename | TERMINAL | %variable}
</p>
</p>
<b>____________________________________________________</b>
<hr>
 
<p class="code">
<p class="code">
WRITE IMAGE imagename ON BUFFER
WRITE IMAGE imagename ON BUFFER
 
   [POSITION=%pvariable | n] [MAXLEN={%lvariable | n}]  
   [POSITION=%pvariable | n] [MAXLEN={%lvariable | n}]
</p>
</p>
<b>____________________________________________________</b>
<hr>
 
===Value specification syntax===
==Value specification syntax==
<p>For all User Language statements and retrieval conditions, wherever the term value appears in the syntax, it can be:</p>
<p>
For all User Language statements and retrieval conditions, wherever the term value appears in the syntax, it can be:</p>
<ul>
<ul>
<li>Literal number or string </li>
<li>Literal number or string </li>
Line 1,238: Line 1,287:
<li>%variable</li>
<li>%variable</li>
</ul>
</ul>
===Retrieval condition syntax===
<p>A FIND statement can be followed by any number of retrieval conditions separated by an end of line or LINEND parameter character.</p>
==Retrieval condition syntax==
<p>Conditions can be constructed as follows:      </p>
<p>
<b>Syntax</b>
A FIND statement can be followed by any number of retrieval conditions separated by an end of line or LINEND parameter character.</p>
<p>
Conditions can be constructed as follows:      </p>
====Syntax====
<p class="code">[NOT] phrase [{AND | OR | NOR} [NOT] phrase] ...
<p class="code">[NOT] phrase [{AND | OR | NOR} [NOT] phrase] ...
</p>
</p>
<b>Where</b>
Where:
<p>phrase can be constructed as follows:</p>
<p>
phrase can be constructed as follows:</p>
<p class="code">fieldname = <var>[</var>NOT<var>]</var> value
<p class="code">fieldname = <var>[</var>NOT<var>]</var> value
 
fieldname LIKE pattern
fieldname LIKE pattern
 
fieldname IS [NOT] {PRESENT | LIKE 'pattern'}
fieldname IS [NOT] {PRESENT | LIKE 'pattern'}
 
fieldname IS [NOT]
fieldname IS [NOT]
 
  {[NUMERICALLY | ALPHABETICALLY]
  {[NUMERICALLY | ALPHABETICALLY]
 
  [EQ | = | NE | ¬= | GREATER THAN | GT | >
  [EQ | = | NE | ,= | GREATER THAN | GT | >
 
  | LESS THAN | LT < | <= | GE | >= | BEFORE | AFTER]
  | LESS THAN | LT < | <= | GE | >= | BEFORE | AFTER]
 
  value}
  value}
 
fieldname IS [NOT]
fieldname IS [NOT]
 
  {[NUMERICALLY | ALPHABETICALLY]
  {[NUMERICALLY | ALPHABETICALLY]
 
  {IN RANGE [FROM | AFTER] value1 {TO | [AND] BEFORE}
  {IN RANGE [FROM | AFTER] value1 {TO | [AND] BEFORE}
 
  value2 | BETWEEN value1 AND value2}
  value2 | BETWEEN value1 AND value2}
 
FILES filename
FILES filename
 
FIND$ label
FIND$ label
 
LISTS$ listname
LISTS$ listname
 
LOCATION {location | =}
LOCATION {location | =}
 
POINT$ value
POINT$ value
SFGE$ value
SFGE$ value
SFL$ value
SFL$ value
</p>
</p>
<p>where value can be:</p>
<p>
<p>Literal number or string</p>
where value can be:</p>
<p>VALUE {[IN] label} | (expression)</p>
<p>
<p>%variable</p>
Literal number or string</p>
<p>
VALUE {[IN] label} | (expression)</p>
<p>
%variable</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>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 <code>[IS] LIKE</code> and <code>IS NOT</code> clauses, see the syntax of [[Is Like pattern matching#likeSyntax|Is Like patterns]].
</ul>
</ul>
</blockquote>
</blockquote>
 
====Omitting repeated first words====
===Omitting repeated first words===
<p>Moreover, 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>
<p class="code">LIST$ A AND NOT LIST$ B  
Moreover, 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>
</p>
<p>can be written:</p>
<p>
<p class="code">LIST$ A AND NOT B  
can be written:</p>
<p class="code">LIST$ A AND NOT B
</p>
</p>
<p>And:</p>
<p>
<p class="code">X IS 13 OR X IS LESS THAN 7  
And:</p>
<p class="code">X IS 13 OR X IS LESS THAN 7
</p>
</p>
<p>can be written:</p>
<p>
<p class="code">X IS 13 OR IS LESS THAN 7  
can be written:</p>
<p class="code">X IS 13 OR IS LESS THAN 7
</p>
</p>
 
====Omitting duplicated equal signs====
===Omitting duplicated equal signs===
<p>Duplicated equal signs can be omitted. For example, the expression:</p>
<p>
<p class="code">A = 3 OR A = 5 OR A = 40  
Duplicated equal signs can be omitted. For example, the expression:</p>
<p class="code">A = 3 OR A = 5 OR A = 40
</p>
</p>
<p>is equivalent to:</p>
<p>
<p class="code">A = 3 OR 5 OR 40  
is equivalent to:</p>
<p class="code">A = 3 OR 5 OR 40
</p>
</p>
 
====Use of parentheses====
===Use of parentheses===
<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>
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>Expressions can be used in FIND statements to provide the retrieval condition for the POINT$, SFL$, and SFGE$ conditions, as well as for the EQ VALUE clause.</p>
<p>
<b>POINT$</b>
Expressions can be used in FIND statements to provide the retrieval condition for the POINT$, SFL$, and SFGE$ conditions, as well as for the EQ VALUE clause.</p>
<b>Syntax</b>
====POINT$====
=====Syntax=====
<p class="code">POINT$ VALUE(expression)
<p class="code">POINT$ VALUE(expression)
</p>
</p>
<b>Where</b>
Where:
<p>expression is a function call, string concatenation, arithmetic operation, User Language construct, or Boolean expression. It is preceded by the keyword VALUE.</p>
<p>
<b>Example</b>
expression is a function call, string concatenation, arithmetic operation, User Language construct, or Boolean expression. It is preceded by the keyword VALUE.</p>
<p>This example finds the first MA record on file, and then counts the number of records from this point in the file:</p>
=====Example=====
<p>
This example finds the first MA record on file, and then counts the number of records from this point in the file:</p>
<p class="code">FD1:
<p class="code">FD1:
 
IN ICSCUST FPC STATE = MA
IN ICSCUST FPC STATE = MA
     END FIND
     END FIND
Line 1,343: Line 1,414:
END FOR
END FOR
</p>
</p>
<b>SFL$ and SFGE$</b>
<b>Syntax</b>
====SFL$ and SFGE$====
=====Syntax=====
<p class="code">SFL$ VALUE(expression)
<p class="code">SFL$ VALUE(expression)
</p>
</p>
<p>or</p>
<p>
or</p>
<p class="code">SFGE$ VALUE(expression)
<p class="code">SFGE$ VALUE(expression)
</p>
</p>
<b>Where</b>
Where:
<p>expression is a function call, string concatenation, arithmetic operation, User Language construct, or Boolean expression. It is preceded by the keyword VALUE.</p>
<p>
<b>Example</b>
expression is a function call, string concatenation, arithmetic operation, User Language construct, or Boolean expression. It is preceded by the keyword VALUE.</p>
=====Example=====
<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,372: Line 1,448:
END FOR
END FOR
</p>
</p>
<b>EQ VALUE</b>
<b>Syntax</b>
====EQ VALUE====
=====Syntax=====
<p class="code">fieldname EQ VALUE(expression)
<p class="code">fieldname EQ VALUE(expression)
</p>
</p>
<b>Where</b>
Where:
<p>expression is a function call, string concatenation, arithmetic operation, User Language construct, or Boolean expression.</p>
<p>
<b>Example</b>
expression is a function call, string concatenation, arithmetic operation, User Language construct, or Boolean expression.</p>
=====Example=====
<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?') )
END FIND
END FIND
</p>
</p>
<p>&nbsp;</p>
<p>
 
&nbsp;</p>
===Print specification syntax===
<p>A  PRINT, SET or AUDIT statement contains print specifications of the following form:</p>
==Print specification syntax==
<b>Syntax</b>
<p>
A  PRINT, SET or AUDIT statement contains print specifications of the following form:</p>
====Syntax====
<p class="code">[term] {AND | TAB | WITH]...[[term]
<p class="code">[term] {AND | TAB | WITH]...[[term]
 
  [AND | TAB | WITH] ...] ... [...]
  [AND | TAB | WITH] ...] ... [...]
</p>
</p>
<b>Where</b>
Where:
<p>term can be constructed as follows:</p>
<p>
term can be constructed as follows:</p>
<p class="code">{'string' | %variable | COUNT IN label
<p class="code">{'string' | %variable | COUNT IN label
 
  | OCCURRENCE IN label
  | OCCURRENCE IN label
 
  | VALUE IN label | function}
  | VALUE IN label | function}
 
  <var>[</var>AT <var>[</var>COLUMN<var>]</var> m<var>]</var> <var>[</var>TO <var>[</var>COLUMN<var>]</var> n<var>]</var>
  <var>[</var>AT <var>[</var>COLUMN<var>]</var> m<var>]</var> <var>[</var>TO <var>[</var>COLUMN<var>]</var> n<var>]</var>
</p>
</p>
<p>or, if the statement is within a record loop:</p>
<p>
or, if the statement is within a record loop:</p>
<p class="code">{{EACH | n} fieldname | *RECORD | *ID}
<p class="code">{{EACH | n} fieldname | *RECORD | *ID}
 
  [AT [COLUMN] m] [TO [COLUMN] n}
  [AT [COLUMN] m] [TO [COLUMN] n}
</p>
</p>
===Expression syntax===
<p>The following syntax can be used in: </p>
==Expression syntax==
<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 IF statements and ELSEIF clauses</li>
</ul>
</ul>
<p>In the simplified syntax for an IF statement, which is:</p>
<p>
In the simplified syntax for an IF statement, which is:</p>
<p class="code">IF condition THEN statements
<p class="code">IF condition THEN statements
</p>
</p>
<p>condition expands to the syntax described in this section. Be sure to enclose an expression with parentheses. </p>
<p>
condition expands to the syntax described in this section. Be sure to enclose an expression with parentheses. </p>
<ul>
<ul>
<li>Computed JUMP TO statements </li>
<li>Computed JUMP TO statements </li>
Line 1,422: Line 1,511:
<li>Function arguments      </li>
<li>Function arguments      </li>
</ul>
</ul>
<b>Syntax</b>
<p class="code">{operand |(expression)}  
====Syntax====
 
<p class="code">{operand |(expression)}
[operator {operand | (expression)}] ...
[operator {operand | (expression)}] ...
</p>
</p>
<b>Where</b>
Where:
<p>operand can be constructed as follows:</p>
<p>
operand can be constructed as follows:</p>
<p class="code">[+ | - | NOT]
<p class="code">[+ | - | NOT]
 
  {'string' | %variable | number
  {'string' | %variable | number
 
  | fieldname <var>[</var>(subscript)<var>]</var> IS <var>[</var>NOT<var>]</var> PRESENT
  | fieldname <var>[</var>(subscript)<var>]</var> IS <var>[</var>NOT<var>]</var> PRESENT
 
  | COUNT IN label | OCCURRENCE IN label  
  | COUNT IN label | OCCURRENCE IN label
 
  | VALUE IN label
  | VALUE IN label
 
  | function}
  | function}
</p>
</p>
<p>and operator may be one of the following:</p>
<p>
and operator may be one of the following:</p>
<table>
<table>
<tr>
<tr>
Line 1,451: Line 1,543:
<tr>
<tr>
<td align="right">-</td>
<td align="right">-</td>
<td>¬=</td>
<td>,=</td>
<td>NE</td>
<td>NE</td>
<td>OR</td>
<td>OR</td>
Line 1,486: Line 1,578:
</tr>
</tr>
</table>
</table>
<p></p>
<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>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]].
</ul>
</ul>
</blockquote >
</blockquote >
 
===IN clause syntax===
==IN clause syntax==
<p>Statements preceded by an asterisk (*), beginning with [[#User Language statements|User Language statements]], support the IN clause. </p>
<p>
<p>The three basic forms of the IN clause are:        </p>
Statements preceded by an asterisk (*), beginning with [[#User Language statements|User Language statements]], support the IN clause. </p>
<b>Syntax</b>
<p>
The three basic forms of the IN clause are:        </p>
====Syntax====
<ul>
<ul>
<li><var>IN [PERMANENT | TEMPORARY ] GROUP groupname  
<li><var>IN [PERMANENT | TEMPORARY ] GROUP groupname
MEMBER [%member | [filename [AT {location | =}]]</var></li>
MEMBER [%member | [filename [AT {location | =}]]</var></li>
</li>
</li>
Line 1,505: Line 1,601:
</li>
</li>
<li><var>IN {$CURFILE | $UPDATE}</var></li>
<li><var>IN {$CURFILE | $UPDATE}</var></li>
<p>The form IN $CURFILE can be used only within a record loop.    </p>
<p>
The form IN $CURFILE can be used only within a record loop.    </p>
</li>
</li>
</ul>
</ul>
====IN GROUP MEMBER limitations====
<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 GROUP MEMBER limitations===
<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>
<ul>
<ul>
<li>CLEAR LIST</li>
<li>CLEAR LIST</li>
Line 1,522: Line 1,621:
</li>
</li>
</ul>
</ul>
<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>
<p>
====Using an IN clause in a BEGIN...END block====
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>
<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>
===Subscript syntax===
===Using an IN clause in a BEGIN...END block===
<p>A subscript has the format:    </p>
<p>
<b>Syntax</b>
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>
==Subscript syntax==
<p>
A subscript has the format:    </p>
====Syntax====
<p class="code">(subscript1 <var>[</var>,subscript2 <var>[</var>,subscript3<var>]]</var> )
<p class="code">(subscript1 <var>[</var>,subscript2 <var>[</var>,subscript3<var>]]</var> )
</p>
</p>
<b>Where</b>
Where:
<p>subscript1, subscript2, and subscript3 can be any expression.    </p>
<p>
===Terminal display attributes===
subscript1, subscript2, and subscript3 can be any expression.    </p>
<p>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:</p>
====List of attributes====
==Terminal display attributes==
<p>
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:</p>
===List of attributes===
<table>
<table>
<tr>
<tr>
Line 1,594: Line 1,704:
</tr>
</tr>
</table>
</table>
===Type syntax for the DECLARE SUBROUTINE statement===
<p>The type specification for the DECLARE SUBROUTINE statement has one of the following formats:</p>
==Type syntax for the DECLARE SUBROUTINE statement==
<p>
The type specification for the DECLARE SUBROUTINE statement has one of the following formats:</p>
<p class="syntax">{STRING [LEN <span class="term">n</span>] [DP {<span class="term">n</span> | *}] [ARRAY (*[,*[,*]]) [NO FILE SAVE]]
<p class="syntax">{STRING [LEN <span class="term">n</span>] [DP {<span class="term">n</span> | *}] [ARRAY (*[,*[,*]]) [NO FILE SAVE]]
  | FIXED [DP <span class="term">n</span>] [ARRAY (*[,*[,*]])]
  | FIXED [DP <span class="term">n</span>] [ARRAY (*[,*[,*]])]
  | FLOAT}  
  | FLOAT}
</p>
</p>
<p>or</p>
<p>
or</p>
<p class="syntax">[LIST] [IN [FILE | [PERM | TEMP] GROUP] <span class="term">name</span>]
<p class="syntax">[LIST] [IN [FILE | [PERM | TEMP] GROUP] <span class="term">name</span>]
</p>
</p>
 
[[Category:SOUL]]
[[Category:SOUL]]

Revision as of 00:59, 4 January 2014

Overview

This topic summarizes User Language syntax and conventions, many of which are also discussed throughout this manual.

The statements are listed in alphabetical order. Later sections in this topic provide other User Language syntax information.

All of the User Language statements listed can be used between a BEGIN (or MORE) command and an END (or END MORE) statement.

All system control commands are presented in the List of Model 204 commands.

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 syntax applies to a Model 204 command as well as a User Language statement, except any %variable options or clauses.

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

Lower case 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 lower case constructs — retrieval-conditions, print-specifications, expression, subscript, attribute, and type — are discussed separately following the syntax summaries, beginning with Value specification syntax.

User Language statements

** ADD fieldname = {value | (expression)} ADD lob-name=BUFFER,position,length [RESERVE n [BYTES]]


ARRAY [arrayname] OCCURS {n | UNKNOWN} DEPENDING ON {itemname | %variable} [AFTER {itemname | arrayname} | AT {position | itemname | imagename1 | arrayname}]


AUDIT print-specifications


AUDIT ALL FIELDGROUP INFORMATION [CTOFIELDS]


AUDIT ALL INFORMATION AAI


C BACKOUT


BYPASS [PENDING STATEMENT]


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


** CHANGE fieldname [(subscript)] [= value1 |(expression)] TO (value2 | (expression)) CHANGE lob-fieldname,position1,length TO BUFFER,position2,length [RESERVE n [BYTES]]


CLEAR {[[ALL | TEMP | LISTFDST | POSITION] [GLOBAL]] OBJECTS | GLOBALS | GLOBAL {IMAGE | SCREEN | MENU | LIST | FOUNDSET | POSITION [PERM | TEMP]} {'objectname' | %variable}}


* CLEAR LIST listname


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


CLEAR TAG {screenname | %screenname:inputname}


CLOSE {DATASET {ext-filename | %variable} | [EXTERNAL] {ext-filename | TERMINAL | %variable}}


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


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


COMMIT [RELEASE]


+ CONFIRM {cid | processname | %variable} REQSEND %variable


+ CONFIRMED {cid | processname | %variable}


CONTINUE


** COUNT OCCURRENCES OF fieldname


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


[DECLARE] declaration

where declaration is one of the following:

LABEL labelname [GLOBAL | COMMON] LIST listname [IN [FILE | [PERM | TEMP] GROUP]] name] [GLOBAL | COMMON] IMAGE imagename [AT {itemname | imagename1 | arrayname} | GLOBAL [PERMANENT | TEMPORARY] | [PERMANENT | TEMPORARY] GLOBAL | COMMON] MENU menuname [GLOBAL [PERMANENT | TEMPORARY] | [PERMANENT | TEMPORARY] GLOBAL | COMMON] SCREEN screenname [GLOBAL [PERMANENT | TEMPORARY] | [PERMANENT | TEMPORARY] GLOBAL | 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 [READ | REREAD | PRINT] {ITEMID n | itemname | ROW n COLUMN m}


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 fieldname [(subscript)] [= value |(expression)]


** DELETE EACH fieldname


** DELETE RECORD


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


END BLOCK label


END {FIND | IF | FOR | ON | REPEAT | STORE | SUBROUTINE} [label]


END {ARRAY | IMAGE | MENU | SCREEN}


END [MORE | NORUN | USE]...


END UPDATE


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


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


* FIND [ALL] VALUES OF fieldname [FROM {value1|(expression1)}] [TO {value2|(expression2)}] [[NOT] LIKE 'pattern']


* FIND AND PRINT COUNT [retrieval-conditions]


* {FIND WITHOUT LOCKS | FDWOL} [ALL] RECORDS [IN label | ON [LIST] listname] [FOR WHICH | WITH] retrieval-conditions


FLUSH PROCESS {cid | processname | %variable}


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


* FOR {EACH | k} {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]


* 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 | k} {VALUE | VALUES} IN label


* FOR RECORD NUMBER {value | (expression)}


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


FOR %variable FROM expression1 {TO expression2 [BY expression3] | [BY expression3] TO expression2}

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


IDENTIFY {[IMAGE] imagename | %imagename:itemname LEN {n | %variable} | %imagename:arrayname OCCURS {n | %variable}}


C IF expression THEN statements [ELSE statements | ELSEIF expression THEN statements]


[DECLARE] IMAGE imagename [GLOBAL [PERMANENT | TEMPORARY] | [PERMANENT | TEMPORARY] GLOBAL | COMMON [AT [itemname | imagename1 |arrayname}]]


* INCLUDE procedurename


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 fieldname [(subscript)] = {value | (expression)}


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


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 label


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


LOOP END


MAX PFKEY n


[DECLARE] MENU menuname [GLOBAL [PERMANENT | TEMPORARY] | [PERMANENT | TEMPORARY] GLOBAL | COMMON]


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


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


C NEW PAGE


** NOTE {fieldname [(subscript)]}


NOTE 'string'


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


OPEN {[DATASET | EXTERNAL] {ext-filename | %variable} | [EXTERNAL] {TERMINAL | %variable}} FOR {INPUT [OUTPUT] | OUTPUT [INPUT] | INOUT} [PASSWORD {value | %variable}]


C OPEN [C] [[PERM | TEMP] GROUP | FILE] {name [AT {location | %variable | =}] |%variable} [PASSWORD {value | %variable}]


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 [n | %variable]


** PLACE RECORD ON [LIST] listname


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


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

Note: Use this form of the POSITION statement with FOR loop processing; see POSITION statement.


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

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


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


PRINT print specifications


** {PAI | PRINT ALL INFORMATION} INTO array1, array2 [,array3] [FROM start] [COUNT ct]


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


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


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


+ 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] 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 [MENU] menuname [ALERT] [TITLE ['text' | %variable} [AT [COLUMN] n] [TO [COLUMN] m | LEN m] [attributes]]


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


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


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


RELEASE ALL RECORDS


RELEASE POSITION {ext-filename | %variable}


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


** REMEMBER [GLOBAL] position_name [IN foundsortset_name | ON list_name]


** REMOVE RECORD FROM [LIST] listname


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


REPEAT [FOREVER | n TIMES | WHILE expression]

___________________________________________________

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


RESET {HEADER | TRAILER} m


RETRY [PENDING STATEMENT]


RETURN


[DECLARE] SCREEN screenname [GLOBAL [PERMANENT | TEMPORARY] | [PERMANENT | TEMPORARY] GLOBAL | COMMON]


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 TO {cid | processname | %variable} REQSEND %variable


SET {HEADER | TRAILER} m print-specifications


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

_______________________________________________________________

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


SKIP n LINE[S]


[itemname IS] SKIP n POSITION[S] [INITIAL {NULL | character | BLANK}]


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 [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 label [IN [ASCENDING | DESCENDING] [CHARACTER | NUMERICAL] | [RIGHT-ADJUSTED] ORDER]


STOP [IF COUNT IN label EXCEEDS n]


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


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 %screenname:inputname [attributes] [WITH 'c']


+ TEST [FOR] {ANY RECEIPT RETURN %variable | RECEIPT {cid | processname | %variable}}


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


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


UPDATE RECORD


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


[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 [{n | %variable} SEC[S]] [FOR] {ANY RECEIPT RETURN %variable | RECEIPT {cid | processname | %variable}}


WRITE [IMAGE] imagename ON {seq-filename | TERMINAL | %variable}


WRITE IMAGE imagename ON BUFFER [POSITION=%pvariable | n] [MAXLEN={%lvariable | n}]


Value specification syntax

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

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

VALUE [IN] label

  • %variable

Retrieval condition syntax

A FIND 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 follows:

Syntax

[NOT] phrase [{AND | OR | NOR} [NOT] phrase] ...

Where:

phrase can be constructed as follows:

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 < | <= | GE | >= | BEFORE | AFTER] value} fieldname IS [NOT] {[NUMERICALLY | ALPHABETICALLY] {IN RANGE [FROM | AFTER] value1 {TO | [AND] BEFORE} value2 | BETWEEN value1 AND value2} FILES filename FIND$ label LISTS$ listname LOCATION {location | =} POINT$ value SFGE$ value SFL$ value

where value can be:

Literal number or string

VALUE {[IN] label} | (expression)

%variable

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 pattern in the [IS] LIKE and IS NOT clauses, see the syntax of Is Like patterns.

Omitting repeated first words

Moreover, 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 statements to provide the retrieval condition for the POINT$, SFL$, and SFGE$ conditions, as well as for the EQ VALUE clause.

POINT$

Syntax

POINT$ VALUE(expression)

Where:

expression is a function call, string concatenation, arithmetic operation, User Language 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$

Syntax

SFL$ VALUE(expression)

or

SFGE$ VALUE(expression)

Where:

expression is a function call, string concatenation, arithmetic operation, User Language 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

Syntax

fieldname EQ VALUE(expression)

Where:

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

Example

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

 

Print specification syntax

A PRINT, SET or AUDIT statement contains print specifications of the following form:

Syntax

[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 label | function} [AT [COLUMN] m] [TO [COLUMN] n]

or, if the statement is within a record loop:

{{EACH | n} fieldname | *RECORD | *ID} [AT [COLUMN] m] [TO [COLUMN] n}

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. Be sure to enclose an expression with parentheses.

  • Computed JUMP TO statements
  • Subscripts
  • Function arguments

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}

and operator may be one of the following:

+ = EQ AND
- ,= NE OR
* > GT WITH
/ < LT IS PRESENT
  >= GE IS NOT PRESENT
  <= LE IS LIKE
      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.

IN clause syntax

Statements preceded by an asterisk (*), beginning with User Language statements, support the IN clause.

The three basic forms of the IN clause are:

Syntax

  • 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 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.

Subscript syntax

A subscript has the format:

Syntax

(subscript1 [,subscript2 [,subscript3]] )

Where:

subscript1, subscript2, and subscript3 can be any expression.

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

Type syntax for the DECLARE SUBROUTINE statement

The type specification for the DECLARE SUBROUTINE statement has one of the following formats:

{STRING [LEN n] [DP {n | *}] [ARRAY (*[,*[,*]]) [NO FILE SAVE]] | FIXED [DP n] [ARRAY (*[,*[,*]])] | FLOAT}

or

[LIST] [IN [FILE | [PERM | TEMP] GROUP] name]