S1 and S1 are named conditions. They will be true or not true depending upon the value of H1 (or G1 in this case).
The code:
Set S1 to true
will cause the value of H1 (and G1 in the case of your specific group) to be 'Y'. If you execute:
Set S2 to true
the value of H1 (and G1 again) will be a character 'N'.
These can be tested using standard relational conditions. For example:
Evaluate true
when S1
Display "S1 is true"
when S2
Display "S2 is true"
End-Evaluate
If S1
Display "S1 is true"
Else
Display "S1 is false"
End-If
Bruno covered most of the important features of 88-levels, or named conditions, but I feel it is important to mention the way they are badly abused by Cobol programs that just can't give up their 1974 skills.
You will often see people doing things like:
Move 'Y' to H1
This is a really bad idea for several reasons:
- someday, somebody is going to "move 'x' to H1" and really mess up your day
- somebody is going to write code like "if H1 = 'Y'" and make it impossible to scan for uses of your named condition
There is a way to avoid this, use an unnamed byte with your named conditions. If your data item looks like this:
01 G1
02 ...
02 Filler Pic X value 'N'.
03 S1 value 'Y'.
03 S2 value 'N'.
By skipping the name on H1, you FORCE other programmers working with your data layout to use your named conditions S1 and S2. This has many benefits, chief among them is that you can always scan your source repository for the named conditions and you can identify all changes easily.