Statement syntax: Difference between revisions

From m204wiki
Jump to navigation Jump to search
mNo edit summary
m (more conversion cleanup)
Line 1: Line 1:
==Overview==
==Overview==
<p>
<p>
Line 14: Line 13:
<p>
<p>
This page uses the following syntax notation conventions: </p>
This page uses the following syntax notation conventions: </p>
 
<table>
<table>
<tr class="head">
<tr class="head">
Line 20: Line 19:
<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 nowrap>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>
Line 47: Line 46:
<var class="product">Model&nbsp;204</var> commands are listed alphabetically and documented in [[List of Model 204 commands]]. </p></td>
<var class="product">Model&nbsp;204</var> commands are listed alphabetically and documented in [[List of Model 204 commands]]. </p></td>
</tr>
</tr>
 
<tr>
<tr>
<td>Lower case italic </td>
<td>Lower case italic </td>
Line 53: Line 52:
</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>A field name (%%) variable can be used anywhere fieldname appears. The %%variable can contain its own subscript, separate from the field name subscript.
Line 64: Line 63:
==User Language statements==
==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]]
Line 72: Line 70:
<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}
Line 84: Line 81:
<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
Line 102: Line 96:
<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] [,...])]}
Line 120: Line 111:
<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]]
Line 128: Line 118:
<hr>
<hr>
   
   
<p class="code">
<p class="code">CLEAR
CLEAR
<nowiki>
<nowiki>
  {[[ALL | TEMP | LISTFDST | POSITION] [GLOBAL]]
  {[[ALL | TEMP | LISTFDST | POSITION] [GLOBAL]]
Line 146: Line 135:
<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
Line 167: Line 154:
<hr>
<hr>
   
   
<p class="code">
<p class="code">CLOSE
CLOSE
   
   
  {DATASET {ext-filename | %variable}
  {DATASET {ext-filename | %variable}
Line 177: Line 163:
<hr>
<hr>
   
   
<p class="code">
<p class="code"><b>+ C</b>  CLOSE PROCESS
<b>+ C</b>  CLOSE PROCESS
   
   
  {cid | processname | %variable}
  {cid | processname | %variable}
Line 187: Line 172:
<hr>
<hr>
   
   
<p class="code">
<p class="code">CLOSE PROCESS
CLOSE PROCESS
   
   
  {cid | processname | %variable}
  {cid | processname | %variable}
Line 197: Line 181:
<hr>
<hr>
   
   
<p class="code">
<p class="code">COMMIT <var>[</var>RELEASE<var>]</var></p>
COMMIT <var>[</var>RELEASE<var>]</var></p>
   
   
<hr>
<hr>
   
   
<p class="code">
<p class="code"><b>+</b>  CONFIRM {cid | processname | %variable}
<b>+</b>  CONFIRM {cid | processname | %variable}
   
   
         REQSEND %variable
         REQSEND %variable
Line 209: Line 191:
<hr>
<hr>
   
   
<p class="code">
<p class="code"><b>+</b>  CONFIRMED {cid | processname | %variable}
<b>+</b>  CONFIRMED {cid | processname | %variable}
</p>
</p>
   
   
<hr>
<hr>
   
   
<p class="code">
<p class="code">CONTINUE</p>
CONTINUE</p>
   
   
<hr>
<hr>
   
   
<p class="code">
<p class="code"><b>**</b>  COUNT OCCURRENCES OF fieldname</p>
<b>**</b>  COUNT OCCURRENCES OF fieldname</p>
   
   
<hr>
<hr>
   
   
<p class="code">
<p class="code">COUNT RECORDS {IN label | ON [LIST] listname}</p>
COUNT RECORDS {IN label | ON [LIST] listname}</p>
   
   
<hr>
<hr>
   
   
<p class="code">
<p class="code"><var>[</var>DECLARE<var>]</var> declaration
<var>[</var>DECLARE<var>]</var> declaration
</p>
</p>
 
<div style="margin-left: 20px">
<div style="margin-left: 20px">
<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>
 
<p class="code">
<p class="code">LABEL labelname [GLOBAL | COMMON]
LABEL labelname [GLOBAL | COMMON]
   
   
  LIST listname [IN [FILE | [PERM | TEMP]
  LIST listname [IN [FILE | [PERM | TEMP]
Line 295: Line 271:
<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 (* [,*[,*]])
Line 310: Line 285:
</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 317: Line 292:
</ul>
</ul>
</div> <!-- type indentation -->
</div> <!-- type indentation -->
 
<hr>
<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>
<hr>
<hr>
<p class="code">
<p class="code">DEFAULT {TITLE
DEFAULT {TITLE
   
   
         | PROMPT
         | PROMPT
Line 344: Line 317:
</p>
</p>
<hr>
<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}]
Line 351: Line 323:
<hr>
<hr>
   
   
<p class="code">
<p class="code">DEFAULT [TYPE]
DEFAULT [TYPE]
   
   
  {STRING | BINARY | PACKED | ZONED | FLOAT | EFORMAT}
  {STRING | BINARY | PACKED | ZONED | FLOAT | EFORMAT}
Line 368: Line 339:
<hr>
<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>
<hr>
<hr>
   
   
<p class="code">
<p class="code"><b>**</b>  DELETE EACH fieldname</p>
<b>**</b>  DELETE EACH fieldname</p>
   
   
<hr>
<hr>
   
   
<p class="code">
<p class="code"><b>**</b>  DELETE RECORD </p>
<b>**</b>  DELETE RECORD </p>
   
   
<hr>
<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>
   
   
<hr>
<hr>
   
   
<p class="code">
<p class="code">END BLOCK label </p>
END BLOCK label </p>
   
   
<hr>
<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]
Line 401: Line 366:
<hr>
<hr>
   
   
<p class="code">
<p class="code">END {ARRAY | IMAGE | MENU | SCREEN}</p>
END {ARRAY | IMAGE | MENU | SCREEN}</p>
   
   
<hr>
<hr>
   
   
<p class="code">
<p class="code">END [MORE | NORUN | USE]...</p>
END [MORE | NORUN | USE]...</p>
   
   
<hr>
<hr>
   
   
<p class="code">
<p class="code">END UPDATE</p>
END UPDATE</p>
   
   
<hr>
<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)}
Line 423: Line 384:
<hr>
<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]
Line 432: Line 392:
<hr>
<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>
Line 441: Line 400:
<hr>
<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>
<hr>
<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]
Line 455: Line 412:
<hr>
<hr>
   
   
<p class="code">
<p class="code">FLUSH PROCESS {cid | processname | %variable}</p>
FLUSH PROCESS {cid | processname | %variable}</p>
   
   
<hr>
<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>
<hr>
<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]
Line 482: Line 436:
<hr>
<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)}]
Line 494: Line 447:
<hr>
<hr>
   
   
<p class="code">
<p class="code">FOR {EACH | k} {VALUE | VALUES} IN label </p>
FOR {EACH | k} {VALUE | VALUES} IN label </p>
   
   
<hr>
<hr>
   
   
<p class="code">
<p class="code"><b>*</b>  FOR RECORD NUMBER {value | (expression)}
<b>*</b>  FOR RECORD NUMBER {value | (expression)}
</p>
</p>
<hr>
<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>
<hr>
<hr>
   
   
<p class="code">
<p class="code">FOR %variable FROM expression1
FOR %variable FROM expression1
   
   
  {TO expression2 [BY expression3]
  {TO expression2 [BY expression3]
Line 520: Line 469:
<hr>
<hr>
   
   
<p class="code">
<p class="code">IDENTIFY
IDENTIFY
   
   
  {[IMAGE] imagename
  {[IMAGE] imagename
Line 532: Line 480:
<hr>
<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]
Line 540: Line 487:
<hr>
<hr>
   
   
<p class="code">
<p class="code">[DECLARE] IMAGE imagename
[DECLARE] IMAGE imagename
   
   
  [GLOBAL [PERMANENT | TEMPORARY]
  [GLOBAL [PERMANENT | TEMPORARY]
Line 552: Line 498:
<hr>
<hr>
   
   
<p class="code">
<p class="code"><b>*</b>  INCLUDE procedurename  </p>
<b>*</b>  INCLUDE procedurename  </p>
   
   
<hr>
<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 | *}]]
Line 582: Line 526:
<hr>
<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>
<hr>
<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>
Line 594: Line 536:
<hr>
<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}
Line 623: Line 564:
<hr>
<hr>
   
   
<p class="code">
<p class="code">JUMP TO label
JUMP TO label
</p>
</p>
   
   
<hr>
<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>
   
   
<hr>
<hr>
   
   
<p class="code">
<p class="code">LOOP END </p>
LOOP END </p>
   
   
<hr>
<hr>
   
   
<p class="code">
<p class="code">MAX PFKEY n </p>
MAX PFKEY n </p>
   
   
<hr>
<hr>
   
   
<p class="code">
<p class="code">[DECLARE] MENU menuname
[DECLARE] MENU menuname
   
   
  [GLOBAL [PERMANENT | TEMPORARY]
  [GLOBAL [PERMANENT | TEMPORARY]
Line 656: Line 592:
<hr>
<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
Line 665: Line 600:
<hr>
<hr>
   
   
<p class="code">
<p class="code">MODIFY BUFFER [SIZE=n
MODIFY BUFFER [SIZE=n
   
   
   | %variable [PRESERVE | NOPRESERVE]]
   | %variable [PRESERVE | NOPRESERVE]]
Line 675: Line 609:
<hr>
<hr>
   
   
<p class="code">
<p class="code"><b>C</b>  NEW PAGE  </p>
<b>C</b>  NEW PAGE  </p>
   
   
<hr>
<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>
<hr>
<hr>
   
   
<p class="code">
<p class="code">NOTE 'string' </p>
NOTE 'string' </p>
   
   
<hr>
<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
Line 699: Line 629:
<hr>
<hr>
   
   
<p class="code">
<p class="code">OPEN {[DATASET | EXTERNAL] {ext-filename
OPEN {[DATASET | EXTERNAL] {ext-filename
   
   
     | %variable}
     | %variable}
Line 712: Line 641:
<hr>
<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}
Line 721: Line 649:
<hr>
<hr>
   
   
<p class="code">
<p class="code">OPEN PROCESS {processname | %variable}
OPEN PROCESS {processname | %variable}
   
   
  [CID {name | %variable}]
  [CID {name | %variable}]
Line 728: Line 655:
<hr>
<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}]
Line 735: Line 661:
  {outbound options | inbound options}
  {outbound options | inbound options}
</p>
</p>
 
<div style="margin-left: 20px">
<div style="margin-left: 20px">
<p>
<p>
where <var class="term">outbound</var> options are:</p>
where <var class="term">outbound</var> options are:</p>
<p class="code">
<p class="code">[AT DESTINATION] [WITH] [USERID {%variable
[AT DESTINATION] [WITH] [USERID {%variable
   
   
  | 'string'}]
  | 'string'}]
Line 752: Line 677:
  | IMAGE imagename] ...]
  | IMAGE imagename] ...]
</p>
</p>
 
<p>
<p>
and <var class="term">inbound</var> options are:</p>
and <var class="term">inbound</var> options are:</p>
<p class="code">
<p class="code">ACCEPT [INITIAL {DATA %variable | IMAGE image} ...]
ACCEPT [INITIAL {DATA %variable | IMAGE image} ...]
</p>
</p>
</div> <!-- end indent of options -->
</div> <!-- end indent of options -->
 
<hr>
<hr>
   
   
Line 766: Line 690:
<hr>
<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>
<hr>
<hr>
Line 777: Line 700:
<hr>
<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
Line 785: Line 707:
<hr>
<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}
Line 793: Line 714:
<hr>
<hr>
   
   
<p class="code">
<p class="code">PREPARE
PREPARE
   
   
  {[IMAGE] imagename | [MENU] menuname
  {[IMAGE] imagename | [MENU] menuname
Line 806: Line 726:
<hr>
<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]
Line 813: Line 732:
<hr>
<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]
Line 822: Line 740:
<hr>
<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]
Line 831: Line 748:
<hr>
<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']
Line 842: Line 758:
<hr>
<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>
 
<div style="margin-left: 20px">
<div style="margin-left: 20px">
<p>
<p>
where options must be one or more of the following:</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
   
   
Line 863: Line 777:
<hr>
<hr>
   
   
<p class="code">
<p class="code">READ [IMAGE] imagename
READ [IMAGE] imagename
   
   
  FROM {ext-filename | TERMINAL | %variable}
  FROM {ext-filename | TERMINAL | %variable}
Line 875: Line 788:
<hr>
<hr>
   
   
<p class="code">
<p class="code">READ [IMAGE] imagename FROM BUFFER
READ [IMAGE] imagename FROM BUFFER
   
   
   [POSITION={%pvariable | n}]
   [POSITION={%pvariable | n}]
Line 885: Line 797:
<hr>
<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]
Line 894: Line 805:
<hr>
<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>
Line 905: Line 815:
<hr>
<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]
Line 912: Line 821:
<hr>
<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}
Line 921: Line 829:
<hr>
<hr>
   
   
<p class="code">
<p class="code">RELEASE ALL RECORDS</p>
RELEASE ALL RECORDS</p>
   
   
<hr>
<hr>
   
   
<p class="code">
<p class="code">RELEASE POSITION {ext-filename | %variable}
RELEASE POSITION {ext-filename | %variable}
</p>
</p>
   
   
<hr>
<hr>
   
   
<p class="code">
<p class="code">RELEASE RECORDS {IN label | ON [LIST] listname}
RELEASE RECORDS {IN label | ON [LIST] listname}
</p>
</p>
   
   
<hr>
<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]
Line 945: Line 849:
<hr>
<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>
<hr>
<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
Line 957: Line 859:
<hr>
<hr>
   
   
<p class="code">
<p class="code">REPEAT [FOREVER | n TIMES | WHILE expression]
REPEAT [FOREVER | n TIMES | WHILE expression]
</p>
</p>
   
   
<b>___________________________________________________</b>
<hr>
   
   
<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]
Line 972: Line 872:
<hr>
<hr>
   
   
<p class="code">
<p class="code">RESET {HEADER | TRAILER} m
RESET {HEADER | TRAILER} m
</p>
</p>
<hr>
<hr>
   
   
<p class="code">
<p class="code">RETRY <var>[</var>PENDING STATEMENT<var>]</var>
RETRY <var>[</var>PENDING STATEMENT<var>]</var>
</p>
</p>
<hr>
<hr>
   
   
<p class="code">
<p class="code">RETURN
RETURN
</p>
</p>
<hr>
<hr>
   
   
<p class="code">
<p class="code">[DECLARE] SCREEN screenname
[DECLARE] SCREEN screenname
   
   
  [GLOBAL [<u>PERMANENT</u> | TEMPORARY]
  [GLOBAL [<u>PERMANENT</u> | TEMPORARY]
Line 998: Line 894:
<hr>
<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}
Line 1,009: Line 904:
<hr>
<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}
Line 1,020: Line 914:
<hr>
<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
Line 1,027: Line 920:
<hr>
<hr>
   
   
<p class="code">
<p class="code">SET {HEADER | TRAILER} m print-specifications
SET {HEADER | TRAILER} m print-specifications
</p>
</p>
<hr>
<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>
<hr>
   
   
<p class="code">
<p class="code"><b>+</b>  SIGNAL PROCESS
<b>+</b>  SIGNAL PROCESS
   
   
  {cid | [processname | %variable}
  {cid | [processname | %variable}
Line 1,047: Line 937:
<hr>
<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>
   
   
<hr>
<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}]
Line 1,060: Line 948:
<hr>
<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>
 
<div style="margin-left: 20px">
<div style="margin-left: 20px">
<p>
<p>
where <var class="term">key</var> is:</p>
where <var class="term">key</var> is:</p>
<p class="code"> key = fieldname
<p class="code">key = fieldname
       [VALUE {[ASCENDING | DESCENDING]
       [VALUE {[ASCENDING | DESCENDING]
   
   
Line 1,076: Line 962:
</p>
</p>
</div> <!--end key indent -->
</div> <!--end key indent -->
 
<hr>
<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}
Line 1,086: Line 971:
  BY key [AND key] ...
  BY key [AND key] ...
</p>
</p>
 
<div style="margin-left: 20px">
<div style="margin-left: 20px">
<p>
<p>
where <var class="term">key</var> is:</p>
where <var class="term">key</var> is:</p>
<p class="code"> key = fieldname
<p class="code">key = fieldname
       [VALUE {[ASCENDING | DESCENDING]
       [VALUE {[ASCENDING | DESCENDING]
   
   
Line 1,098: Line 982:
</p>
</p>
</div>
</div>
 
<hr>
<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]
Line 1,108: Line 991:
<hr>
<hr>
   
   
<p class="code">
<p class="code">STOP [IF COUNT IN label EXCEEDS n]
STOP [IF COUNT IN label EXCEEDS n]
</p>
</p>
   
   
<hr>
<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)]
Line 1,135: Line 1,016:
<hr>
<hr>
   
   
<p class="code">
<p class="code">SUBROUTINE
SUBROUTINE
</p>
</p>
   
   
<hr>
<hr>
   
   
<p class="code">
<p class="code">SUBROUTINE subname
SUBROUTINE subname
   
   
  [(formal-parameter [INPUT | OUTPUT | INPUT OUTPUT]
  [(formal-parameter [INPUT | OUTPUT | INPUT OUTPUT]
Line 1,148: Line 1,027:
  [,...])]
  [,...])]
</p>
</p>
 
<div style="margin-left: 20px">
<div style="margin-left: 20px">
<p>
<p>
where formal parameter is one of the following:</p>
where formal parameter is one of the following:</p>
<p class="code">
<p class="code">%variable [IS STRING [LEN n] [DP {n | *}]
%variable [IS STRING [LEN n] [DP {n | *}]
   
   
           [ARRAY (*[,*[,*]]) [NO FS]]
           [ARRAY (*[,*[,*]]) [NO FS]]
Line 1,167: Line 1,045:
<hr>
<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>
   
   
<hr>
<hr>
   
   
<p class="code">
<p class="code"><b>+</b>  TEST [FOR]
<b>+</b>  TEST [FOR]
   
   
  {ANY RECEIPT RETURN %variable
  {ANY RECEIPT RETURN %variable
Line 1,182: Line 1,058:
<hr>
<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]
Line 1,198: Line 1,073:
<hr>
<hr>
   
   
<p class="code">
<p class="code">TRANSFER [CONTROL] TO PROCESS {processname
TRANSFER [CONTROL] TO PROCESS {processname
   
   
  | %variable}
  | %variable}
Line 1,213: Line 1,087:
<hr>
<hr>
   
   
<p class="code">
<p class="code">UPDATE RECORD</p>
UPDATE RECORD</p>
   
   
<hr>
<hr>
   
   
<p class="code">
<p class="code">VARIABLES ARE
VARIABLES ARE
   
   
  {FIXED [DP n] | FLOAT
  {FIXED [DP n] | FLOAT
Line 1,230: Line 1,102:
<hr>
<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]])]
Line 1,240: Line 1,111:
<hr>
<hr>
   
   
<p class="code">
<p class="code">[DECLARE] %variable [IS]
[DECLARE] %variable [IS]
<nowiki>
<nowiki>
  STRING [LEN n] [DP {n | *}] [ARRAY (d1[,d2[d3]])]
  STRING [LEN n] [DP {n | *}] [ARRAY (d1[,d2[d3]])]
Line 1,251: Line 1,121:
<hr>
<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
Line 1,261: Line 1,130:
<hr>
<hr>
   
   
<p class="code">
<p class="code">WRITE [IMAGE] imagename
WRITE [IMAGE] imagename
   
   
  ON {seq-filename | TERMINAL | %variable}
  ON {seq-filename | TERMINAL | %variable}
Line 1,268: Line 1,136:
<hr>
<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}]
Line 1,280: Line 1,147:
<ul>
<ul>
<li>Literal number or string </li>
<li>Literal number or string </li>
<li>VALUE IN clause of the form:</li>
<li>VALUE IN clause of the form:
</ul>
<p class="code">VALUE <var>[</var>IN<var>]</var> label
<p class="code">VALUE <var>[</var>IN<var>]</var> label
</p>
</p>
<ul>
</li>
<li>%variable</li>
<li>%variable</li>
</ul>
</ul>
Line 1,295: Line 1,161:
   
   
====Syntax====
====Syntax====
<p class="code">[NOT] phrase [{AND | OR | NOR} [NOT] phrase] ...
<p class="syntax">[NOT] <span class="term">phrase</span> [{AND | OR | NOR} [NOT] <span class="term">phrase</span>] ...
</p>
</p>
Where:
Where:
<p>
<p>
phrase can be constructed as follows:</p>
<var class="term">phrase</var> can be constructed as follows:</p>
<p class="code">fieldname = <var>[</var>NOT<var>]</var> value
<ul style="font-family: Consolas,monospace">
<li>fieldname = <var>[</var>NOT<var>]</var> value
   
   
fieldname LIKE pattern
<li>fieldname LIKE pattern
   
   
fieldname IS [NOT] {PRESENT | LIKE 'pattern'}
<li>fieldname IS [NOT] {PRESENT | LIKE 'pattern'}
fieldname IS [NOT]
{[NUMERICALLY | ALPHABETICALLY]
[EQ | = | NE | ,= | GREATER THAN | GT | >
| LESS THAN | LT < | <= | GE | >= | BEFORE | AFTER]
   
   
<li>fieldname IS [NOT] {[NUMERICALLY | ALPHABETICALLY] <br>
[EQ | = | NE | ,= | GREATER THAN | GT | > <br>
| LESS THAN | LT < | <= | GE | >= | BEFORE | AFTER] <br>
  value}
  value}
   
   
fieldname IS [NOT]
<li>fieldname IS [NOT] {[NUMERICALLY | ALPHABETICALLY] <br>
{IN RANGE [FROM | AFTER] value1 {TO | [AND] BEFORE} <br>
value2 | BETWEEN value1 AND value2}
   
   
{[NUMERICALLY | ALPHABETICALLY]
<li>FILES filename
   
   
{IN RANGE [FROM | AFTER] value1 {TO | [AND] BEFORE}
<li>FIND$ label
   
   
value2 | BETWEEN value1 AND value2}
<li>LISTS$ listname
FILES filename
   
   
FIND$ label
<li>LOCATION {location | =}
   
   
LISTS$ listname
<li>POINT$ value
   
   
LOCATION {location | =}
<li>SFGE$ value
   
   
POINT$ value
<li>SFL$ value
SFGE$ value
SFL$ value
</p>
<p>
<p>
where value can be:</p>
where <i>value</i> can be:</p>
<p>
<ul>
Literal number or string</p>
<li>A literal number or string</li>
<p>
<li>VALUE {[IN] <i>label</i>} | (<i>expression</i>)</li>
VALUE {[IN] label} | (expression)</p>
<li><i>%variable</i> </li>
<p>
</ul>
%variable</p>
</ul>
<blockquote class="note"><b>Notes:</b>
 
<p><b>Notes:</b></p>
<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>
 
===Omitting repeated first words===
===Omitting repeated first words===
<p>
<p>

Revision as of 02:12, 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:

    • A 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]