Kevin Roberts	01/25/2004

Jason Herne	02/22/2004

File creation via CMS command l

Problem:

We need to be able to write files from a CMS command line in order to accomplish administrative tasks like modifying the SYSTEM CONFIG file.

Initial File Creation:

The "pipe" command can be used to pipe things from one stage to the next. The stages are separated by the "|" character (on most terminals).
The "literal" stage can be used to pass a literal string into a stream.

The limitation of this is that it creates a single line.
The "append" stage can be used to append things to a stream. Which can be used along with literal to append a bunch of lines of literal strings together.
Combining all of these together we can create a file with many lines by using the following command:

"PIPE LITERAL line 1| APPEND LITERAL line 2| > FN FE FM"

The ">" stage can be used to create or replace a CMS file with the input stream, gotten from previous stages of the pipe command.

The ">>" stage can be used to append data to a CMS file.

Special Characters:

The | character is used to separate stages. If we need to write this character to a file we must use the escape sequence || like so:

"PIPE LITERAL line|| with pipe| APPEND LITERAL line 2| > FN FE FM"

There are also a set of characters that need to be specially escaped with a " character. These characters include: " [ ] @ #

"PIPE LITERAL line "[1"]| APPEND LITERAL line ""two in quotes""| > FN FE FM"

Blank Lines:

To print a blank line, you must leave TWO spaces after the word LITERAL and then immediately end the stage with the | character:

"PIPE LITERAL line1| APPEND LITERAL | APPEND LITERAL line2| > FN FE FM"

CMS Command Line Length Limitation:

The CMS command line has a 256 character limit, which means that if we want to be able to write large files we will need to use multiple commands. We can accomplish this by creating the file with the > symbol for our first command and using >> (append) on successive commands. Example:

PIPE LITERAL first line of text| APPEND LITERAL line2| > FN FE FM

PIPE LITERAL third line of text| APPEND LITERAL line4| >> FN FE FM

2004-02-04T20:12:39