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

Initialize 88 level condition name


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

New User


Joined: 13 Apr 2006
Posts: 14
Location: USA

PostPosted: Thu Jun 07, 2012 9:04 am
Reply with quote

Can we initialize 88 level condition name variable?
88 ABC-Y VALUE 'Y'
INITIALIZE ABC-Y
Back to top
View user's profile Send private message
chandan.inst

Active User


Joined: 03 Nov 2005
Posts: 275
Location: Mumbai

PostPosted: Thu Jun 07, 2012 9:09 am
Reply with quote

Hi Shekhar,

yes you can initilaize your variable with 88 level value but not in the way you did

For example

Code:
05 WS-A                   PIC X(1)      VALUE 'N'.
     88 ABC-Y                                VALUE 'Y' .


to set WS-A to 'Y' you need to mention like below

Code:
SET ABC-Y   TO TRUE


Addition to this I would suggest go through the CObol manulas to understand the basic concepts.

Regards,
Chandan
Back to top
View user's profile Send private message
shekhar1s

New User


Joined: 13 Apr 2006
Posts: 14
Location: USA

PostPosted: Thu Jun 07, 2012 9:15 am
Reply with quote

Ohh Sorry, I mean to say that what happens if we initialize it like below:
INITIALIZE ABC-Y

Will it reset to spaces? or will it retain the value 'Y' or some error?
Back to top
View user's profile Send private message
Pandora-Box

Global Moderator


Joined: 07 Sep 2006
Posts: 1592
Location: Andromeda Galaxy

PostPosted: Thu Jun 07, 2012 9:56 am
Reply with quote

Looks like an interview question

why didnt you try writing a small program
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Thu Jun 07, 2012 10:50 am
Reply with quote

A field declared with a level number of 88 is commonly known as a 'condition name'. They use no storage, for proof, check the excellent post from Robert (Sample) in this thread.

The INITIALIZE statement sets selected categories of data fields to predetermined values. It is functionally equivalent to one or more MOVE statements. And the MOVE statement transfers data from one area of storage to one or more other areas.

If you add these tidbits, you'll understand the question does not stand on practical grounds. INITIALIZE work on storage and 88-levels take no storage.

You can also treat 88-levels as toggle-switch -- which is by its very nature, is either ON or OFF. If you've multiple conditions to check from, then too, only one switch is ON. If by INITIALIZE you mean to put all the conditions either ON or OFF - that is not what this level is designed for.
Back to top
View user's profile Send private message
shekhar1s

New User


Joined: 13 Apr 2006
Posts: 14
Location: USA

PostPosted: Sat Jun 09, 2012 9:21 pm
Reply with quote

Thanks Anuj, for so good explanation... i would assume that this would be the compiler error.
Back to top
View user's profile Send private message
Pandora-Box

Global Moderator


Joined: 07 Sep 2006
Posts: 1592
Location: Andromeda Galaxy

PostPosted: Sat Jun 09, 2012 9:43 pm
Reply with quote

Phew

Assume yet this shows you have not written a 10 line code
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: Sat Jun 09, 2012 10:01 pm
Reply with quote

Hello,

Quote:
i would assume that this would be the compiler error.
If there was a compiler error that you did not understand, you should have posted the relevant code and the compiler error(s).

By not postng the "real" issue initially, this just wasted several iterations and people's time.
Back to top
View user's profile Send private message
shekhar1s

New User


Joined: 13 Apr 2006
Posts: 14
Location: USA

PostPosted: Sat Jun 09, 2012 11:20 pm
Reply with quote

I am sorry but i did not write any program for this, the question just got into my mind so thought of asking here as it got so many good brains...
And if you feel that this is just wastage of time... i don't feel so... it opens mind of people those reading this post and thinking for the solution and explanation... Also as some people said this could be the good question for interview... if you really want to test the people thoughts... How good would be the technical skills when the person answers something like Anuj...
Time never ever wasted my friend... everyday we learn something from
stupid/intelligent questions or discussion... we are still learners... so be cool and have patience...
Back to top
View user's profile Send private message
Pandora-Box

Global Moderator


Joined: 07 Sep 2006
Posts: 1592
Location: Andromeda Galaxy

PostPosted: Sat Jun 09, 2012 11:49 pm
Reply with quote

1.You never searched
2.I believe there was just the same question a few days back in the very same forum
3.Again ( I am trying to sound like a friend) coming to my point if you had just read the manual and provided you are able to articulate the examples and concept of 88 level variables and searching forum I bet you could have developed all permutation and combinations of code and you would have mastered it yourself
4.There wouldnt have been the need to prolong the thread for 2 days
5.It might be painful even after explanation you dont give attempt to try and blindly say you 'Assume'
6.Its like teaching people for free who shows no interest
7.Last but not the All experts would be happy to see programmers who show intrest in resolving their own techincal problems
8.(I am no expert yet icon_smile.gif)
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: Sun Jun 10, 2012 2:40 am
Reply with quote

We just had this thread starting May 31st. shekhar1s, did you even TRY to search the forum before posting your question? Because you basically asked EXACTLY the same thing.
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: Sun Jun 10, 2012 7:32 am
Reply with quote

Hello,

Quote:
And if you feel that this is just wastage of time... i don't feel so... it opens mind of people those reading this post and thinking for the solution and explanation...
Hopefully, you will change your "feeling". It is very much off the mark . . .

As was mentioned, this was asked only a week or so ago. As you have been here for more than 6 we can only hope that you would know how to use the forum Search.

This forum expects to have members with some level of experience and this topic is covered in the first year of COBOL training. People are also expected to try things on their system and if strange things occur, post what they tried and what happened - posting relevant info so we can help.

As far as "cool and patience" do you not understnd that if we were not these, your topic would have been locked and you probably would have been Warned of worse.
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 How to load to DB2 with column level ... DB2 6
No new posts ISRSUPC search utility - using high l... TSO/ISPF 2
No new posts How to give complex condition in JCL . CLIST & REXX 30
No new posts selectively copy based on condition DFSORT/ICETOOL 3
No new posts JPM Reports for each DB2 V12 Function... DB2 0
Search our Forums:

Back to Top