IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Condition Naming in COBOL


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Arun bv

New User


Joined: 29 Dec 2010
Posts: 41
Location: Mumbai

PostPosted: Wed Dec 29, 2010 9:58 am
Reply with quote

10 Group PIC X(02).

88 MA-GROUP VALUE 'GF'.



Is MA-PZ-ID defaults to ‘GF’.

Can anyone Explain me Condition naming.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Wed Dec 29, 2010 10:08 am
Reply with quote

Hello and welcome to the forum,

At the top of the page is a link to "IBM Manuals". The first set is COBOL.

Read about level 88 entries in a Language Reference (actually any of them will suffice). If you find something in the manual that is not clear, post what you found and your doubt. Someone will be able to clarify.

If this is new to you, you will most likely be better served in our Student and Fresher forum:
www.ibmmainframeforum.com/index.php
Back to top
View user's profile Send private message
Phrzby Phil

Senior Member


Joined: 31 Oct 2006
Posts: 1042
Location: Richmond, Virginia

PostPosted: Wed Dec 29, 2010 10:09 am
Reply with quote

You have not defined MA-PZ-ID.

What does "Is MA-PZ-ID defaults to ‘GF’" mean?

Is "condition naming" in the COBOL manual? If so, what does the manual say? If not, what is the question?

Have you seen this in a program?
Back to top
View user's profile Send private message
Arun bv

New User


Joined: 29 Dec 2010
Posts: 41
Location: Mumbai

PostPosted: Wed Dec 29, 2010 10:28 am
Reply with quote

sorry for the typo error. this is the right question


10 Group PIC X(02).

88 MA-GROUP VALUE 'GF'.



Is MA-GROUP defaults to ‘GF’.
Back to top
View user's profile Send private message
niks_jude
Warnings : 1

Active User


Joined: 01 Dec 2006
Posts: 144
Location: Mumbai

PostPosted: Wed Dec 29, 2010 11:53 am
Reply with quote

Very basic question which you could have discussed with your seniors I guess.

No it defaults to junk.....you have to give default through VALUE clause.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Wed Dec 29, 2010 3:10 pm
Reply with quote

or SET condition-name TO TRUE
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Wed Dec 29, 2010 3:52 pm
Reply with quote

Does your question make sense if you have this instead (and this is valid COBOL, by the way)?
Code:
10 Group PIC X(02).

88 MA-GROUP VALUE 'GF', 'XY', 'AD', 'CO', 'B3', '9Y'.
Back to top
View user's profile Send private message
Jeffrey Ranney

New User


Joined: 23 Dec 2010
Posts: 20
Location: USA

PostPosted: Thu Dec 30, 2010 2:16 am
Reply with quote

You were looking for an answer to this question :

=======================
10 Group PIC X(02).

88 MA-GROUP VALUE 'GF'.

Is MA-PZ-ID defaults to ‘GF’.
=======================

The answer is 'no'. The "GROUP" has a defalut value of... nothing... as in your example there is no "VALUE" clause.

An '88' level is used for testing the value of "GROUP".

For example :

Code:
MOVE SOMETHING-FROM-INPUT    TO   GROUP
IF MA-PZ-ID
   DO THIS
ELSE
   DO THAT
END-IF
Back to top
View user's profile Send private message
Arun bv

New User


Joined: 29 Dec 2010
Posts: 41
Location: Mumbai

PostPosted: Thu Dec 30, 2010 7:21 pm
Reply with quote

Thanks everyone......... icon_rolleyes.gif
Back to top
View user's profile Send private message
rohanthengal

Active User


Joined: 19 Mar 2009
Posts: 206
Location: Globe, India

PostPosted: Tue Jan 04, 2011 11:41 am
Reply with quote

take this example for more understanding:

01 gender pic x.
88 male value 'M'.
88 female value 'F'.

now... in cobol if below statement occurs...
move 'M' to gender
then we can check whether the person is male or female..
this is the way to check...
IF male then --- this results in TRUE
do this
else
do that.

IF female then --- this results in FALSE
do this
else
do that.

CONDITION NAMES is a means to check which conditions are true based on the data value.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Replace each space in cobol string wi... COBOL Programming 3
No new posts COBOL -Linkage Section-Case Sensitive COBOL Programming 1
No new posts COBOL ZOS Web Enablement Toolkit HTTP... COBOL Programming 0
No new posts Calling DFSORT from Cobol, using OUTF... DFSORT/ICETOOL 5
No new posts Generate random number from range of ... COBOL Programming 3
Search our Forums:

Back to Top