View previous topic :: View next topic
|
Author |
Message |
saurabhgemini10
New User
Joined: 15 Sep 2008 Posts: 5 Location: India
|
|
|
|
Hello All,
77 A PIC X(1)
88 B value "YES"
88 C value "NO"
Will this work??
If this works then what will be the value??
If this doesnt work, then what error??
Please let me know.
Thanks in Advance |
|
Back to top |
|
|
Bharath Bhat
Active User
Joined: 20 Mar 2008 Posts: 283 Location: chennai
|
|
|
|
Try it out and then ask a question..... |
|
Back to top |
|
|
revel
Active User
Joined: 05 Apr 2005 Posts: 135 Location: Bangalore/Chennai-INDIA
|
|
|
|
Hi,
Welcome to forum,
the above code will throw error; Any how i will tell use of 88 level
The 88 Level
---------------
Consider an example
Code: |
01 A PIC X(03).
88 B VALUE "YES".
88 C VALUE "NO". |
B is a conditional name; this become true when A will have that value ie when you populate "YES" value to A data items
You can use in this way
say
Code: |
PERFORM <para-1> UNTIL B
para-1
--------
IF <condition>
MOVE "YES" TO A
END-IF. |
the paragraph <para-1> will execute till A attain "YES" Value
Hope this helps...
Check it out link for further assistence
ibmmainframes.com/about11085.html |
|
Back to top |
|
|
saurabhgemini10
New User
Joined: 15 Sep 2008 Posts: 5 Location: India
|
|
|
|
Thanks revel... |
|
Back to top |
|
|
Marso
REXX Moderator
Joined: 13 Mar 2006 Posts: 1353 Location: Israel
|
|
|
|
It won't work for 2 reasons:
1. Field is one char long and values are 3 char long.
2. You have to put a period (.) at the end of each sentence in WS.
Assuming that the field is now PIC X(3), it is still without value.
If you want to have a default value, use:
Code: |
77 A PIC X(3) VALUE 'YES'. |
revel wrote: |
Code: |
PERFORM <para-1> UNTIL B
para-1
--------
IF <condition>
MOVE "YES" TO A
END-IF. |
|
The whole idea about using level 88 is not to use constants in the program body,
so please use SET A TO TRUE instead of that ugly MOVE statement |
|
Back to top |
|
|
Cristopher
New User
Joined: 31 Jul 2008 Posts: 53 Location: NY
|
|
|
|
saurabhgemini10 with all this valuable information do remember that its not necessary to have 77 level variable to define flags(88 level variables) and it is a good practice to give default value to the variable and use set in place of move as suggested by Marso.
Cris |
|
Back to top |
|
|
anil.csk
New User
Joined: 22 Oct 2007 Posts: 16 Location: Noida
|
|
|
|
i will work fine... |
|
Back to top |
|
|
|