CLIST

From Vero - Wikipedia
Jump to navigation Jump to search

Template:Short description Template:One source CLIST (Command List) (pronounced "C-List") is a procedural programming language for TSO in MVS systems. It originated in OS/360<ref>Template:Cite book </ref> Release 20 and has assumed a secondary role since the availability of Rexx in TSO/E Version 2. In its basic form, a CLIST program is a list of commands to be executed in strict sequence (like a DOS batch file (*.bat) file). OS/VS2 R3.6 (MVS) added If-Then-Else logic and loop constructs to CLIST.<ref>Template:Cite book </ref> The term CLIST is also used for command lists written by users of NetView.<ref name="clist">Template:Cite web</ref>

CLIST is an interpreted language. That is, the computer must translate a CLIST every time the program is executed. CLISTs therefore tend to be slower than programs written in compiled languages such as COBOL, FORTRAN, or PL/1. (A program written in a compiled language is translated once to create a "load module" or executable.)

CLIST can read/write MVS files and read/write from/to a TSO terminal. It can read parameters from the caller and also features a function to hold global variables and pass them between CLISTs. A CLIST can also call an MVS application program (written in COBOL or PL/I, for example). CLISTs can be run in backgroundTemplate:Efn-lrTemplate:Efn-lr. CLISTs can display TSO I/O screens and menus by using ISPF dialog services.

Compare the function of CLIST with that provided by REXX.

Example programs

<syntaxhighlight lang="rexx" line highlight="10">

PROC 0
WRITE HELLO WORLD!

</syntaxhighlight>

Adding If-Then-Else logic: <syntaxhighlight lang="rexx" line highlight="10">

  /********************************************************************/
  /*  MULTI-LINGUAL "HELLO WORLD" PROGRAM.                            */
  /*                                                                  */
  /*  THIS CLIST, STORED AS USERID.TSO.CLIST(TEST), CAN BE INVOKED    */
  /*  FROM THE ISPF COMMAND LINE AS SHOWN IN THE FOLLOWING EXAMPLE:   */
  /*                                                                  */
  /*     COMMAND ===> TSO TEST SPANISH                                */
  /*                                                                  */
  /********************************************************************/
  PROC 1 LANGUAGE
    IF &LANGUAGE = SPANISH THEN +
       WRITE HOLA, MUNDO
    ELSE IF &LANGUAGE = FRENCH THEN +
       WRITE BONJOUR, MONDE
    ELSE +
       WRITE HELLO, WORLD
  EXIT

</syntaxhighlight>

See also

Footnotes

Template:Notelist-lr

References

Template:Reflist

Template:IBM Template:Authority control


Template:Compu-lang-stub Template:Mainframe-compu-stub