View previous topic :: View next topic
|
Author |
Message |
rkprasanth_m
New User
Joined: 22 Jun 2006 Posts: 44
|
|
|
|
I have assigned multiple values for a condition name. then which value will be assigned by SET function if I SET to true |
|
Back to top |
|
|
UmeySan
Active Member
Joined: 22 Aug 2006 Posts: 771 Location: Germany
|
|
|
|
Hi
Here's an example.
Definition in workingStorage
01 PGM-RETURN PIC X(04).
88 MDL30060-ZUENDE VALUE '0000'.
88 MDL30060-WEITER VALUE '0002'.
88 MDL30060-PGHINW VALUE '0005'.
88 MDL30060-PGWARN VALUE '0006'.
88 MDL30060-FEHLER VALUE '9999'.
...In coding
Set MDL30060-Weiter to true
... If MDL30060-Weiter
perform ...
End-If
...Evaluate true
when MDL30060-FEHLER Perform
End-Evaluate
Hope it helps, Regards, UmeySan |
|
Back to top |
|
|
rkprasanth_m
New User
Joined: 22 Jun 2006 Posts: 44
|
|
|
|
In your case
suppose 88 MDL30060-WEITER VALUE '0002' '0009' '0008'
If I SET 'MDL30060-WEITER to TRUE then 'PGM-RETURN' contains which value, I mean '0002' or '0009' or '0008' |
|
Back to top |
|
|
adarsha
New User
Joined: 28 Dec 2006 Posts: 8 Location: Noida,Delhi
|
|
|
|
hi,
the set function is an enhanced parameter prvided in the cobol-85.
it sets the parti cular variable u were wished.
it can be any one of the below (as per the preious reply)
88 MDL30060-ZUENDE VALUE '0000'.
88 MDL30060-WEITER VALUE '0002'.
88 MDL30060-PGHINW VALUE '0005'.
88 MDL30060-PGWARN VALUE '0006'.
88 MDL30060-FEHLER VALUE '9999'. |
|
Back to top |
|
|
UmeySan
Active Member
Joined: 22 Aug 2006 Posts: 771 Location: Germany
|
|
|
|
@ rkprasanth_m !
In my example, i used the 88-names for clarifying a distinct status.
Multiple values i use when perhaps testing some flags.
Example:
01 RecordFlag
88 Record-Department-01 VALUE '0002' '0009' '0008'
88 Record-Department-02 VALUE '0005' '0007' '0001'
If Record-Department-01
Perform Processinf for Department-01
End-If
So here, the incoming record is processed depending on his flag.
I think using SET TO TRUE makes no sense by multiple values.
Regards, UmeySan |
|
Back to top |
|
|
rkprasanth_m
New User
Joined: 22 Jun 2006 Posts: 44
|
|
|
|
OK, I found answer.
Here is what IBM manul says
"If more than one literal is specified in the VALUE clause of condition-name-1, its associated conditional variable is set equal to the first literal."
It means First litiral in value clause ocupied in condition-variable. |
|
Back to top |
|
|
Phrzby Phil
Senior Member
Joined: 31 Oct 2006 Posts: 1042 Location: Richmond, Virginia
|
|
|
|
Why not test this - it should take just a few minutes. Then you'll know for sure.
SET the value, then DISPLAY the variable. |
|
Back to top |
|
|
|