SYSTEM() SYSTEM Function Values and ASSIGNments *USE AT YOUR OWN RISK* Value Action 1 IBM: Checks to see if the PRINTER ON statement has turned the printer on. Returns 1 if the printer is on and 0 if it is not. ASSIGN number TO SYSTEM(1) sets "number" printer channel active. Like "PRINT ON number", e.g., ASSIGN 5 TO SYSTEM(1) ; * set to printer chn5 PRINT "THIS GOES TO PRINTER CHANNEL 5" PRINT "AS IF I DID A 'PRINT ON 5' " ASSIGN -1 TO SYSTEM(1); *set back to crt display PRINT "BACK on TERMINAL" 2 IBM: Returns the page width as defined by the terminal characteristic settings. Pre-assigned to system variable @CRTWIDE so you should never need to call it. 3 IBM: Returns the page length as defined by the terminal characteristic settings. Pre-assigned to system variable @CRTHIGH so you should never need to call it. 4 IBM: Returns the number of lines remaining on the current page. 5 IBM: Returns the current page number. 6 IBM: Returns the current line number. 7 IBM: Returns the terminal code for the type of terminal the system believes you are using. 8 IBM: Checks whether the tape is attached. Returns the current block size if it is and −1 if it is not. 'n' is the number of the tape unit. If it is not specified, tape unit 0 is assumed. 9 IBM: Returns the current CPU millisecond count. 10 IBM: Checks whether the DATA stack is active. Returns 1 if it is active and 0 if it is not.(@DATA.PENDING has the contents of the data stack.) 11 IBM: Checks whether select list 0 is active. Returns 1 if select list 0 is active and 0 if it is not. 12 IBM: By default, returns the current system time in seconds (local time). If the TIME.MILLISECOND option is set (see $OPTIONS statement), returns the current system time in milliseconds. On HP (only?) it is actually 10ths of milliseconds. (Milliseconds would be 3 decimals. There are 4.): $OPTIONS TIME.MILLISECONDS - Integer 10ths of milliseconds since midnight (e.g., 55709__8388__) $OPTIONS -TIME.MILLISECONDS - seconds since midnight, to 4 decimal places (e.g., 55709'''__.__'''__8388__) The routine that implements the SYSTEM(12) is a very system specific bit of code. 13 IBM: Not used. Returns 0. 14 IBM: Not used. Returns 0. 15 IBM: Not used. Returns 0. 16 IBM: Returns 1 if running from a proc, otherwise returns 0. 17 IBM: Not used. Returns 0. 18 IBM: Returns the terminal number. 19 IBM: Returns the login name. 20 IBM: Not used. Returns 0. (UniData only: returns the number of the last spooler entry you created) 21 IBM: Not used. Returns 0. 22 IBM: Not used. Returns 0. 23 IBM: Checks whether the Break key is enabled. Returns 1 if the Break key is enabled and 0 if it is not. 24 IBM: Checks whether character echoing is enabled. Returns 1 if character echoing is enabled and 0 if it is not. 25 IBM: Returns 1 if running from a phantom process, otherwise returns 0. (buggy 10.0.3 but works on earlier and later releases.) 26 IBM: Returns the current prompt character. 27 IBM: Returns the user ID of the person using the routine. 28 IBM: Returns the effective user ID of the person using the routine.Windows NT. This is the same value as 27. 29 IBM: Returns the group ID of the person using the routine.Windows NT. This value is 0. 30 IBM: Returns the effective group ID of the person using the routine.Windows NT. This value is 0. 31 IBM: Returns the UniVerse serial number. 32 IBM: Returns the location of the UV account directory. 33 Dynamic array containing the last 99 commands executed. (IBM doc erroneously says: "Returns the last command on the command stack. ") @COMMAND.STACK is equivalent. It compiles as SYSTEM(33). 34 IBM: Returns data pending. 35 IBM: Returns the number of users currently in UniVerse.doesn't change on the Red Hat Linux version (which rels?) 36 IBM: Returns the maximum number of UniVerse users. 37 IBM: Returns the number of UNIX users; on Windows NT systems returns same value as 35. 38 IBM: Returns the pathname of the temporary directory. 42 IBM: Returns an empty string. On Windows NT systems returns the current value of the telnet client’s IP address, or an empty string if the process evaluating the SYSTEM function is not the main UniVerse telnet process. 43 IBM: SYSTEM(43) returns 1 if db suspension is on, returns 0 if it is not. See SUSPEND.FILES command or: ASSIGN 1 TO SYSTEM(43);* Suspend on ASSIGN 0 TO SYSTEM(43);* Suspend off 44 Returns the # of processes (not seats in use) (49) UniData's SYSTEM(49) shows stack. On UniVerse use SYSTEM(9001). 50 IBM: Returns the field number of the last READNEXT statement when reading an exploded select list. 60 IBM: Returns the current value of the UniVerse configurable parameter TXMODE. The value can be either 1 or 0. 61 IBM: Returns the status of the transaction log daemon. 1 indicates the daemon is active; 0 indicates it is inactive. 62 value of uvconfig tunable MODFPTRS 63 value of uvconfig tunable BLKMAX 64 value of uvconfig tunable MAXKEYSIZE 91 IBM: Returns 0; on Windows NT, returns 1. 99 IBM: Returns the system time in the number of seconds since midnight Greenwich Mean Time (GMT), January 1, 1970. EPOCH = SYSTEM(99) PICK.DATE = INT(EPOCH/86400)+732 ;* 01/01/1970 - 12/31/1967 = 732 PICK.TIME = REM(EPOCH,86400) 100 – 107 IBM: Values 100 through 107 (read-only) for the SYSTEM function contain NLS information. See the include file UVNLS.H for their tokens. 100 IBM: Returns 1 if NLS is enabled, otherwise returns 0. 101 IBM: Returns the value of the NLSLCMODE parameter, otherwise returns 0. 102 IBM: "Reserved for future NLS extensions." 103 IBM: Returns the terminal map name assigned to the current terminal print channel, otherwise returns 0. 104 IBM: Returns the auxiliary printer map name assigned to the current terminal print channel, otherwise returns 0. 105 IBM: Returns a dynamic array, with field marks separating the elements, containing the current values of the "uvconfig "file parameters for NLS maps, otherwise returns 0. See the UVNLS.H include file for a list of tokens that define the field order. 106 IBM: Returns the current map name used for sequential I/O. Token is NLS$SEQMAP unless overridden by a SET.SEQ.MAP command. 107 IBM: Returns the current map name for GCI string arguments unless overridden by a SET.GCI.MAP command. 223 in DEFINE.DF only. Source in uv/BP. 224 in DEFINE.DF only. Source in uv/BP. 225 ASSIGN number TO SYSTEM(225) changes current USERNO to number. 999 disable "Q" at "Press..." prompt 1000 eject page ? 1001 IBM: Returns the UniVerse flavor: 1 for IDEAL, 2 for PICK, 4 for INFOR­MATION, 8 for REALITY, 16 for IN2, and 64 for PIOPEN. 1002 Indicates if file is in rotating file pool 1003 Indicates if print job is in process 1005 ASSIGN 1 TO SYSTEM(1005) will enable pagination. ASSIGN 0 TO SYSTEM(1005) will disable pagination. Don't bother looking for documentation on this statement in the BASIC manual; it's one of those super-dee-duper secret ones. Alternately in basic: DUMMY = @(0,0)or for old timers from PI environments... CALL !BPIOCP 1006 indicates if cursor is at left margin 1009 ASSIGN number TO SYSTEM(1009) changes current printer channel depth to "number". Use in conjunction with SYSTEM(1) to set current printer channel. 1010 ASSIGN number TO SYSTEM(1010) changes current printer channel top margin to "number". Use in conjunction with SYSTEM(1) to set current printer channel. 1011 ASSIGN number TO SYSTEM(1011) changes current printer channel bottom margin to "number". Use in conjunction with SYSTEM(1) to set current printer channel. 1012 page header (set with HEADING) 1016 You can also use a VERY undocumented feature to turn off auto form feeds: ASSIGN 0 TO SYSTEM(1016) This will convert your auto form feed character into nothing, so no auto form feed occurs. Just be sure to do ASSIGN 1 TO SYSTEM(1016) When done to re-enable form feeds. Otherwise everything will look like you did TERM 80,99999. 1017 IBM: Returns the user’s supplementary UNIX groups in a dynamic array. ASSIGN 1 (or 0) TO SYSTEM(1017) changes how Type1/Type19 records are read/written. Setting to 0 will result in all LF chars converted to @FM chars on reads, and @FM chars to LF chars on writes. Setting to 1 will result in no conversion, so reads and writes will retain LF chars. If you use NLS you must also remember to use BYTE, BYTEVAL and BYTELEN when working with binary data rather than CHAR, SEQ and LEN which will treat some byte sequences as unicode characters (unless that is what you want to happen). (? equivalent of the UniData "NO CONVERT OFF" ?) 1020 SYSTEM(1020,var) REUSE(var) is in effect 1021 IBM: Returns the GCI error number. 1022 Flag for use with NLS opens. 1030 command line arguments in dynamic array. Parse @sentence retaining quoted literals (returns fm delimited string); i.e., THIS IS "MY TEST" Yep on command line will be returned as THIS<@fm>IS<@fm>MY TEST<@fm>Yep (4 instead of 5 arguments) 1031 SYSTEM(1031,var) same as QUOTE(var) 1032 Returns data about logged-in universe processes (leaks memory (mrajkowski@rs.com)) 1050 TRAP key array (set with KEYTRAP and documented in KEYEDIT) 1200 "hostname" IBM: Returns the UV/Net link number associated with "hostname". If there is an internal error adding "hostname", 0 returns. "hostname "is an expression that contains the host name from a file opened through UV/Net. It refers to the host name portion of the file’s pathname. For example, in the pathname ORION"!/u1/filename", "hostname "is ORION. 1201 "hostname" IBM: Returns the RPC connection number associated with "hostname". The UV/Net REMOTE.B interface program uses this number. If there is an internal error adding "hostname", or if RPC has not yet opened, 0 returns. If the RPC connection was opened but is now closed, –1 returns. 1202 "hostname" IBM: Returns the timeout associated with "hostname". If there is no timeout associated with "hostname", 0 returns. 1203 IBM: Returns the last RPC connection error number. This number is in the range 81000 through 81999. 81015 indicates that a timeout occurred. These error numbers correspond to error messages in the SYS.MESSAGE file. 1210 SYSTEM(1210,column) convert from IEEE floating point representation 1300 @VM list of valid administrators (only root and/or uvadm are supported)See APP.PROGS ISUSER.B 1301 Current User Id, 1302 Dynamic Array, each attribute has 4 values: v1: Userno, v2: effective user name, v3: pid, v4: login type similar to what PORT.STATUS would show. Undocumented, but used by APP.PROGS GET.USERS.B (Same array as returned by !GET.USERS subroutine, which "is" documented). 1999 ASSIGN n TO SYSTEM(1999) Sets number of seconds to wait on a lock before taking the ELSE clause instead - an event that would NEVER be good. In Rev 8.3.3 UV introduced the LOCK.WAIT "feature" and set the default to 3600 (seconds). This says that if a LOCKED clause is missing, then after [LOCK.WAIT] seconds, proceed with the ELSE clause ! ? ! ? ! The workaround for that is to effectively turn off that "feature" by setting the parameter to 0, typically via: ASSIGN 0 TO SYSTEM(1999) executed from UV.LOGIN, the routine in uv/VOC that everyone hits when they enter the universe shell. See GTAR 22465. This has worked since rev 8.3.3, "__except__" .. not for type 25 files (BtreeTables, indexes). If a process tries to update an index while another holds the relevant lock: error 010014 "WRITE failure" is triggered. I recommend executing as part of UV.LOGIN setting to a very large number. E.g.: ASSIGN 604800 TO SYSTEM(1999);* 604800 secs in 1 week See GTAR: 27828 See also IBM Knowledgebase article: [http://www-1.ibm.com/support/docview.wss?uid=swg21199628& rs=100 READU Times out After 60 Minutes and Takes the ELSE Clause ]http://www-1.ibm.com/support /entdocview.wss?uid=swg21199628&rs=100&NotUpdateReferer= 2101 ASSIGN number TO SYSTEM(2101) results in a LIST.READU display. 3001 - 3005 Assign to SYSTEM(3001) through SYSTEM(3005) to fire counters for the Windows NT performance monitor. 4001 - 4002 Assign a string to TCL prompt, instead of single character: STELPROMPT = @WHO : '>' ; * normal STELPROMPT<2> = @WHO : '>>' ; select list active STELPROMPT<3> = '+' ; multi-line command ASSIGN 1 TO SYSTEM(4001) ASSIGN STELPROMPT TO SYSTEM(4002) ASSIGN @WHO : '>' TO SYSTEM(4002) This is documented in the online HELP for UV.PROMPT. The command is actually UVPROMPT but the online docs are accessed by UV.PROMPT. 9001 call stack of the current process, including the stack level (layer), object paths, and object execution addresses for each level (layer) as a dynamic array. Introduced @ 10.0.14. SYSTEM(9001) will return a dynamic array that contains roughly the same info that PORT.STATUS LAYER.STACK or RAID "T" command coughs up. --- Details and example below. --- 9006 directs UniVerse to ignore a login paragraph if one existed. Release notes for 10.1.18, issue 34259 says: "In Pick Flavor, SYSTEM(9006) failed to ignore the login paragraph. This problem has been fixed." 9010 At UniVerse 10.1.21+, the SYSTEM(9010) function was added to return the database type. Returns UD if the database is UniData, or UV if the database is UniVerse. Returns UV.PE if the installed database is the UniVerse Personal Edition. UniData Personal Edition, SYSTEM(9010) returns UD.PE.