About cookies on this site Our websites require some cookies to function properly (required). In addition, other cookies may be used with your consent to analyze site usage, improve the user experience and for advertising. For more information, please review your options. By visiting our website, you agree to our processing of information as described in IBM’sprivacy statement. To provide a smooth navigation, your cookie preferences will be shared across the IBM web domains listed here.
OpenExtensions for z/VM "Q"s and "A"s
Question: Why can't I get "special characters" to work correctly with the shell cms command? If I type:
cms filelist * * aI get a message like:
DMSPCL389E Invalid filetype: A.A
Or if I type a command like
cms listfile * * a ( dateI get a message like:
GSU7332 syntax error: got (, expecting Newline
Answer: Some characters, such as asterisks, parentheses, and quotes, have special meaning in the shell. The asterisks and parenthesis are being stripped before CMS sees the arguments.
The solution is to "protect" these special characters so the shell treats them as ordinary characters. One way to do this is by enclosing the text containing special characters with single or double quotes. The following commands are all equivalent:
cms "filelist * * a" cms filelist "* * a" cms filelist '* *' aThis method is simple and will probably work with most commands, but it is not 100% foolproof. Consider what would happen if your arguments contained a single or double quote (double quotes are also special characters).
A method that is guaranteed to work but is a little more difficult to use is to "escape" each special character (each single quote, each asterisk, each parenthesis, etc.) with a backslash:
cms listfile \* \* a \(date
These techniques of protecting special characters are important when you use utilities such as c89 to refer to BFS files and you need specify special characters in the file identifiers.
For more questions and answers, go to our archive of questions and answers.