Domain: String functions
The RENAME( ) function provides a new name. This new name is generated on the basis of the input name, using wildcards.
Format
RENAME( ) |
INPUT-NAME = string_expression ,WILDCARD-PATTERN = string_expression ,CONSTRUCTION-WILDCARD = string_expression ,NO-MATCH = *WARNING / *IGNORE / *ERROR ,WILDCARD-MODE = *BS2000 / *POSIX |
Result type
STRING
Input parameters
INPUT-NAME = string_expression
Designates the string which is to be replaced.
WILDCARD-PATTERN = string_expression
Specifies the search pattern.
CONSTRUCTION-WILDCARD = string_expression
Specifies the rules by which the new name is to be constructed. (For details see the “LMS” manual [11].)
NO-MATCH =
Specifies what is to be done if the search pattern is not found.
NO-MATCH = *WARNING
A warning is output.
NO-MATCH = *IGNORE
No action.
NO-MATCH = *ERROR
An error message is output.
WILDCARD-MODE = *BS2000 / *POSIX
Specifies how wildcards are to be interpreted during replacement; either in the BS2000 wildcard syntax or in the POSIX wildcard syntax.
Result
The new name, in the form of a string
Error messages
SDP0467 NO NAME FOUND; PROCESSING CONTINUES SDP0468 NO NAME FOUND SDP0482 AN INPUT STRING IS TOO LONG (1..255) SDP0483 INCORRECT CONSTRUCTION-WILDCARD VALUE SDP0484 TOO LONG RESULT STRING (1..255)
Example
/A = RENAME(‘A.B‘,‘A.*‘,‘NEWA.*‘) /SHOW-VARIABLE A A = NEWA.B /A = RENAME(‘B.A‘,‘A.*‘,‘NEWA.*‘) SDP0467 NO NAME FOUND; PROCESSING CONTINUES /SHOW-VARIABLE A A = B.A /A = RENAME(‘B.A‘,‘A.*‘,‘NEWA.*‘,NO-MATCH=*IGNORE) /SHOW-VARIABLE A A = B.A /A = RENAME(‘B.A‘,‘A.*‘,‘NEWA.*‘,NO-MATCH=*ERROR) SDP0239 ERROR DURING EVALUATION OF RIGHT SIDE OF ASSIGNMENT. SDP0431 ERROR '(&00)' IN BUILTIN FUNCTION '(&01)' SDP0468 NO NAME FOUND /A = RENAME(‘A.B.C‘,‘A///C‘,‘NEWA///NEWC‘) /SHOW-VARIABLE A A = NEWA.B.NEWC /A = RENAME(‘A.B‘,‘*.*‘,‘**‘) /SHOW-VARIABLE A A = AB /A = RENAME(‘A.B‘,‘*.*‘,‘<1><1>‘) /SHOW-VARIABLE A A = AA /A = RENAME(‘A.B‘,‘/./‘,‘XYZ<2>‘) /SHOW-VARIABLE A A = XYZB