Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Level 88 with Value

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
saurabhgemini10

New User


Joined: 15 Sep 2008
Posts: 5
Location: India

PostPosted: Mon Sep 15, 2008 4:04 pm    Post subject: Level 88 with Value
Reply with quote

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
View user's profile Send private message

Bharath Bhat

Active User


Joined: 20 Mar 2008
Posts: 283
Location: chennai

PostPosted: Mon Sep 15, 2008 4:23 pm    Post subject:
Reply with quote

Try it out and then ask a question.....
Back to top
View user's profile Send private message
revel

Active User


Joined: 05 Apr 2005
Posts: 135
Location: Bangalore/Chennai-INDIA

PostPosted: Mon Sep 15, 2008 4:25 pm    Post subject:
Reply with quote

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

http://ibmmainframes.com/about11085.html
Back to top
View user's profile Send private message
saurabhgemini10

New User


Joined: 15 Sep 2008
Posts: 5
Location: India

PostPosted: Mon Sep 15, 2008 4:30 pm    Post subject:
Reply with quote

Thanks revel...
Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1228
Location: Israel

PostPosted: Mon Sep 15, 2008 9:09 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Cristopher

New User


Joined: 31 Jul 2008
Posts: 53
Location: NY

PostPosted: Mon Sep 15, 2008 9:57 pm    Post subject: Reply to: Level 88 with Value
Reply with quote

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
View user's profile Send private message
anil.csk

New User


Joined: 22 Oct 2007
Posts: 16
Location: Noida

PostPosted: Tue Sep 16, 2008 1:53 pm    Post subject: Reply to: Level 88 with Value
Reply with quote

i will work fine...
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Syncsort TPF Level Majid Hussain SYNCSORT 2 Wed Apr 13, 2016 2:22 am
No new posts Need a logic to validate the data in ... sandeep kumar302 COBOL Programming 17 Mon Feb 01, 2016 3:30 pm
No new posts DB2 10.1 Share level locking and Sele... Mary Lewis DB2 1 Wed Apr 15, 2015 9:51 pm
No new posts CICS SE Level Openings in Accenture enikhilk Mainframe Jobs 0 Mon Sep 01, 2014 6:39 pm
No new posts 88 level variable logic not working sandeep kumar302 COBOL Programming 19 Thu Jul 31, 2014 10:59 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us