Most intrinsic M functions are supported as instrinsic methods of a primitive class (e.g., String, Number, Date, Boolean, Time). The parameter list for the methods is the same as it was for the M functions, except that the first parameter is eliminated as it is now the object identifier. For example,
// M function
set x = $P(y,"|",2)
//is the same as PSL method
set x = y.piece("|",2)
However, you may need to add explicit typecasting to prevent method mismatch warnings. Use the following PSL intrinsic methods instead of the associated M intrinsic function. No other M intrinsic functions are supported by PSL.
Replace M Instrinsic Function... |
With PSL Instrinsic Method... |
$ASCII |
|
$CHAR |
Copied.(*) |
$DATA |
Consider recoding into Object.exists(), unless the code explicitly or implicitly uses the values 10 and 11. |
$EXTRACT |
|
$FIND |
|
$FNUMBER |
|
$GET |
|
$JUSTIFY |
|
$LENGTH |
|
$ORDER |
|
$PIECE |
|
$QUERY |
|
$RANDOM |
|
$SELECT |
Copied. |
$TRANSLATE |
|
$ZDATE |
Although this function is copied, consider replacing by Date.toString(). |
$ZJOBEXAM |
Copied. |
(*) Copied indicates that the function is not part of the official PSL specification. However, you can simply copy the code from the PSL source to the M target routine.