X
Set X keyword value …
(J=justified)
(Initially: <null> List ON Tab OFF Local OFF Global OFF)
Set X configures automatic tagging of source changes in COBOL programs. The syntax of Set X is as follows:
Set X [ options ]
["xx"][dateform]["xx"] | define the tag content | default is a null string |
List ON | OFF | control the display of tag columns | default ON |
Tab ON | OFF | allow manual editing of tag columns | default OFF |
Local ON | OFF | tag value saved in workfile | default OFF |
Global ON | OFF | allow use of local tags | default OFF |
Null | reset global and local tags |
To check on the current tag value and options, use Verify X.
If you want all COBOL changes to be tagged, all files must be have Set Lang Cobolx, not Set Lang Cobol. You can enforce this for all users by putting Set Lang Cobolx All On into your Qeditmgr file.
Tag format. The Set X command allows several formats for the date tag, plus the ability to replace, precede or follow the date with a short string. Once you have configured your “X” tag, Qedit will automatically mark all changed lines in COBOLX files with that tag in columns 73 to 80.
The dateform parameter can be any of these options:
Keyword | Sample |
DATE | 22 NOV99 |
DDMMMYY | 22 Nov99 |
CCYYMMDD | 19991122 |
YYMMDD | 991122 |
MMDDYY | 112299 |
DDMMYY | 221199 |
DDMMMYY and CCYYMMDD occupy 8 characters, but YYMMDD, MMDDYY and DDMMYY occupy only 6. Therefore, the last three can be combined with a string giving your initials, before or after today’s date.
/set x "rg" yymmdd {tag is "rg991122" }
Null vs Blanks
Entering Set X without parameters, Set X Null, or Set X “” effectively turns off the tagging feature. Tags on modified lines are not changed. Lines without tags do not get one. Lines that already have tags retain their current values.
This is different from setting the value to blanks, as in Set X ” “. With this setting, tags on modified lines are actually cleared.
List. The List option tells whether the comment tag should be shown during normal editing and listing of lines. The default value is ON, but you can disable listing with S X List OFF. Even though the comment tag is not listed, it is still part of the line and is retained when you Text or Keep the file.
When you edit a COBOLX file in Visual, Qedit sets the right margin in column 72 (instead of column 80). In this way, you can see the comment field (columns 73 through 80) but it won’t shift left when you delete characters.
Line Overflow
Tagging can be disabled by specifying an empty string.
Set X Null Set X ""
While disabled, the text and tag areas are treated as one. As such, edit commands, such as Change, are applied to the complete line.
Also, if a tag is specified and the List option is On, tag values are treated as part of the text.
If a line has a tag value and an edit operation, such as Change or Modify, causes the line to expand, Qedit reports an overflow error. To avoid this, you can Set X to Null, but you would have to remember the previous setting. A better solution is to turn the List option Off temporarily. The X value is preserved, but the tag area cannot be edited.
Margins. For those users who still must enter and edit the tag field manually, Set X Tab On puts Qedit’s Visual right margin at column 80 instead of column 72. This makes it much easier to edit those columns because you can tab to them.
Local Tag. Users can define a tag that is specific to the workfile currently opened. The local tag value is stored in the Qedit control blocks. Thus, the local tag is preserved when you Shut the workfile. You can also control the tag display for a specific workfile with the List option.
To enable the local tag option, simply enter
/Set X Local On
From that point, any changes to the tag are recorded in the workfile. The statement above sets the local tag to a null value. You can specify the new value on a similar statement so that it can be used immediately. Because a local tag is workfile-specific, if you switch to a different workfile, the local tag option is automatically disabled and Qedit starts to use the default tag again.
If you want to stop using the local tag, enter Set X Local Off. This clears the local tag value and Qedit starts using the default tag. Enabling the local option again does not return the tag to its previous value.
If you are strictly using the Text and Keep commands to edit your source files, the information is lost as soon as the workfile is purged or cleared.
Global. By default, users can define their own local COBOL tag. If this is undesirable, system managers can enforce the use of a single tag for all COBOL files by using
/Set X Global On
Once enabled, users are not allowed to use the Local option of the Set X command. They can still use the Set X command, but only the global tag value can be changed.
To allow the use of local COBOL tags again, simply enter
/Set X Global Off
The global tag has priority over any local tag. If you are accessing a workfile with a local tag and you disable the Global option, Qedit resumes using the saved local tag.
/Set X "localtag" Local On /Verify X Set X "localtag" Local On Default "ME990204" List ON Tab OFF /Set X Global On /Verify X Set X "ME990204" Global On List ON Tab OFF /Set X Global Off /Verify X Set X "localtag" Local On Default "ME990204" List ON Tab OFF
When the local option is enabled, the first tag shown on the Verify output is the local value. It is followed by the words Local On. The global tag is displayed after the keyword Default.
Null. If you want to reset all COBOL tags currently in use (global and local), use the Set X Null command.
Change Confirmation. The justified option, “SetJ”, displays the current X values including the active tag, the default tag and the local tag settings. It applies the changed settings entered on the command and, lastly, it displays the revised settings. When none of the Cobx tags are set, the output is:
Set X values before this command: Active tag value=, List ON Default tag value=, List ON Local tag value. NONE List NOT SAVED Set X values AFTER the command: Active tag value=, List ON Default tag value=, List ON Local tag value. NONE List NOT SAVED
The first 4 lines show the current
settings. The last 4 show the settings after the requested change has been applied. When there is no tag value, Qedit displays an empty string or the word “NONE”. When the List option displays as “NOT SAVED”, it means the Local feature is enabled but the List setting has not been explicitly set yet.
If the tag values are set, the result strings are displayed as in:
/set x local off /set x "GB" yymmdd /set x local on /setj x "LC" yymmdd Set X values before this command: Active tag value=, List ON Default tag value=GB011213, List ON Local tag value. prefix= suffix= dateform=0 List NOT SAVED Warning: Local ON: only updates tag for this workfile, not defaults. Set X values AFTER the command: Active tag value=LC011213, List ON Default tag value=GB011213, List ON Local tag value. prefix=LC suffix= dateform=2 List NOT SAVED
In this example, the first Set command turns Local X off. The second Set command changes the default tag to the prefix “GB” followed by the current date in year-month-day format. The third Set command turns Local X back on and, finally, the SetJ command sets the local tag to the prefix “LC” followed by the date in the same format. Looking at the SetJ output, there is the then-current default tag, “GB011213″, with List enabled. There was no local tag and List was not set at that point.
The new local tag is applied and produces a warning. After the change, The active tag is the local one and List is enabled (default value). The default tag is unchanged. The last line provides details on how the local tag was constructed. The List option still shows as NOT SAVED because it has not been changed explicitly after Local X was turned on.
Verify. The Verify command displays detailed information about the local and default settings.
/verify x Set X Tab OFF "ME011214" List ON /set x local on /verify x Set X Tab OFF Local On "LC011214" List ON Default: "ME011214" List ON