User Tools

Site Tools


openvms:openvms-cheatsheet

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
openvms:openvms-cheatsheet [2023/06/29 07:22] – [Error levels] dodgeropenvms:openvms-cheatsheet [2023/07/01 08:10] (current) dodger
Line 1: Line 1:
 ====== [CHEATSHEET] OpenVMS ====== ====== [CHEATSHEET] OpenVMS ======
 +
 +====== Main concepts ======
  
 ===== Keywords ===== ===== Keywords =====
Line 8: Line 10:
 | DCL | Digital Command Language | ''bash'' LOL | | DCL | Digital Command Language | ''bash'' LOL |
 | CDU | Command definition utility | It's a kind of IDE or ''getops'', allow command line definitions | | CDU | Command definition utility | It's a kind of IDE or ''getops'', allow command line definitions |
 +| RMS | Record Management Services | ''journalctl'' (logs) |
 +| JBC | Job Controller | Queues |
 +| Symbol | - | A variable... |
  
  
Line 19: Line 24:
 | ''!'' | ''#'' | comment delimiter | | ''!'' | ''#'' | comment delimiter |
 | ''%'' | ''nothing here'' | Error message delimiter | | ''%'' | ''nothing here'' | Error message delimiter |
 +| ''^-(.*)'' | ''nothing here'' | Continue a message. For example 1st line begin with ''%'' and 2nd line with ''-'' |
  
-==== Error levels ====+ 
 +===== Error levels =====
  
 ^ alpha ^ numeric ^ level ^ ^ alpha ^ numeric ^ level ^
Line 29: Line 36:
 | ''-F-'' | ''4'' | SEVERE | | ''-F-'' | ''4'' | SEVERE |
  
 +====== Programming ======
 +More or less
 +===== Symbols (Variables)  =====
 +
 +^ Creation ^ Description ^
 +| ''SYMBOLNAME = <value> '' | Creates a **local** symbol (string or integer) |
 +| ''SYMBOLNAME == <value> '' | Creates a **global** symbol (string or integer) |
 +| ''SYMBOLNAME := <value> '' | Creates a **local** STRING symbol |
 +| ''SYMBOLNAME :== <value> '' | Creates a **global** STRING symbol |
 +| ''DELETE/SYMBOL SYMBOLNAME'' | Destroy local variable''SYMBOLNAME'' |
 +| ''DELETE/SYMBOL/GLOBAL SYMBOLNAME'' | Destroy global variable ''SYMBOLNAME'' |
 +| ''SHOW SYMBOL SYMBOLNAME'' | Show content of the variable ''SYMBOLNAME'' |
 +
 +===== Aliases through symbols =====
 +Create an alias ''EDT'' with a frequently used command:
 +<code DCL>
 +EDT :== EDIT/EDT/COMMAND=SYS$LOGIN:EDTINI.DDT
 +</code>
 +
 +
 +Replace a command with the command you want:
 +<code DCL>
 +PRINT :== PRINT/NOBURST/NOFLAG/NOTRAILER/NOTIFY
 +</code>
 +This will replace the command ''PRINT'' with ''PRINT/NOBURST/NOFLAG/NOTRAILER/NOTIFY'' everytime you launch it.
 +
 +===== Operations with symbols =====
 +
 +==== Arithmetic operations (integers) ====
 +
 +<code DCL>
 +$ APPLES = 10
 +$ SHOW SYMBOL APPLES
 +  APPLES = 10    Hex = 0000000A    Octal = 00000000012
 +
 +$ APPLES = 2 * (4+5)
 +$ SHOW SYMBOL APPLES
 +  APPLES = 18    Hex ...
 +$ ORANGES = 15
 +$ TOTAL_FRUIT = APPLES + ORANGES
 +$ SHOW SYMBOL TOTAL_FRUIT
 +  TOTAL_FRUIT = 33
 +</code>
 +
 +=== List of operations ===
 +^ Operation ^ 
 +| ''+'' |
 +| ''-'' |
 +| ''*'' |
 +| ''/'' |
 +
 +==== String operations ====
 +
 +<code DCL>
 +$ APPLES = "Apples"
 +$ SHOW SYMBOL APPLES
 +  APPLES = "Apples"
 +$ FRUIT = "Oranges and " + APPLES
 +$ SHOW SYMBOL FRUIT
 +  FRUIT = "Oranges and Apples"
 +</code>
 +
 +==== Using subshells in commands ====
 +
 +Sub-shell is invoqued with ''2 SINGLE QUOTES+VARIABLE+1 SINGLE QUOTE'', for examples:
 +<code DCL>
 +$ FILETYPE = "login.com"
 +$ TYPEIT = "TYPE ''filename'"
 +$ SHOW SYMBOL TYPEIT
 +  "TYPE login.com"
 +</code>
 +
 +<WRAP center round tip 60%>
 +Take care with string usage '':=''
 +</WRAP>
 +What works and what not (as a sub-shell):
 +  * Works:
 +<code DCL>
 +$ FILETYPE := "login.com"
 +$ TYPEIT := "TYPE ''filename'"
 +$ SHOW SYMBOL TYPEIT
 +  "TYPE login.com"
 +</code>
 +
 +  * DON'T Work (as a literal)
 +<code DCL>
 +$ FILETYPE := "login.com"
 +$ TYPEIT := "TYPE" +  filename
 +$ SHOW SYMBOL TYPEIT
 +  "TYPE FILENAME"
 +</code>
 +
 +<WRAP center round tip 60%>
 +In the other hand, without forcing string assignment
 +</WRAP>
 +Both are assigned as a variable:
 +<code DCL>
 +$ FILETYPE = "login.com"
 +$ TYPEIT = "TYPE ''filename'"
 +$ SHOW SYMBOL TYPEIT
 +  "TYPE login.com"
 +</code>
 +<code DCL>
 +$ FILETYPE = "login.com"
 +$ TYPEIT = "TYPE" +  filename
 +$ SHOW SYMBOL TYPEIT
 +  "TYPE login.com"
 +</code>
  
 ====== Startup ====== ====== Startup ======
openvms/openvms-cheatsheet.1688023323.txt.gz · Last modified: 2023/06/29 07:22 by dodger