SOUL $functions
Some operations are inefficient or impossible to code in a high-level programming language like SOUL. To overcome this difficulty, SOUL provides a variety of $functions. Many of these functions are deprecated in favor of an OO API method. When that is the case, the $function page notes the matching method.
The mathematical $functions, and those $functions central to a Model 204 product (and which require authorization of that product) are listed separately; you can find links to those sets of $functions in the following table:
$Function set | Description |
---|---|
$xxxmath | Mathematical $functions |
$Fact_xxx | SirFact $functions |
$Ftp_xxx | Janus FTP Server $functions |
$Sock_xxx | Janus Sockets $functions |
$Web_xxx | Janus Web Server $functions |
Sir2000 | Sir2000 User Language Tools $functions |
List of standard $functions
The following table lists available SOUL $functions, in alphabetical order. The list is not exhaustive (see the table of other $function sets, above).
Note: Some of the $functions listed below are only available with the purchase of a Model 204 add-on product. The individual page containing such a $function's full description has an itemized list of the add-on products that authorize the use of the $function.
See also:
- Using functions, which reviews coding in SOUL with $functions
$Function | Description |
---|---|
$Abbrev | Determine if string is abbreviation within list of words |
$Account | Account under which the user is logged in. |
$Acct | User ID under which the user is logged in. |
$Alpha | Whether a string is composed of only the letters A through Z. |
$AlphNum | Whether a string is composed of only the letters A through Z and digits 0 through 9. |
$Arr_Find | Find value within array |
$Arr_Init | Initialize every element of array to specific value |
$Arr_Max | Find maximum value in array |
$Arr_Min | Find minimum value in array |
$ArrSize | Number of elements in a particular dimension of an array. |
$Ascii | Input string, converted from EBCDIC to ASCII. |
$A2E | Translate ASCII to EBCDIC |
$Base64_Decode | Convert from base 64 to byte string |
$Base64_Encode | Convert byte string to base 64 |
$BgPurge | Cancel "long" sdaemon request initiated with $CommBg |
$BgQuery | List of "long" sdaemon requests initiated via $CommBg |
$Binary | A number converted into fixed-point binary. |
$Bind_List | Return list of bound semaphores onto a $list |
$Bind | Fast, easy synchronization of system wide resource |
$BitAnd | Bitwise AND of two integers |
$BitOr | Bitwise OR of two integers |
$BldProc | Enables a request to build a temporary procedure. |
$Buffer_Position | Current Universal Buffer position. |
$Buffer_Size | Size of user's Universal Buffer. |
$Buffer_Used | Amount of data currently in Universal Buffer |
$Bump | Bump a user |
$CenqCt | Number of unused entries within the resource enqueuing table. |
$Center | Center string |
$CfStatL | List of statistics for users holding critical file resources |
$ChkMod | Whether the terminal operator entered data in any full-screen input field. |
$ChkPat | Syntax of a pattern. |
$ChkpInf | Information about checkpoints |
$ChkTag | Whether any erroneous full-screen input has been entered by the end user. |
$Close | Close file or group in User Language request |
$Cms | Determine if online is running under CMS |
$Code | Encoding facility. |
$Command | Execute Model 204 command on sdaemon, results to image |
$CommBg | Execute Model 204 commands on sdaemon |
$CommndL | Execute Model 204 command on sdaemon, results to $list |
$Context | Determine if string is name of open file or group |
$Curfile | Name of the file from which the current record has been selected. |
$Currec | Integer equal to the internal number of the current record. |
$C2D | Convert binary byte string to integer |
$C2X | A translation of each byte within a character string to its two-byte hexadecimal representation. |
$DaemonMasterNumber | Get user number of master thread |
$DaemonParentNumber | Get user number of parent thread |
$Date | Current date in yy-mm-dd format. |
$DateChg | Specified number of days, added to or subtracted from a given date. |
$DateChk | Whether a given date is valid. |
$DateCnv | Date converted to a format specified by the user. |
$DateDif | Difference in days between two dates. |
$DateP | Current date in "dd mon yy" format. |
$DAY | Day name of the input day-number. |
$DayI | Number reflecting current day of the week. |
$Deblank | Substring of a string, with leading and trailing blanks removed. |
$Decode | Decoding facility. |
$Deflate | Compress a longstring with Deflate |
$DelCh | Remove characters from string, compress and strip blanks |
$Delg_Subsys | Delete subsystem-wide global |
$Delg_Sys | Delete system-wide global |
$Delimr | Insert delimiter string into input string at regular positions |
$Dscr | Decoding facility. |
$Dsn | Data set name when you specify a file's DD name and the ordinal number. |
$DsnNum | Total number of data sets defined for a file when you specify the file's DD name. |
$D2C | Binary byte representation of integer |
$D2X | Hex representation of integer |
$Ebcdic | Convert input string from ASCII to EBCDIC |
$EcbDGet | Get string data associated with an Event Control Block (ECB) |
$EcbDSet | Set string data associated with an Event Control Block (ECB) |
$EcbTest | Check an Event Control Block (ECB) to see if it is posted |
$EcfStat | Returns the detailed completion code from the previous EXTERNAL statement. |
$Edit | Edited numeric and alphanumeric text |
$EdScan | Scan list of entities in online |
$Eformat | Exponent notations from converted numeric values |
$Encrypt | A one-way encryption of a character string. |
$Ent_Print | Set automatic character entity substitution |
$Ent_Tab | retrieve/modify character entity substitution table |
$Ent | Do character entity substitution |
$Enter | Efficient terminal dialogue with users of data entry applications. |
$ErrClr | Clears the error message text returned by the $Errmsg and $Fsterr functions. |
$Errmsg | Prefix and text of the last counting error or request cancellation message received. |
$ErrSet | Increment or clear number of counting errors, set $Errmsg |
$E2A | Translate EBCDIC to ASCII |
$FakeEnt | Prepare fake ENTER to automatically satisfy next full screen read |
$FDef | String that describes the attributes of a field in a Model 204 file. |
$Field_Image | Return field values into an image |
$Field_List | Return field values into a $list |
$Field_ListI | Return field values into a $list mapped to an image |
$FieldgroupId | The ID of the current field group. (Available as of Model 204 version 7.5.) |
$FieldgroupOccurrence | The current occurrence number of the field group. (Available as of Model 204 version 7.5.) |
$FIniTim | File initialization YYDDDMMHHSSTH |
$FiStat | Retrieve file's statistics into string |
$FiStatL | Retrieve set of files' statistics into list |
$FldLen | Length of a field. |
$Float | Floating-point to a 4-byte string without conversion (4-byte floating point number to a 4-byte string). |
$FloatD | Floating-point to a 4-byte string without conversion (8-byte floating point number to an 8-byte string). |
$FlsAcc | User's access rights to a particular field. |
$FlsChk | Whether a given set of field level security accesses is valid for a field. |
$FreeOpt | Free optional file or group from subsystem |
$Fsterr | Variable-length string containing the prefix and the first counting error message or request cancellation message received by the user since the last time the count was reset to zero. |
$FunForc | Cancel running or waiting Fast/Unload request |
$FunImg | Retrieve data from active Fast/Unload request into image |
$FunList | $list of active and enqueued Fast/Unload requests |
$FunLoad | Fast/Unload records in Model 204 list or found set |
$FunPurg | Purge running or waiting Fast/Unload request |
$FunSkip | Skip to next output record for $FunImg, $FunsStr |
$FunsStr | Retrieve data from active Fast/Unload request into string |
$FunWait | Wait until asynchronous Fast/Unload request completes |
$Getg | Information stored by a $SETG function. |
$GetL | Line number of the current line on the page on the user's terminal or on the output data set specified by a USE command. |
$GetP | Page number currently on the user's terminal or on the output data set specified by a USE command. |
$GrmLoc | Location of a missing member. |
$GrmName | File name of a missing member. |
$GrnLeft | Number of optional files that may fail before MAXFAIL is exceeded. |
$GrnMiss | Number of missing members. |
$GunZip | Decompress a longstring with GUNZIP |
$GZip | Compress a longstring with GZip |
$HexA | Convert hexadecimal string to EBCDIC equivalent |
$HPage | String of special characters whose length is equal to the value specified as the $HPage argument. |
$Hsh | A hash value from a converted string value. A hash value is a distinct numeric representation of a given string value. |
$IHexA | Convert EBCDIC string to hexadecimal equivalent |
$ImgInf | Retrieve image item by variable name |
$ImgOvl | Replace image item value |
$Incrg | Performs simple arithmetic on global variables. |
$IncStat | Increment local system statistic |
$Index | After comparing two strings, a number equal to the first position within the first string at which the second string appears; the same function as $SCAN. |
$Inflate | Decompress a longstring with inflate |
$ItsOpen | Whether or not a file is open. |
$ItsRemote | Whether the current file or group is remote or scattered. |
$JobAuth | Determine if user has authorization for USE $JOB |
$Jobcode | Allows a request that is part of one step of a Model 204 batch run to communicate with a subsequent step. |
$JpStat | Retrieve Janus port's statistics into string |
$LangSpc | String containing the binary value of a character in a specified language. |
$LangSrt | A binary string translated to sort according to the NLSORT macro for the specified language. |
$LangUst | Previously $LangSrt'ed string translated back to its original form. |
$Len | Length of a value in a field. |
$List_Add_Ordered | Add an item to an ordered $list |
$List_Add_Unique_Ordered | Conditionally add an item to an ordered $list |
$List_Add_Unique | Conditionally add an item to a $list |
$List_Capture | Capture print data to $list |
$List_Conv_Item | Convert $list to single delimited $list item |
$List_Copy_Items | Copy items between $lists |
$List_Diff_Item | Differences between $list and delimited $list item |
$List_Global and $List_Session | Access/create global/session $list |
$List_Global_Del and $List_Session_Del | Delete global/session $lists |
$List_Global_List and $List_Session_List | List global/session $lists |
$List_MaxIL | Return maximum $list item length |
$List_Print | Display contents of a $list |
$ListAdd_Lstr | Add longstring as new $list item |
$ListAdd | Add string as new $list item |
$ListAddI | Add image as new $list item |
$ListAdj | Adjust length of $list item |
$ListChk | Validate a $list identifier |
$ListCmp | Compare two $lists and produce $list describing differences |
$ListCnt | Number of items in $list |
$ListCpy | Copy $list |
$ListDel | Release CCATEMP storage used for $list |
$ListFind | Find string in $list |
$ListFindI and $ListFindI_Up | Find image item in $list |
$ListFindI_Sub | Build $list subset based on image item |
$ListILn | Length of $list item |
$Listimg_Copy | Copy a $list's image association |
$ListImg | Associate an image with a $list |
$ListInf_Lstr | Retrieve $list item into longstring |
$ListInf | Retrieve $list item into string |
$ListInfI | Retrieve $list item into image |
$ListIns_Lstr | Insert string into a $list |
$ListIns | Insert string into a $list |
$ListInsI | Insert image into a $list |
$ListLoc | Locate string in $list |
$ListLup | Locate string in $list, searching backwards |
$ListMove | Move a $list |
$ListNew | Create empty $list |
$ListNewA | Create array of empty $lists |
$ListNewAI | Create array of empty $lists associated with image |
$ListNewI | Create empty $list associated with image |
$ListOvl | Overlay part of $list item with string |
$ListOvlI | Overlay part of $list item with image item |
$ListRem | Remove item from $list |
$ListRep_Lstr | Replace a $list item with a longstring |
$ListRep | Replace a $list item with a string |
$ListRepI | Replace $list item with an image |
$ListRst | Restore global $list |
$ListSav and $ListSave | Save global $list |
$ListSavL | Count and names of available global $lists |
$ListSort and $ListSrt | Sort $list |
$ListSub | Create $list that is subset of input $list |
$ListUpd | Produce $list from input $list using $list of updates |
$Lowcase | A lower case string translated from an uppercase or mixed case string |
$LstFld | Field names in a file, along with their field descriptions, into an image. |
$LstProc | Information that is stored for a procedure. |
$Lstr_Add_UserBuffer | Add longstring to user buffer |
$Lstr_Base64_Decode | Convert from base 64 to byte string |
$Lstr_Base64_Encode | Convert byte string to base 64 |
$Lstr_C2X | Convert byte string to hexadecimal |
$Lstr_Get_Image and $Lstr_Set_Image | Longstring to/from image |
$Lstr_Get_Userbuffer | Get user buffer contents to a longstring |
$Lstr_Global and $Lstr_Session | Bind to global/session longstring |
$Lstr_Global_Del and $Lstr_Session_Del | Delete global or session longstring |
$Lstr_Global_Get and $Lstr_Session_Get | Get global or session longstring |
$Lstr_Global_Set and $Lstr_Session_Set | Set global or session longstring |
$Lstr_Index | Find a string inside a longstring |
$Lstr_Left | Leftmost characters of a longstring |
$Lstr_Len | Length of a longstring |
$Lstr_Parse | Part of longstring preceding character in delimiter set |
$Lstr_ParseX | Part of longstring following character in delimiter set |
$Lstr_Right | Rightmost characters of a longstring |
$Lstr_Set_UserBuffer | Set user buffer to longstring value |
$Lstr_Substr | Substring of a longstring |
$Lstr_SubWord | Substring of a longstring using word counts |
$Lstr_Translate | Translate longstring |
$Lstr_Unblank | Remove extraneous blanks from longstring |
$Lstr_Windex | Return the position of a word within a long string |
$Lstr_Word | Return a word from a long string |
$Lstr_Words | Return the number of words in a long string |
$Lstr_X2C | Convert from hexadecimal to byte string |
$Lstr | Treat a string as longstring |
$MisGrup | Group name if the error occurred in group context, null if in file context. |
$MisLoc | Location of a missing member or file. |
$MisName | File name of a missing member or file. |
$MisNum | Number of files that failed in a group. |
$MisStmt | Statement that caused the ON unit to be entered. |
$Mod | Remainder that results when one argument is divided by the another argument. |
$Occurs | Whether a field has the OCCURS attribute. |
$Oneof | Table lookup that can replace a series of IF conditions. |
$Pack | Packed decimal representation of a string. |
$Pad | Designated character padded to the left. |
$PadR | Designated character padded to the right |
$Parse | Part of string preceding character in delimiter set |
$ParseX | Part of string following character in delimiter set |
$Post | Indicates that an event has occurred; the thread waiting on an ECB can resume processing. |
$PrcLEx | $list of information about procedures in file |
$PrcLExG | $list of information about procedures in group or file |
$Priorty | Change a user's priority |
$Proc_List | $list of information about procedures in file |
$Proc_ListG | $list of information about procedures in group or file |
$Proc_Touch | Change a procedure's last-update date and user |
$ProcCls | Close procedure before reaching end |
$ProcDat | Add lines from procedure to $list |
$ProcGet | Next line of procedure |
$ProcLoc | Locate any of set of strings in procedure |
$ProcOpn | Open procedure for $ProcDat, $ProcGet, $ProcLoc |
$Random_Seed | Build seed specifying series of $Random results |
$Random | Get next random number |
$RdProc | Lines of a User Language procedure, retrieved in sequential order, that is stored in a Model 204 file. |
$Read | An echo of the data a user enters as a request is evaluated |
$ReadInv | Performs the same function as $READ, except that input from the terminal is not echoed. |
$ReadLc | An echo of the data a user enters as a request is evaluated, except that case translation is deactivated, regardless of the current *UPPER or *LOWER setting. |
$RegexMatch | Whether string matches regex |
$RegexReplace | Replace matching strings |
$Remote | VTAMNAME value of the originating Model 204 region when using SNA Communications Server (formerly VTAM) TRANSFER to transfer between Model 204 regions. |
$Resetn | Reset or view M204 parameter |
$Reverse | Reversed order of a string. |
$RlcFile | Name of the file in which the last record locking conflict occurred. |
$RlcRec | Internal record number for which the last record locking conflict occurred. |
$RlcUid | ID of the user who caused an ON FIND CONFICT or ON RECORD LOCKING CONFLICT. If the conflicting user is on a remote node, $RLCUID also returns the name of the node. |
$RlcUsr | User number of the user with which the request conflicted when the last record locking conflict occurred. |
$Round | Number, rounded to a specified number of decimal places. |
$Scan | After comparing two strings, a number equal to the first position within the first string at which the second string appears; the same function as $INDEX. |
$Sclass | Current user's subsystem user class. |
$Screen_attr | Get screen item attributes as a blank-delimited string |
$Screen_clear | Clear tagged and/or modified attributes in a screen |
$Screen_mod | Set modified attribute for a screen item |
$ScrHide | Hide lines in SCREEN |
$ScrSize | Change size of field on SCREEN |
$ScrWide | Allow SCREEN to accept fields wider than 79 |
$Session, $Session_Id, $Session_Owner, and $Session_Timeout | Return values for currently open session |
$Session_Close | Close an open session |
$Session_Create | Create a new session |
$Session_Delete | Delete a session |
$Session_List | Get list of sessions |
$Session_Open | Open a session |
$Setg_Subsys_List | Get list of subsystem-wide globals |
$Setg_Subsys | Set subsystem-wide global |
$Setg_Sys_List | Get list of system-wide globals |
$Setg_Sys | Set system-wide global |
$Setg | A created or changed entry in the global variable section of GTBL. |
$SetL | Sets the current line counter for the output device currently in effect. |
$SetP | Sets the current page number for the output device currently in effect. |
$SetStat | Set local system statistic |
$Sir_Date | Get current datetime |
$Sir_DateFmt | Validate datetime format |
$Sir_DateN | Current date and time as number of seconds/300 |
$Sir_DateND | Current date as number of days |
$Sir_DateNM | Current date and time as number of milliseconds |
$Sir_DateNS | Current date and time as number of seconds |
$Sir_Date2N | Convert datetime string to number of seconds/300 |
$Sir_Date2ND | Convert datetime string to number of days |
$Sir_Date2NM | Convert datetime string to number of milliseconds |
$Sir_Date2NS | Convert datetime string to number of seconds |
$Sir_Login | Perform secured web or sockets login |
$Sir_ND2Date | Convert datetime number of days to string |
$Sir_NM2Date | Convert datetime number of milliseconds to string |
$Sir_NS2Date | Convert datetime number of seconds to string |
$Sir_N2Date | Convert datetime number of seconds/300 to string |
$Sir_Wild | Test string against a wildcard string |
$SirJGet | Place audit trail data on $list |
$SirMsg | Line of current $SirMsgP procedure |
$SirMsgP | Load procedure for retrieval via $SirMsg |
$SirParm | Set user-specific value, controlling Sirius products |
$SirProd | Determine availability of Sirius product or capability |
$SirSite | Current Sirius customer site ID |
$SirTime | Current time as YYDDDHHMISSXX |
$SirVer | Current version number of Sirius product |
$SirWarn | Send warning or message to user(s) |
$Slstats | Resets the recording of since-last statistics anywhere within a request. |
$SndMail | Send an email message |
$Sndx | SOUNDEX code of an argument. |
$Square | A number multiplied by itself. |
$SsStat | Retrieve subsystem's statistics into string |
$SsStatL | Retrieve statistics for set of subsystems into $list |
$Stat | Current value of any user statistic. |
$StatD | Calculate differences and rates for statistics strings |
$StatLD | Calculate differences and rates for statistics $lists |
$Status | The success or failure of the last executed external I/O or program communication statement. |
$StatusD | More detailed description of a condition returned by $STATUS. |
$Str | Treat a longstring as string |
$StrAnd | Bit-wise AND two strings |
$Strip | A number with suppressed leading zeros. |
$StrOr | Bit-wise OR two strings |
$StrXor | Bit-wise exclusive OR two strings |
$SubCnt | Count occurrences of one string in another |
$SubErs | Remove occurrence of one string from another |
$SubIns | Insert string inside another string |
$SubRep | Replace occurrences of string |
$Substr | Substring of a string. |
$Subsys | Status of an APSY subsystem. |
$SyStat | Retrieve system statistics into string |
$TableC | Information provided by TABLEC command |
$TermId | Terminal ID of current user thread |
$Time | Current time in hh:mm:ss format. |
$TkStat | Retrieve task's statistics into string |
$TkStatL | Retrieve statistics for all tasks into $list |
$TsoAtt | Attach program in user's TSO address space |
$TsoCall | Call program in user's TSO address space |
$TsoCan | Cancel program invoked via $TsoAtt |
$TsoCmd | Invoke command in user's TSO address space |
$TsoExec | Invoke CLIST in user's TSO address space |
$TsoExit | Terminate TSO full screen interface session, stack command |
$TSOId | TSO userid user's thread |
$TSOStat | Status of program invoked via $TsoAtt |
$TSOWait | Wait for program invoked via $TsoAtt to complete |
$Unbin | Value converted from binary to string representation. |
$Unbind_and_$UnbindW | $Unbind and $UnbindW: Unbind resource previously bound via $Bind |
$Unblank | Contents of an argument, removing leading and trailing blanks, and compressing multiple embedded blanks to one blank character. |
$Unfloat | Character string that represents a numeric counted string of 4 or 8 bytes, which contains a floating point. |
$Unpack | Unpacked decimal data |
$UnPost | Resets a specified Event Control Block (ECB) to an unposted state. |
$UnqRec | In the case of a uniqueness violation, returns the file-relative record number of the record that already contains the field name = value pair If no uniqueness violation occurred. returns -1. |
$UnSpace | Normalize spaces and quotes |
$Upcase | An uppercase string converted from a lower or mixed case string. |
$Update | Name of the group update file or the current file. |
$UpdFile | Name of the file in which a field level constraint violation has occurred, or a blank if no violation occurred. |
$UpdFld | Name of the field for which a field level constraint violation has occurred, or a blank if no violation occurred. |
$UpdLoc | Location name (node name) of the current update unit (Parallel Query Option/204 only). |
$UpdOval | Value of the original field occurrence causing a constraint violation, when invoked from an ON FCC unit following the detection of an AT-MOST-ONE field-level constraint conflict. |
$UpdRec | File-relative record number of the record whose update caused a field level constraint violation, or -1 if no violation occurred. |
$UpdStat | Numeric value denoting the type of field level constraint violation that has occurred, or 0 if no violation occurred. |
$UpdStmt | Type of User Language updating statement causing a field level constraint violation, or a blank if no violation occurred. |
$UpdVal | Field value causing a field level constraint violation, or a blank if no violation occurred. |
$UseASA | Prevent carriage control in USE output |
$User | User's user number. |
$Userid | User ID under which the user is logged in. |
$UsrPriv | Whether a user ID has been granted specific Model 204 privileges. |
$UsStat | Retrieve user's statistics into string |
$UsStatL | Retrieve statistics for set of users into $list |
$Verify | Whether every character in one string is present in a second string. |
$View | Value of a parameter. |
$Vnum | Whether a given argument is in a valid format for a SORT BY VALUE NUMERICAL statement or for any type of mathematical operation. |
$Wait | Suspend a user until an Event Control Block (ECB) is posted. |
$WakeUp | Pause user until specified time |
$Web_xxx | List of Janus Web Server $functions |
$Windex | Word number of first occurrence of word in phrase |
$Word | P word in a specified string, delimited by a blank or optionally specified character. |
$Words | Number of words in a specified string, delimited by a blank or optionally specified character. |
$X2C | One-byte EBCDIC characters translated from a string of 2-byte hexadecimal character. |
$X2D | Convert hex string to integer |
Using functions
You can use functions in several ways, including, as a term in:
- An expression in a variable assignment statement, for example:
%X=$EDIT(2573,'99999')
- The specifications in a PRINT statement
A PRINT statement can include a function call anywhere a field name can be used. For example:
PRINT $EDIT(2573,'99999')
- An expression in a conditional statement, for example:
IF $EDIT(2573,'99999') EQ 02573 THEN...
- An expression which serves as the argument to another function, for example:
%L=$LEN($EDIT(2573,'99999'))
The direct use of function calls in some statements, such as FIND, results in compilation errors.
Comparing successful and unsuccessful $function code
If your request is coded as follows:
BEGIN $EDIT(2573,'99999') END
The following error is your result:
*** 1 M204.0229: INVALID STATEMENT $EDIT(2573,'99999')
However, if you code your request as follows, it works properly:
BEGIN PRINT $EDIT(2573,'99999') * Or * * %X=$EDIT(2573,'99999') * END
Function return values
Each function returns a single value to the calling request. For example, this function sets %A equal to the user's login account name:
%a = $account
This function causes the length of the current value of the FULLNAME field to be compared to 10:
IF $LEN(FULLNAME) GT 10 THEN . . .
Function arguments
Some functions require one or more arguments which allow you to pass information to the subroutine. Some functions take no arguments. Arguments must be enclosed in parentheses and separated by commas. For example:
IF $READ('CONTINUE?') EQ 'YES' THEN . . . %X = $mod(COUNT IN CT, %BASE)
Rules for function arguments
Function arguments follow the normal rules for arithmetic expressions. Arguments can include other function calls and can perform any type of computation. See the section Expressions for detailed information on expression syntax.
Argument evaluation and conversion
Model 204 evaluates each argument to a function as either a string or a number. When this data type conflicts with the data type required by the function, the following rules apply:
- If an argument is expected to be numeric but is a string, Model 204 converts the string to a number according to the conversion rules described in the assignment statement discussion in Relationship between %variable assignment and declaration and Conversion.
- If an argument is expected to be a string but is numeric, Model 204 converts the number to a string.
- If the original number contains decimal places, they are lost during the conversion.
User-written functions
In addition to the functions provided by SOUL, some customer sites write their own functions based on their particular needs. Before using any user-written functions, make sure that your site's FUNU module has been reassembled with the macro library supplied with the current release. Also, please be sure to carefully test your user-written functions before your system goes into production.
Notes:
- It is recommended that all user-written functions use the STMG/LMG Assembly Language instructions to save and restore any registers that are modified.
- The RESULT macro does not work in Model 204 Version 5.1 and later. Change any use of the RESULT macro in $functions to use the standard LEAVENUM, LEAVEF0 and LEAVESTR macros.
- In addition to the above considerations, see the installation instructions relating to FUNU.
Customers are individually responsible for any functions they write. Rocket Software takes no responsibility for user-written functions or their documentation.