Statement syntax: Difference between revisions

From m204wiki
Jump to navigation Jump to search
Line 101: Line 101:


<p class="code">CLEAR  
<p class="code">CLEAR  
 
<nowiki>
  {[[ALL | TEMP | LISTFDST | POSITION] [GLOBAL]]  
  {[[ALL | TEMP | LISTFDST | POSITION] [GLOBAL]]  
 
</nowiki>
  OBJECTS
  OBJECTS


Line 183: Line 183:
<b>____________________________________________________</b>
<b>____________________________________________________</b>


<p class="code"><b>**</b>  COUNT OCCURRENCES OF fieldname  
<p class="code"><b>**</b>  COUNT OCCURRENCES OF fieldname</p>


____________________________________________________
<b>____________________________________________________</b>


COUNT RECORDS {IN label | ON [LIST] listname}
<p class="code">COUNT RECORDS {IN label | ON [LIST] listname}</p>


____________________________________________________
<b>____________________________________________________</b>


<var>[</var>DECLARE<var>]</var> declaration  
<p class="code"><var>[</var>DECLARE<var>]</var> declaration  
</p>
</p>
<p>where declaration is one of the following: </p>
<p>where declaration is one of the following: </p>
Line 245: Line 245:
</p>
</p>
<p>type is one of the following:</p>
<p>type is one of the following:</p>
<p>Scalar %variable of the following format:</p>
<ul>
<li>Scalar %variable of the following format:
<p class="code">{STRING [LEN] n [DP {n | *}] | [FIXED [DP n]  
<p class="code">{STRING [LEN] n [DP {n | *}] | [FIXED [DP n]  


| FLOAT]}
| FLOAT]}
</p>
</p>
<p>Array %variable of the following format:</p>
</li>
<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 257: Line 259:
  | [FIXED [DP n] | FLOAT] [ARRAY (* [,*[,*]])]}
  | [FIXED [DP n] | FLOAT] [ARRAY (* [,*[,*]])]}
</p>
</p>
<p>A list of records of the following format:</p>
</li>
<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]
</p>
</p>
<p class="code">____________________________________________________
</li>
</ul>
<b>____________________________________________________</b>


<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>
____________________________________________________
<b>____________________________________________________</b>
 
<p class="code">
DEFAULT {TITLE  
DEFAULT {TITLE  


Line 283: Line 289:


         [PRINT attributes]
         [PRINT attributes]
 
</p>
____________________________________________________
<b>____________________________________________________</b>
 
<p class="code">
DEFAULT SKIP n POSITIONS[S]
DEFAULT SKIP n POSITIONS[S]


             [INITIAL {NULL | character | BLANK}]
             [INITIAL {NULL | character | BLANK}]
</p>
<b>____________________________________________________</b>


____________________________________________________
<p class="code">
 
DEFAULT [TYPE]
DEFAULT [TYPE]


Line 305: Line 312:


  [INITIAL {BLANK | ZERO | NULL | literal}]  
  [INITIAL {BLANK | ZERO | NULL | literal}]  
</p>
<b>____________________________________________________</b>
<p class="code"><b>**</b>  DELETE fieldname <var>[</var>(subscript)<var>]</var> <var>[</var><b></b>= value |(expression)<var>]</var>
</p> 
<b>____________________________________________________</b>


____________________________________________________
<p class="code"><b>**</b>  DELETE EACH fieldname</p>     
</p>
<p class="code"><b>**</b>  DELETE fieldname <var>[</var>(subscript)<var>]</var> <var>[</var><b></b>= value |(expression)<var>]</var>     


____________________________________________________
<b>____________________________________________________</b>
</p>
<p class="code"><b>**</b> DELETE EACH fieldname   


____________________________________________________
<p class="code"><b>**</b>  DELETE RECORD </p> 
</p>
<p class="code"><b>**</b>  DELETE RECORD  


____________________________________________________
<b>____________________________________________________</b>


<p class="code">
DELETE [ALL] RECORDS {IN label | ON [LIST] listname}
DELETE [ALL] RECORDS {IN label | ON [LIST] listname}
</p>


____________________________________________________
<b>___________________________________________________</b>


END BLOCK label  
<p class="code">END BLOCK label </p> 


____________________________________________________
<b>____________________________________________________</b>


END {FIND | IF | FOR | ON | REPEAT | STORE  
<p class="code">END {FIND | IF | FOR | ON | REPEAT | STORE  


     | SUBROUTINE} [label]
     | SUBROUTINE} [label]
</p>
<b>____________________________________________________</b>


____________________________________________________
<p class="code">END {ARRAY | IMAGE | MENU | SCREEN}</p>


END {ARRAY | IMAGE | MENU | SCREEN}
<b>____________________________________________________</b>


____________________________________________________
<p class="code">END [MORE | NORUN | USE]...</p>


END [MORE | NORUN | USE]...
<b>____________________________________________________</b>


____________________________________________________
<p class="code">END UPDATE</p>


END UPDATE
<b>____________________________________________________</b>
 
____________________________________________________


FILE RECORDS {IN label | ON [LIST] listname}
<p class="code">FILE RECORDS {IN label | ON [LIST] listname}


             UNDER fieldname = {value | (expression)}
             UNDER fieldname = {value | (expression)}
</p>
<b>____________________________________________________</b>


____________________________________________________
</p>
<p class="code"><b>*</b>  FIND [AND RESERVE] [ALL] RECORDS  
<p class="code"><b>*</b>  FIND [AND RESERVE] [ALL] RECORDS  


Line 357: Line 366:


     [FOR WHICH | WITH] retrieval-conditions
     [FOR WHICH | WITH] retrieval-conditions
</p>
<b>____________________________________________________</b>


____________________________________________________
</p>
<p class="code"><b>*</b>  FIND <var>[</var>ALL<var>]</var> VALUES OF fieldname  
<p class="code"><b>*</b>  FIND <var>[</var>ALL<var>]</var> VALUES OF fieldname  


Line 365: Line 374:


<var>            [[</var>NOT<var>]</var> LIKE 'pattern'<var>]</var>   
<var>            [[</var>NOT<var>]</var> LIKE 'pattern'<var>]</var>   
</p>
<b>____________________________________________________</b>


____________________________________________________
<p class="code"><b>*</b>  FIND AND PRINT COUNT <var>[</var>retrieval-conditions<var>]</var>       
</p>
</p>
<p class="code"><b>*</b> FIND AND PRINT COUNT <var>[</var>retrieval-conditions<var>]</var>       
<b>____________________________________________________</b>


____________________________________________________
</p>
<p class="code"><b>*</b>  {FIND WITHOUT LOCKS | FDWOL}
<p class="code"><b>*</b>  {FIND WITHOUT LOCKS | FDWOL}


Line 377: Line 386:


  [FOR WHICH | WITH] retrieval-conditions
  [FOR WHICH | WITH] retrieval-conditions
</p>
<b>____________________________________________________</b>


____________________________________________________
<p class="code">FLUSH PROCESS {cid | processname | %variable}</p>


FLUSH PROCESS {cid | processname | %variable}
<b>____________________________________________________</b>


____________________________________________________
<p class="code"><b>**</b>  FOR {EACH | k} {OCCURRENCE | OCCURRENCES} OF fieldname 
</p>
</p>
<p class="code"><b>**</b> FOR {EACH | k} {OCCURRENCE | OCCURRENCES} OF fieldname 
<b>____________________________________________________</b>


____________________________________________________
</p>
<p class="code"><b>*</b>  FOR {EACH | k} {RECORD | RECORDS}
<p class="code"><b>*</b>  FOR {EACH | k} {RECORD | RECORDS}


Line 401: Line 410:


  [{WHERE | WITH} retrieval-conditions]   
  [{WHERE | WITH} retrieval-conditions]   
</p>
<b>____________________________________________________</b>


____________________________________________________
</p>
<p class="code"><b>*</b>  FOR {EACH | k} {VALUE | VALUES} OF fieldname
<p class="code"><b>*</b>  FOR {EACH | k} {VALUE | VALUES} OF fieldname


Line 412: Line 421:


  [RIGHT-ADJUSTED] ORDER]  
  [RIGHT-ADJUSTED] ORDER]  
</p>
<b>____________________________________________________</b>


____________________________________________________
<p class="code">FOR {EACH | k} {VALUE | VALUES} IN label </p>


FOR {EACH | k} {VALUE | VALUES} IN label
<b>____________________________________________________</b>


____________________________________________________
<p class="code"><b>*</b>  FOR RECORD NUMBER {value | (expression)} 
</p>
</p>
<p class="code"><b>*</b> FOR RECORD NUMBER {value | (expression)} 
<b>____________________________________________________</b>


____________________________________________________
<p class="code">FOR RECORD NUMBER {value | IN label} [OPTIMIZING FNV] 
</p>
<b>____________________________________________________</b>


FOR RECORD NUMBER {value | IN label} [OPTIMIZING FNV] 
<p class="code">FOR %variable FROM expression1
 
____________________________________________________
 
FOR %variable FROM expression1


  {TO expression2 [BY expression3]
  {TO expression2 [BY expression3]
Line 434: Line 443:
</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>
<p class="code">____________________________________________________


<b>____________________________________________________</b>
<p class="code">
IDENTIFY
IDENTIFY


Line 444: Line 455:
  | %imagename:arrayname OCCURS {n | %variable}}   
  | %imagename:arrayname OCCURS {n | %variable}}   


____________________________________________________
</p>
</p>
<b>____________________________________________________</b>
<p class="code"><b>C</b>  IF expression THEN statements
<p class="code"><b>C</b>  IF expression THEN statements


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


____________________________________________________
</p>
<b>____________________________________________________</b>


<p class="code">
[DECLARE] IMAGE imagename
[DECLARE] IMAGE imagename


Line 460: Line 474:
  | COMMON [AT [itemname | imagename1 |arrayname}]]   
  | COMMON [AT [itemname | imagename1 |arrayname}]]   


____________________________________________________
</p>
</p>
<p class="code"><b>*</b>  INCLUDE procedurename  
<b>____________________________________________________</b>
 
<p class="code"><b>*</b>  INCLUDE procedurename </p> 


____________________________________________________
<b>____________________________________________________</b>


<p class="code">
INPUT inputname [AT [COLUMN] n]
INPUT inputname [AT [COLUMN] n]


Line 487: Line 503:


  {TAG [attributes] [WITH 'c']] [ITEMID n]  
  {TAG [attributes] [WITH 'c']] [ITEMID n]  
</p>
<b>____________________________________________________</b>


____________________________________________________
<p class="code">
 
INSERT fieldname <var>[</var>(subscript)<var>]</var> = {value | (expression)}   
INSERT fieldname <var>[</var>(subscript)<var>]</var> = {value | (expression)}   
</p>
<b>____________________________________________________</b>


____________________________________________________
</p>
<p class="code"><b>+</b>  INVITE {cid | processname | %variable}
<p class="code"><b>+</b>  INVITE {cid | processname | %variable}


  [SYNCLEVEL | FLUSH | CONFIRM]<var> </var>
  [SYNCLEVEL | FLUSH | CONFIRM]<var> </var>
</p>
<b>____________________________________________________</b>


____________________________________________________
<p class="code">itemname IS [TYPE]
 
itemname IS [TYPE]


  {STRING | BINARY | PACKED | ZONED | FLOAT | EFORMAT}
  {STRING | BINARY | PACKED | ZONED | FLOAT | EFORMAT}
Line 525: Line 542:


  | UNKNOWN}]  
  | UNKNOWN}]  
</p>
<b>____________________________________________________</b>


____________________________________________________
<p class="code">
JUMP TO label
</p>   


JUMP TO label   
<b>___________________________________________________</b>


____________________________________________________
<p class="code">JUMP TO (label1 <var>[</var>,label2<var>]</var> ...) expression
</p>


JUMP TO (label1 <var>[</var>,label2<var>]</var> ...) expression
<b>___________________________________________________</b>


____________________________________________________
<p class="code">LOOP END </p> 


LOOP END   
<b>____________________________________________________</b>


____________________________________________________
<p class="code">MAX PFKEY n </p> 


MAX PFKEY n   
<b>____________________________________________________</b>


____________________________________________________
<p class="code">[DECLARE] MENU menuname
 
[DECLARE] MENU menuname


  [GLOBAL [PERMANENT | TEMPORARY]
  [GLOBAL [PERMANENT | TEMPORARY]
Line 551: Line 571:


  | COMMON]
  | COMMON]
</p>
<b>____________________________________________________</b>


____________________________________________________
<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>
<b>____________________________________________________</b>


____________________________________________________
<p class="code">MODIFY BUFFER [SIZE=n  
 
MODIFY BUFFER [SIZE=n  


   | %variable [PRESERVE | NOPRESERVE]]
   | %variable [PRESERVE | NOPRESERVE]]
Line 568: Line 588:
   [FILL [X'nn'] | CLEAR]
   [FILL [X'nn'] | CLEAR]


____________________________________________________
</p>
</p>
<p class="code"><b>C</b>  NEW PAGE  
<b>____________________________________________________</b>
 
<p class="code"><b>C</b>  NEW PAGE </p> 
 
<b>____________________________________________________</b>


____________________________________________________
<p class="code"><b>**</b>  NOTE <var>{</var>fieldname <var>[</var>(subscript)<var>]}</var>
</p>
</p>
<p class="code"><b>**</b>  NOTE <var>{</var>fieldname <var>[</var>(subscript)<var>]}</var>
<b>____________________________________________________</b>


____________________________________________________
<p class="code">NOTE 'string' </p> 


NOTE 'string'   
<b>____________________________________________________</b>
 
____________________________________________________


ON {ATTENTION | ERROR | FIELD CONSTRAINT CONFLICT
<p class="code">ON {ATTENTION | ERROR | FIELD CONSTRAINT CONFLICT


   | FIND CONFLICT | MISSING FILE | MISSING MEMBER
   | FIND CONFLICT | MISSING FILE | MISSING MEMBER


   | RECORD LOCKING CONFLICT} statements  
   | RECORD LOCKING CONFLICT} statements </p>


____________________________________________________
<b>____________________________________________________</b>


OPEN {[DATASET | EXTERNAL] {ext-filename  
<p class="code">OPEN {[DATASET | EXTERNAL] {ext-filename  


     | %variable}
     | %variable}
Line 599: Line 620:


     [PASSWORD {value | %variable}]   
     [PASSWORD {value | %variable}]   
</p>
<b>____________________________________________________</b>


____________________________________________________
</p>
<p class="code"><b>C</b>  OPEN [C] [[PERM | TEMP] GROUP | FILE]
<p class="code"><b>C</b>  OPEN [C] [[PERM | TEMP] GROUP | FILE]


Line 607: Line 628:


  [PASSWORD {value | %variable}]     
  [PASSWORD {value | %variable}]     
</p>
<b>____________________________________________________</b>


____________________________________________________
<p class="code">OPEN PROCESS {processname | %variable}
 
OPEN PROCESS {processname | %variable}


  [CID {name | %variable}]  
  [CID {name | %variable}]  
</p>
<b>____________________________________________________</b>


____________________________________________________
</p>
<p class="code"><b>+</b>  OPEN PROCESS {processname | %variable}
<p class="code"><b>+</b>  OPEN PROCESS {processname | %variable}


Line 637: Line 658:
<p>and inbound options are:</p>
<p>and inbound options are:</p>
<p class="code"> ACCEPT [INITIAL {DATA %variable | IMAGE image} ...]  
<p class="code"> ACCEPT [INITIAL {DATA %variable | IMAGE image} ...]  
</p>
<b>____________________________________________________</b>


____________________________________________________
<p class="code">PAUSE <var>[</var>n | %variable<var>]</var>     
 
</p>
PAUSE <var>[</var>n | %variable<var>]</var>     
<b>____________________________________________________</b>


____________________________________________________
</p>
<p class="code"><b>**</b>  PLACE RECORD ON <var>[</var>LIST<var>]</var> listname     
<p class="code"><b>**</b>  PLACE RECORD ON <var>[</var>LIST<var>]</var> listname     



Revision as of 15:52, 6 August 2013

Overview

This chapter 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 chapter 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 Rocket Model 204 Parameter and Command Reference Manual.

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 Rocket Model 204 Parameter and Command Reference Manual.

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] [,...])]

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 = fieldname [VALUE {[ASCENDING | DESCENDING] [CHARACTER | NUMERICAL] | RIGHT-ADJUSTED]} ...] ____________________________________________________ SORT [k] RECORD KEYS {IN label | ON [LIST] listname} BY key [AND key] ...

where:

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

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

 

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]