The CMDWCO macro generates a new string from an existing string with the aid of a selector and constructor. The output string and its length are stored in the parameter area in the fields '<prefix><macid>NAM' and '<prefix><macid>LEN', respectively. The input string and the output string may be of any SDF data type. The user should therefore perform a data type analysis independently (by using the CMDVAL macro), since the input string is not compared syntactically with the output string in this case.
Operation | Operands |
CMDWCO | SELECT = <c-string 1..255> / <var: char(255)> ,CONSTR = <c-string 1..255> / <var: char(255)> ,SRCNAME = <c-string 1..255> / <var: char(255)> ,MAXLEN =255 / <integer 1..255> / <var: integer(1)> ,PARTIAL = *NO / *YES / bit(1) ,SYNTAX = *BS2000 / *POSIX ,PREFIX = C / <char(1)> ,MACID = MDW / <char(3)> ,MF = D / C / L / M / E ,PARAM = <var: pointer> |
SELECT =
Specifies the selector, i.e. a selection string consisting of a combination of a wildcard pattern and constant name components (see the description of the SDF metasyntax in section 1.5). The selector can have a maximum length of 255 characters. If it is shorter, it must be terminated by at least one blank. If an empty selector (blanks) is specified in combination with PARTIAL=*YES, all names are selected, with the same handling as for partially qualified file names.
<c-string 1..255>
Specification in the form of a C string constant.
<var: char(255)>
Specification in the form of a string variable.
CONSTR =
Specifies the constructor, i.e. a construction string consisting of a combination of a construction pattern and constant name components (see the description of the SDF metasyntax in section 1.5). The constructor can have a maximum length of 255 characters. If it is shorter, it must be terminated by at least one blank. If an empty constructor (consisting of blanks) is specified in combination with PARTIAL=*YES, all names are selected, with the same handling as for partially qualified file names.
<c-string 1..255>
Specification in the form of a C string constant.
<var: char(255)>
Specification in the form of a string variable.
SRCNAME =
Specifies the source string referenced by the selection pattern. This string can have a maximum length of 255 characters. If it is shorter, it must be terminated by at least one blank.
<c-string 1..255>
Specification in the form of a C string constant.
<var: char(255)>
Specification in the form of a string variable.
MAXLEN =
Specifies the maximum length of the output string to be generated.
If a generated output string is longer than the value specified here, an error code is returned, and only the number of characters specified for MAXLEN is entered in the parameter area.
255 / <integer 1..255>
Specifies the maximum length. Default a length of 255 bytes.
<var: int(1)>
Specifies the maximum length by means of an integer variable with a length of 1 byte.
PARTIAL =
Partial qualification is allowed. The presence of a period at the end of the selection or construction string (i.e. the selector or constructor) is interpreted as a partial qualification. This is also assumed if the selector and constructor are blank. An empty string (blanks) is interpreted as the wildcard ’*’. This implicitly constructed pattern cannot be referenced by ’*’ in the constructor character string.
The string ’xxxx. ’ is interpreted as ’xxxx.*’.
*NO
A period at the end of the selector or constructor is interpreted as a constant, so blank selectors can only be used to select blank SRCNAMEs, and blank constructors can only be used to generate blank file names.
*YES
A period at the end of the selector or constructor is interpreted as a partial qualification. This also applies to empty strings.
<var: bit(1)>
Bit variable: | bit = 0: partial qualification is not allowed. |
SYNTAX =
Defines which type of wildcard syntax is used.
*BS2000
The complete BS2000 wildcard syntax may be used.
*POSIX
The POSIX wildcard syntax is used.
<var: bit(1)>
Bit variable: | bit = 0: as for *BS2000 |
For a description of the parameters PREFIX, MACID, MF and PARAM: see section “Macrotypes”.
Return information and error flags
The return code is passed in the standard header of the parameter area.
If SC1=X'00' applies, the output fields will contain valid information.:
<prefix><macid>LEN : | Length of the generated string. |
<prefix><macid>NAM: | Generated string, followed by blanks. |
Standard header | cc: Subcode 2 (SC2) bb: Subcode 1 (SC1) aaaa: Maincode |
(SC2) |
| Maincode | Meaning |
00 00 00 00 00 | 00 40 40 01 01 | 0000 0002 0003 0004 0008 | No errors Invalid selector or SRCNAME not selectable Syntax error in constructor or semantic error Generated string is longer than MAXLEN. The output area is only filled up to a length of MAXLEN. Error in parameter list (access error or parameter not supported) |